sys-libs/libnih: stable 1.0.3-r4 for hppa, bug #724174
[gentoo.git] / media-gfx / exact-image / exact-image-0.8.1-r3.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit eutils multilib python-single-r1 toolchain-funcs
8
9 DESCRIPTION="A fast, modern and generic image processing library"
10 HOMEPAGE="http://www.exactcode.de/site/open_source/exactimage/"
11 SRC_URI="http://dl.exactcode.de/oss/${PN}/${P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="expat jpeg lua openexr php perl png python ruby swig tiff truetype X"
17 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
18
19 RDEPEND="x11-libs/agg[truetype]
20         sys-libs/zlib
21         expat? ( dev-libs/expat )
22         jpeg? ( virtual/jpeg )
23         lua? ( dev-lang/lua )
24         openexr? ( media-libs/openexr )
25         php? ( dev-lang/php )
26         perl? ( dev-lang/perl )
27         png? ( >=media-libs/libpng-1.2.43 )
28         python? ( ${PYTHON_DEPS} )
29         ruby? ( dev-lang/ruby )
30         tiff? ( media-libs/tiff )
31         truetype? ( >=media-libs/freetype-2 )
32         X? (
33                 x11-libs/libXext
34                 x11-libs/libXt
35                 x11-libs/libICE
36                 x11-libs/libSM
37         )"
38 DEPEND="${RDEPEND}
39         virtual/pkgconfig
40         swig? ( dev-lang/swig )"
41
42 pkg_setup() {
43         use python && python-single-r1_pkg_setup
44 }
45
46 src_prepare() {
47         eapply \
48                 "${FILESDIR}"/${PN}-0.7.5-libpng14.patch \
49                 "${FILESDIR}"/${P}-libpng15.patch \
50                 "${FILESDIR}"/${P}-gcc6.patch
51         eapply_user
52
53         # fix python hardcoded path wrt bug #327171
54         sed -i -e "s:python2.5:${EPYTHON}:" \
55                 -e "s:\$(libdir):usr/$(get_libdir):" \
56                 "${S}"/api/python/Makefile || die
57
58         # Respect user CFLAGS/CXXFLAGS.
59         sed -i \
60                 -e '/C\(XX\)\?FLAGS =/s/-O2//' \
61                 -e "\$aCFLAGS += ${CFLAGS}\nCXXFLAGS += ${CXXFLAGS}" \
62                 Makefile || die
63
64         # Show commands.  Use qualified CC/CXX.
65         sed -i \
66                 -e '/^Q =/d' \
67                 -e '/^\t@echo /d' \
68                 -e "\$aCC:=$(tc-getCC)\nCXX:=$(tc-getCXX)" \
69                 build/bottom.make || die
70
71         # The copied string fits exactly.  Use memcpy to reflect that a null
72         # terminator is not needed.
73         sed -i \
74                 -e 's/strcpy(\([^,]*\)\(,["a-zA-Z -]*\))/memcpy(\1\2, sizeof(\1))/' \
75                 codecs/tga.cc || die
76 }
77
78 src_configure() {
79         # evas -> enlightenment overlay
80         # bardecode -> protected by custom license
81         # libungif -> not supported anymore
82
83         ./configure \
84                 --prefix=/usr \
85                 --libdir=/usr/$(get_libdir) \
86                 $(use_with X x11) \
87                 $(use_with truetype freetype) \
88                 --without-evas \
89                 $(use_with jpeg libjpeg) \
90                 $(use_with tiff libtiff) \
91                 $(use_with png libpng) \
92                 --without-libungif \
93                 --without-jasper \
94                 $(use_with openexr) \
95                 $(use_with expat) \
96                 --without-lcms \
97                 --without-bardecode \
98                 $(use_with lua) \
99                 $(use_with swig) \
100                 $(use_with perl) \
101                 $(use_with python) \
102                 $(use_with php) \
103                 $(use_with ruby) || die
104 }