df5feb8b86900f2513cfa08760a14b0a9bfe08fd
[gentoo.git] / media-libs / gegl / gegl-0.4.18.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python{2_7,3_{6,7}} )
6
7 # vala and introspection support is broken, bug #468208
8 VALA_USE_DEPEND=vapigen
9
10 inherit meson 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.xz"
18         KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc x86 ~amd64-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 debug ffmpeg introspection lcms lensfun libav openexr pdf raw sdl svg test tiff umfpack vala v4l webp"
28 REQUIRED_USE="
29         svg? ( cairo )
30         test? ( introspection )
31         vala? ( introspection )
32 "
33
34 RESTRICT="!test? ( test )"
35
36 # NOTE: Even current libav 11.4 does not have AV_CODEC_CAP_VARIABLE_FRAME_SIZE
37 #       so there is no chance to support libav right now (Gentoo bug #567638)
38 #       If it returns, please check prior GEGL ebuilds for how libav was integrated.  Thanks!
39 RDEPEND="
40         >=dev-libs/glib-2.44:2
41         >=dev-libs/json-glib-1.2.6
42         >=media-libs/babl-0.1.72[introspection?]
43         media-libs/libnsgif
44         >=media-libs/libpng-1.6.0:0=
45         >=sys-libs/zlib-1.2.0
46         virtual/jpeg:0=
47         >=x11-libs/gdk-pixbuf-2.32:2
48         >=x11-libs/pango-1.38.0
49         cairo? ( >=x11-libs/cairo-1.12.2 )
50         ffmpeg? (
51                 libav? ( media-video/libav:0= )
52                 !libav? ( media-video/ffmpeg:0= )
53         )
54         introspection? ( >=dev-libs/gobject-introspection-1.32:= )
55         lcms? ( >=media-libs/lcms-2.8:2 )
56         lensfun? ( >=media-libs/lensfun-0.2.5 )
57         openexr? ( >=media-libs/openexr-1.6.1:= )
58         pdf? ( >=app-text/poppler-0.71.0[cairo] )
59         raw? ( >=media-libs/libraw-0.15.4:0= )
60         sdl? ( >=media-libs/libsdl-1.2.0 )
61         svg? ( >=gnome-base/librsvg-2.40.6:2 )
62         tiff? ( >=media-libs/tiff-4:0 )
63         umfpack? ( sci-libs/umfpack )
64         v4l? ( >=media-libs/libv4l-1.0.1 )
65         webp? ( >=media-libs/libwebp-0.5.0:= )
66 "
67
68 DEPEND="
69         ${RDEPEND}
70 "
71
72 BDEPEND="
73         dev-lang/perl
74         >=dev-util/gtk-doc-am-1
75         >=sys-devel/gettext-0.19.8
76         >=sys-devel/libtool-2.2
77         virtual/pkgconfig
78         test? ( $(python_gen_any_dep '>=dev-python/pygobject-3.2:3[${PYTHON_USEDEP}]') )
79         vala? ( $(vala_depend) )
80 "
81
82 DOCS=( AUTHORS docs/ChangeLog docs/NEWS.txt )
83
84 PATCHES=(
85         "${FILESDIR}"/${P}-drop-failing-tests.patch
86         "${FILESDIR}"/${P}-program-suffix.patch
87         "${FILESDIR}"/${P}-meson_cpu_detection.patch
88         "${FILESDIR}"/${P}-cltostring_force_utf8.patch
89 )
90
91 python_check_deps() {
92         has_version -b ">=dev-python/pygobject-3.2:3[${PYTHON_USEDEP}]"
93 }
94
95 pkg_setup() {
96         use test && python-any-r1_pkg_setup
97 }
98
99 src_prepare() {
100         default
101
102         # don't require Apple's OpenCL on versions of OSX that don't have it
103         if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -le 9 ]] ; then
104                 sed -i -e 's/#ifdef __APPLE__/#if 0/' gegl/opencl/* || die
105         fi
106
107         # commit 7c78497b : tests that use gegl.png are broken on non-amd64
108         sed -e '/clones.xml/d' \
109                 -e '/composite-transform.xml/d' \
110                 -i tests/compositions/meson.build || die
111
112         # fix skipping mipmap tests due to executable not found
113         for item in "invert-crop.sh" "invert.sh" "rotate-crop.sh" "rotate.sh" "unsharp-crop.sh" "unsharp.sh"; do
114                 sed -i "s:/bin/gegl:/bin/gegl-0.4:g" "${S}/tests/mipmap/${item}" || die
115                 sed -i "s:/tools/gegl-imgcmp:/tools/gegl-imgcmp-0.4:g" "${S}/tests/mipmap/${item}" || die
116         done
117
118         gnome2_environment_reset
119
120         use vala && vala_src_prepare
121 }
122
123 src_configure() {
124         local emesonargs=(
125                 #  - Disable documentation as the generating is bit automagic
126                 #    if anyone wants to work on it just create bug with patch
127                 -Ddocs=false
128                 -Dexiv2=disabled
129                 -Dgdk-pixbuf=enabled
130                 -Dgexiv2=disabled
131                 #  - There are two checks for dot, one controllable by --with(out)-graphviz
132                 #    which toggles HAVE_GRAPHVIZ that is not used anywhere.  Yes.
133                 -Dgraphviz=disabled
134                 -Djasper=disabled
135                 -Dlibjpeg=enabled
136                 -Dlibpng=enabled
137                 #  - libspiro: not in portage main tree
138                 -Dlibspiro=disabled
139                 -Dlua=disabled
140                 -Dmrg=disabled
141                 -Dpango=enabled
142                 -Dsdl2=disabled
143                 #  - Parameter -Dworkshop=false disables any use of Lua, effectivly
144                 -Dworkshop=false
145                 $(meson_feature cairo)
146                 $(meson_feature cairo pangocairo)
147                 $(meson_feature ffmpeg libav)
148                 $(meson_feature lcms)
149                 $(meson_feature lensfun)
150                 $(meson_feature openexr)
151                 $(meson_feature raw libraw)
152                 $(meson_feature sdl sdl1)
153                 $(meson_feature svg librsvg)
154                 $(meson_feature test pygobject)
155                 $(meson_feature tiff libtiff)
156                 $(meson_feature umfpack)
157                 #  - v4l support does not work with our media-libs/libv4l-0.8.9,
158                 #    upstream bug at https://bugzilla.gnome.org/show_bug.cgi?id=654675
159                 $(meson_feature v4l libv4l)
160                 $(meson_feature v4l libv4l2)
161                 $(meson_feature vala vapigen)
162                 $(meson_feature webp)
163                 $(meson_use introspection)
164         )
165         meson_src_configure
166 }