forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cuneiform-1.1.0-r3.ebuild
62 lines (49 loc) · 1.49 KB
/
cuneiform-1.1.0-r3.ebuild
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-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake flag-o-matic
PV_MAJ=$(ver_cut 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}
PATCHES=(
# From Fedora
"${FILESDIR}"/${P}-c-assert.patch
"${FILESDIR}"/${P}-libm.patch
"${FILESDIR}"/${P}-fix_buffer_overflow.patch
"${FILESDIR}"/${P}-fix_buffer_overflow_2.patch
"${FILESDIR}"/${P}-gcc6.patch
"${FILESDIR}"/${P}-gcc7.patch
"${FILESDIR}"/${P}-typos.patch
"${FILESDIR}"/${P}-gcc11.patch
)
src_prepare() {
use graphicsmagick && PATCHES+=( "${FILESDIR}"/${P}-graphicsmagick.patch )
cmake_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
fi
}
src_configure() {
append-flags -fcommon
cmake_src_configure
}
src_install() {
cmake_src_install
doman "${FILESDIR}"/${PN}.1
}