blob: faed1b80594db27244648d4a3fbe84d9ef8dd5af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit cmake-utils versionator
PV_MAJ=$(get_version_component_range 1-2)
MY_P=${PN}-linux-${PV}
DESCRIPTION="An enterprise quality OCR engine by Cognitive Technologies"
HOMEPAGE="https://launchpad.net/cuneiform-linux"
SRC_URI="https://launchpad.net/${PN}-linux/${PV_MAJ}/${PV_MAJ}/+download/${MY_P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug graphicsmagick"
RDEPEND="
!graphicsmagick? ( media-gfx/imagemagick:= )
graphicsmagick? ( media-gfx/graphicsmagick:= )"
DEPEND="${RDEPEND}"
S=${WORKDIR}/${MY_P}
DOCS=( readme.txt )
PATCHES=(
"${FILESDIR}/c-assert.diff"
"${FILESDIR}/libm.diff"
"${FILESDIR}/abs-types_cast.patch"
"${FILESDIR}/charset-signedness.patch"
"${FILESDIR}/minmax.patch"
)
src_prepare(){
if use graphicsmagick; then
PATCHES+=( "${FILESDIR}/graphicsmagick.diff" )
else
sed -e 's/GraphicsMagick/ImageMagick/g' \
-e 's/fBgm/fBImageMagick/g' \
"${FILESDIR}/${PN}.1" > "${PN}.1" || die
fi
cmake-utils_src_prepare
# respect LDFLAGS
sed -i 's:\(set[(]CMAKE_SHARED_LINKER_FLAGS "[^"]*\):\1 $ENV{LDFLAGS}:' \
cuneiform_src/CMakeLists.txt || die "failed to sed for LDFLAGS"
# Fix automagic dependencies / linking
if use graphicsmagick; then
sed -i "s:find_package(ImageMagick COMPONENTS Magick++):#DONOTFIND:" \
cuneiform_src/CMakeLists.txt \
|| die "Sed for ImageMagick automagic dependency failed."
fi
}
src_install() {
cmake-utils_src_install
doman "${PN}.1"
}
|