media-gfx/gimp: Add missing := on media-libs/openexr
[gentoo.git] / media-gfx / gimp / gimp-2.10.6-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 GNOME2_EAUTORECONF=yes
7
8 MY_PV="${PV/_rc/-RC}"
9 MY_P="${PN}-${MY_PV}"
10
11 inherit versionator virtualx autotools gnome2 multilib python-single-r1 ltprune
12
13 DESCRIPTION="GNU Image Manipulation Program"
14 HOMEPAGE="https://www.gimp.org/"
15 SRC_URI="mirror://gimp/v$(get_version_component_range 1-2)/${MY_P}.tar.bz2"
16 LICENSE="GPL-3 LGPL-3"
17 SLOT="2"
18 KEYWORDS="~amd64 ~x86"
19
20 LANGS="am ar ast az be bg br ca ca@valencia cs csb da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu id is it ja ka kk km kn ko lt lv mk ml ms my nb nds ne nl nn oc pa pl pt pt_BR ro ru rw si sk sl sr sr@latin sv ta te th tr tt uk vi xh yi zh_CN zh_HK zh_TW"
21 IUSE="alsa aalib altivec aqua debug doc openexr gnome postscript jpeg2k cpu_flags_x86_mmx mng python smp cpu_flags_x86_sse udev vector-icons webp wmf xpm"
22
23 RDEPEND=">=dev-libs/glib-2.56.0:2
24         >=dev-libs/atk-2.2.0
25         >=x11-libs/gtk+-2.24.10:2
26         >=x11-libs/gdk-pixbuf-2.31:2
27         >=x11-libs/cairo-1.12.2
28         >=x11-libs/pango-1.29.4
29         xpm? ( x11-libs/libXpm )
30         >=media-libs/freetype-2.1.7
31         >=media-libs/harfbuzz-0.9.19
32         >=media-libs/gexiv2-0.10.6
33         >=media-libs/libmypaint-1.3.0[gegl]
34         >=media-gfx/mypaint-brushes-1.3.0
35         >=media-libs/fontconfig-2.12.4
36         sys-libs/zlib
37         dev-libs/libxml2
38         dev-libs/libxslt
39         x11-themes/hicolor-icon-theme
40         >=media-libs/babl-0.1.56
41         >=media-libs/gegl-0.4.8:0.4[cairo]
42         aalib? ( media-libs/aalib )
43         alsa? ( media-libs/alsa-lib )
44         aqua? ( x11-libs/gtk-mac-integration )
45         gnome? ( gnome-base/gvfs )
46         virtual/jpeg:0
47         jpeg2k? ( >=media-libs/openjpeg-2.1.0:2= )
48         >=media-libs/lcms-2.8:2
49         mng? ( media-libs/libmng )
50         openexr? ( >=media-libs/openexr-1.6.1:= )
51         >=app-text/poppler-0.44[cairo]
52         >=app-text/poppler-data-0.4.7
53         >=media-libs/libpng-1.6.25:0=
54         python? (
55                 ${PYTHON_DEPS}
56                 >=dev-python/pygtk-2.10.4:2[${PYTHON_USEDEP}]
57                 >=dev-python/pycairo-1.0.2[${PYTHON_USEDEP}]
58         )
59         >=media-libs/tiff-3.5.7:0
60         >=gnome-base/librsvg-2.40.6:2
61         webp? ( >=media-libs/libwebp-0.6.0 )
62         wmf? ( >=media-libs/libwmf-0.2.8 )
63         net-libs/glib-networking[ssl]
64         x11-libs/libXcursor
65         sys-libs/zlib
66         app-arch/bzip2
67         >=app-arch/xz-utils-5.0.0
68         postscript? ( app-text/ghostscript-gpl )
69         udev? ( virtual/libgudev:= )"
70 DEPEND="${RDEPEND}
71         >=dev-lang/perl-5.10.0
72         dev-libs/appstream-glib
73         dev-util/gtk-update-icon-cache
74         sys-apps/findutils
75         virtual/pkgconfig
76         >=dev-util/intltool-0.40.1
77         >=sys-devel/gettext-0.19
78         doc? ( >=dev-util/gtk-doc-1 )
79         >=sys-devel/libtool-2.2
80         >=sys-devel/automake-1.11
81         dev-util/gtk-doc-am"
82
83 DOCS="AUTHORS ChangeLog* HACKING NEWS README*"
84
85 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
86
87 S="${WORKDIR}/${MY_P}"
88
89 pkg_setup() {
90         if use python; then
91                 python-single-r1_pkg_setup
92         fi
93 }
94
95 src_prepare() {
96         sed -i -e 's/== "xquartz"/= "xquartz"/' configure.ac || die #494864
97         sed 's:-DGIMP_DISABLE_DEPRECATED:-DGIMP_protect_DISABLE_DEPRECATED:g' -i configure.ac || die #615144
98
99         gnome2_src_prepare  # calls eautoreconf
100
101         sed 's:-DGIMP_protect_DISABLE_DEPRECATED:-DGIMP_DISABLE_DEPRECATED:g' -i configure || die #615144
102         fgrep -q GIMP_DISABLE_DEPRECATED configure || die #615144, self-test
103 }
104
105 src_configure() {
106         local myconf=(
107                 GEGL="${EPREFIX}"/usr/bin/gegl-0.4
108                 GDBUS_CODEGEN="${EPREFIX}"/bin/false
109
110                 --enable-default-binary
111                 --disable-silent-rules
112
113                 $(use_with !aqua x)
114                 $(use_with aalib aa)
115                 $(use_with alsa)
116                 $(use_enable altivec)
117                 --with-appdata-test
118                 --with-bug-report-url=https://bugs.gentoo.org/
119                 --without-webkit
120                 $(use_with jpeg2k jpeg2000)
121                 $(use_with postscript gs)
122                 $(use_enable cpu_flags_x86_mmx mmx)
123                 $(use_with mng libmng)
124                 $(use_with openexr)
125                 $(use_with webp)
126                 --without-libheif
127                 $(use_enable python)
128                 $(use_enable smp mp)
129                 $(use_enable cpu_flags_x86_sse sse)
130                 $(use_with udev gudev)
131                 $(use_with wmf)
132                 --with-xmc
133                 $(use_with xpm libxpm)
134                 $(use_enable vector-icons)
135                 --without-xvfb-run
136         )
137
138         gnome2_src_configure "${myconf[@]}"
139 }
140
141 src_compile() {
142         # Bugs #569738 and #591214
143         local nv
144         for nv in /dev/nvidia-uvm /dev/nvidiactl /dev/nvidia{0..9} ; do
145                 # We do not check for existence as they may show up later
146                 # https://bugs.gentoo.org/show_bug.cgi?id=569738#c21
147                 addwrite "${nv}"
148         done
149         addwrite /dev/dri/  # bug #574038
150         addwrite /dev/ati/  # bug 589198
151         addwrite /proc/mtrr  # bug 589198
152
153         export XDG_DATA_DIRS="${EPREFIX}"/usr/share  # bug 587004
154         gnome2_src_compile
155 }
156
157 _clean_up_locales() {
158         [[ -z ${LINGUAS+set} ]] && return
159         einfo "Cleaning up locales..."
160         for lang in ${LANGS}; do
161                 has ${lang} ${LINGUAS} && {
162                         einfo "- keeping ${lang}"
163                         continue
164                 }
165                 rm -Rf "${ED%/}"/usr/share/locale/"${lang}"
166         done
167 }
168
169 # for https://bugs.gentoo.org/664938
170 _rename_plugins() {
171         einfo 'Renaming plug-ins to not collide with pre-2.10.6 file layout (bug #664938)...'
172         local prepend=gimp-org-
173         (
174                 cd "${ED%/}"/usr/$(get_libdir)/gimp/2.0/plug-ins || exit 1
175                 for plugin_slash in $(ls -d1 */); do
176                     plugin=${plugin_slash%/}
177                     if [[ -f ${plugin}/${plugin} ]]; then
178                         # NOTE: Folder and file name need to match for Gimp to load that plug-in
179                         #       so "file-svg/file-svg" becomes "${prepend}file-svg/${prepend}file-svg"
180                         mv ${plugin}/{,${prepend}}${plugin} || exit 1
181                         mv {,${prepend}}${plugin} || exit 1
182                     fi
183                 done
184         )
185 }
186
187 src_test() {
188         virtx emake check
189 }
190
191 src_install() {
192         gnome2_src_install
193
194         if use python; then
195                 python_optimize
196         fi
197
198         # Workaround for bug #321111 to give GIMP the least
199         # precedence on PDF documents by default
200         mv "${ED%/}"/usr/share/applications/{,zzz-}gimp.desktop || die
201
202         prune_libtool_files --all
203
204         # Prevent dead symlink gimp-console.1 from downstream man page compression (bug #433527)
205         local gimp_app_version=$(get_version_component_range 1-2)
206         mv "${ED%/}"/usr/share/man/man1/gimp-console{-${gimp_app_version},}.1 || die
207
208         _rename_plugins || die
209         _clean_up_locales
210 }
211
212 pkg_postinst() {
213         gnome2_pkg_postinst
214 }
215
216 pkg_postrm() {
217         gnome2_pkg_postrm
218 }