app-text/mupdf: fix compilation with libressl
[gentoo.git] / media-libs / gegl / gegl-0.4.8-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 )
6
7 # vala and introspection support is broken, bug #468208
8 VALA_USE_DEPEND=vapigen
9
10 inherit autotools gnome2-utils python-any-r1 vala
11
12 if [[ ${PV} == *9999* ]]; then
13         inherit git-r3
14         EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/gegl.git"
15         SRC_URI=""
16 else
17         SRC_URI="http://download.gimp.org/pub/${PN}/${PV:0:3}/${P}.tar.bz2"
18         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
19 fi
20
21 DESCRIPTION="A graph based image processing framework"
22 HOMEPAGE="http://www.gegl.org/"
23
24 LICENSE="|| ( GPL-3+ LGPL-3 )"
25 SLOT="0.4"
26
27 IUSE="cairo cpu_flags_x86_mmx cpu_flags_x86_sse debug ffmpeg +introspection jpeg2k lcms lensfun libav openexr raw sdl svg test tiff umfpack vala v4l webp"
28 REQUIRED_USE="
29         svg? ( cairo )
30         vala? ( introspection )
31 "
32
33 # NOTE: Even current libav 11.4 does not have AV_CODEC_CAP_VARIABLE_FRAME_SIZE
34 #       so there is no chance to support libav right now (Gentoo bug #567638)
35 #       If it returns, please check prior GEGL ebuilds for how libav was integrated.  Thanks!
36 RDEPEND="
37         >=dev-libs/glib-2.44:2
38         dev-libs/json-glib
39         >=media-libs/babl-0.1.56
40         >=media-libs/libpng-1.6.0:0=
41         sys-libs/zlib
42         virtual/jpeg:0=
43         >=x11-libs/gdk-pixbuf-2.32:2
44         x11-libs/pango
45         cairo? ( >=x11-libs/cairo-1.12.2 )
46         ffmpeg? (
47                 libav? ( media-video/libav:0= )
48                 !libav? ( media-video/ffmpeg:0= )
49         )
50         introspection? ( >=dev-libs/gobject-introspection-1.32:= )
51         jpeg2k? ( >=media-libs/jasper-1.900.1:= )
52         lcms? ( >=media-libs/lcms-2.8:2 )
53         lensfun? ( >=media-libs/lensfun-0.2.5 )
54         openexr? ( >=media-libs/openexr-2.2.0:= )
55         raw? ( >=media-libs/libraw-0.15.4:0= )
56         sdl? ( >=media-libs/libsdl-1.2.0 )
57         svg? ( >=gnome-base/librsvg-2.40.6:2 )
58         tiff? ( >=media-libs/tiff-4:0 )
59         umfpack? ( sci-libs/umfpack )
60         v4l? ( >=media-libs/libv4l-1.0.1 )
61         webp? ( >=media-libs/libwebp-0.5.0:= )
62 "
63 DEPEND="${RDEPEND}
64         dev-lang/perl
65         >=dev-util/gtk-doc-am-1
66         >=sys-devel/gettext-0.19.8
67         virtual/pkgconfig
68         >=sys-devel/libtool-2.2
69         test? ( ffmpeg? ( media-libs/gexiv2 )
70                 introspection? (
71                         $(python_gen_any_dep '>=dev-python/pygobject-3.2[${PYTHON_USEDEP}]')
72                 )
73         )
74         vala? ( $(vala_depend) )
75 "
76
77 PATCHES=(
78         "${FILESDIR}/${PN}-0.3.12-failing-tests.patch"
79         "${FILESDIR}/${P}-remove-imath-version.patch"
80 )
81
82 pkg_setup() {
83         use test && use introspection && python-any-r1_pkg_setup
84 }
85
86 src_prepare() {
87         default
88
89         # FIXME: the following should be proper patch sent to upstream
90         # fix OSX loadable module filename extension
91         sed -i -e 's/\.dylib/.bundle/' configure.ac || die
92         # don't require Apple's OpenCL on versions of OSX that don't have it
93         if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -le 9 ]] ; then
94                 sed -i -e 's/#ifdef __APPLE__/#if 0/' gegl/opencl/* || die
95         fi
96
97         # commit 7c78497b : tests that use gegl.png are broken on non-amd64
98         sed -e '/clones.xml/d' \
99                 -e '/composite-transform.xml/d' \
100                 -i tests/compositions/Makefile.am || die
101
102         eautoreconf
103
104         gnome2_environment_reset
105
106         use vala && vala_src_prepare
107 }
108
109 src_configure() {
110         local myeconfargs=(
111                 # disable documentation as the generating is bit automagic
112                 #    if anyone wants to work on it just create bug with patch
113                 --disable-docs
114                 # never enable altering of CFLAGS via profile option
115                 --disable-profile
116                 --disable-silent-rules
117                 #  - Parameter --disable-workshop disables any use of Lua, effectivly
118                 --disable-workshop
119                 --program-suffix=-${SLOT}
120                 --with-gdk-pixbuf
121                 --with-pango
122                 #  - Parameter --with-exiv2 compiles a noinst-app only, no use
123                 #    but needed during testing
124                 --without-exiv2
125                 #  - There are two checks for dot, one controllable by --with(out)-graphviz
126                 #    which toggles HAVE_GRAPHVIZ that is not used anywhere.  Yes.
127                 --without-graphviz
128                 # libspiro: not in portage main tree
129                 --without-libspiro
130                 --without-lua
131                 --without-mrg
132                 $(use_enable cpu_flags_x86_mmx mmx)
133                 $(use_enable cpu_flags_x86_sse sse)
134                 $(use_enable debug)
135                 $(use_enable introspection)
136                 $(use_with cairo)
137                 $(use_with cairo pangocairo)
138                 $(use_with ffmpeg libavformat)
139                 $(use_with jpeg2k jasper)
140                 $(use_with lcms)
141                 $(use_with lensfun)
142                 $(use_with openexr)
143                 $(use_with raw libraw)
144                 $(use_with sdl)
145                 $(use_with svg librsvg)
146                 $(use_with tiff libtiff)
147                 $(use_with umfpack)
148                 #  - v4l support does not work with our media-libs/libv4l-0.8.9,
149                 #    upstream bug at https://bugzilla.gnome.org/show_bug.cgi?id=654675
150                 $(use_with v4l libv4l)
151                 $(use_with v4l libv4l2)
152                 $(use_with vala)
153                 $(use_with webp)
154         )
155
156         if use test; then
157                 myeconfargs+=( $(use_with ffmpeg gexiv2) )
158         else
159                 myeconfargs+=( --without-gexiv2 )
160         fi
161
162         econf "${myeconfargs[@]}"
163 }
164
165 src_compile() {
166         default
167
168         [[ ${PV} == *9999* ]] && emake ./ChangeLog  # "./" prevents "Circular ChangeLog <- ChangeLog dependency dropped."
169 }
170
171 src_install() {
172         default
173         find "${ED}" -name '*.la' -delete || die
174 }