1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
11 inherit versionator virtualx autotools gnome2 multilib python-single-r1 ltprune
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"
18 KEYWORDS="~amd64 ~x86"
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"
23 RDEPEND=">=dev-libs/glib-2.56.0:2
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
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 )
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=
56 >=dev-python/pygtk-2.10.4:2[${PYTHON_USEDEP}]
57 >=dev-python/pycairo-1.0.2[${PYTHON_USEDEP}]
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]
67 >=app-arch/xz-utils-5.0.0
68 postscript? ( app-text/ghostscript-gpl )
69 udev? ( virtual/libgudev:= )"
71 >=dev-lang/perl-5.10.0
72 dev-libs/appstream-glib
73 dev-util/gtk-update-icon-cache
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
83 DOCS="AUTHORS ChangeLog* HACKING NEWS README*"
85 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
87 S="${WORKDIR}/${MY_P}"
91 python-single-r1_pkg_setup
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
99 gnome2_src_prepare # calls eautoreconf
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
107 GEGL="${EPREFIX}"/usr/bin/gegl-0.4
108 GDBUS_CODEGEN="${EPREFIX}"/bin/false
110 --enable-default-binary
111 --disable-silent-rules
116 $(use_enable altivec)
118 --with-bug-report-url=https://bugs.gentoo.org/
120 $(use_with jpeg2k jpeg2000)
121 $(use_with postscript gs)
122 $(use_enable cpu_flags_x86_mmx mmx)
123 $(use_with mng libmng)
129 $(use_enable cpu_flags_x86_sse sse)
130 $(use_with udev gudev)
133 $(use_with xpm libxpm)
134 $(use_enable vector-icons)
138 gnome2_src_configure "${myconf[@]}"
142 # Bugs #569738 and #591214
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
149 addwrite /dev/dri/ # bug #574038
150 addwrite /dev/ati/ # bug 589198
151 addwrite /proc/mtrr # bug 589198
153 export XDG_DATA_DIRS="${EPREFIX}"/usr/share # bug 587004
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}"
165 rm -Rf "${ED%/}"/usr/share/locale/"${lang}"
169 # for https://bugs.gentoo.org/664938
171 einfo 'Renaming plug-ins to not collide with pre-2.10.6 file layout (bug #664938)...'
172 local prepend=gimp-org-
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
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
202 prune_libtool_files --all
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
208 _rename_plugins || die