1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
7 inherit versionator virtualx autotools eutils gnome2 fdo-mime ltprune multilib python-single-r1
9 DESCRIPTION="GNU Image Manipulation Program"
10 HOMEPAGE="https://www.gimp.org/"
11 SRC_URI="mirror://gimp/v$(get_version_component_range 1-2)/${P}.tar.bz2"
12 LICENSE="GPL-3 LGPL-3"
14 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
16 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"
17 IUSE="alsa aalib altivec aqua bzip2 curl dbus debug doc exif gnome postscript jpeg lcms cpu_flags_x86_mmx mng pdf png python smp cpu_flags_x86_sse svg tiff udev wmf xpm"
19 RDEPEND=">=dev-libs/glib-2.30.2:2
21 >=x11-libs/gtk+-2.24.10:2
22 >=x11-libs/gdk-pixbuf-2.24.1:2
23 >=x11-libs/cairo-1.10.2
24 >=x11-libs/pango-1.29.4
25 xpm? ( x11-libs/libXpm )
26 >=media-libs/freetype-2.1.7
27 >=media-libs/fontconfig-2.2.0
31 x11-themes/hicolor-icon-theme
32 >=media-libs/babl-0.1.10
33 >=media-libs/gegl-0.2.0:0
34 aalib? ( media-libs/aalib )
35 alsa? ( media-libs/alsa-lib )
36 aqua? ( x11-libs/gtk-mac-integration )
37 curl? ( net-misc/curl )
38 dbus? ( dev-libs/dbus-glib )
39 gnome? ( gnome-base/gvfs )
40 jpeg? ( virtual/jpeg:0 )
41 exif? ( >=media-libs/libexif-0.6.15 )
42 lcms? ( >=media-libs/lcms-2.2:2 )
43 mng? ( media-libs/libmng )
44 pdf? ( >=app-text/poppler-0.12.4[cairo] )
45 png? ( >=media-libs/libpng-1.2.37:0 )
48 $(python_gen_cond_dep '
49 >=dev-python/pygtk-2.10.4:2[${PYTHON_MULTI_USEDEP}]
52 tiff? ( >=media-libs/tiff-3.5.7:0 )
53 svg? ( >=gnome-base/librsvg-2.36.0:2 )
54 wmf? ( >=media-libs/libwmf-0.2.8 )
57 bzip2? ( app-arch/bzip2 )
58 postscript? ( app-text/ghostscript-gpl )
59 udev? ( dev-libs/libgudev:= )"
63 >=dev-util/intltool-0.40.1
64 >=sys-devel/gettext-0.19
65 doc? ( >=dev-util/gtk-doc-1 )
66 >=sys-devel/libtool-2.2
67 >=sys-devel/automake-1.11
68 dev-util/gtk-doc-am" # due to our call to eautoreconf below (bug #386453)
70 DOCS="AUTHORS ChangeLog* HACKING NEWS README*"
74 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
77 G2CONF="--enable-default-binary \
79 $(use_with aalib aa) \
81 $(use_enable altivec) \
83 $(use_with curl libcurl) \
85 $(use_with gnome gvfs) \
87 $(use_with jpeg libjpeg) \
89 $(use_with exif libexif) \
90 $(use_with lcms lcms lcms2) \
91 $(use_with postscript gs) \
92 $(use_enable cpu_flags_x86_mmx mmx) \
93 $(use_with mng libmng) \
94 $(use_with pdf poppler) \
95 $(use_with png libpng) \
96 $(use_enable python) \
97 $(use_enable smp mp) \
98 $(use_enable cpu_flags_x86_sse sse) \
99 $(use_with svg librsvg) \
100 $(use_with tiff libtiff) \
101 $(use_with udev gudev) \
104 $(use_with xpm libxpm) \
108 python-single-r1_pkg_setup
113 epatch "${FILESDIR}"/${P}-cve-2017-17784.patch # bug 641954
114 epatch "${FILESDIR}"/${P}-cve-2017-17785.patch # bug 641954
115 epatch "${FILESDIR}"/${P}-cve-2017-17786-1.patch # bug 641954
116 epatch "${FILESDIR}"/${P}-cve-2017-17786-2.patch # bug 641954
117 epatch "${FILESDIR}"/${P}-cve-2017-17787.patch # bug 641954
118 epatch "${FILESDIR}"/${P}-cve-2017-17788.patch # bug 641954
119 epatch "${FILESDIR}"/${P}-cve-2017-17789.patch # bug 641954
121 epatch "${FILESDIR}"/${PN}-2.8.14-blend-center.patch # bug 558878
122 epatch "${FILESDIR}"/${PN}-2.7.4-no-deprecation.patch # bug 395695, comment 9 and 16
123 epatch "${FILESDIR}"/${PN}-2.8.10-clang.patch # bug 449370 compile with clang
125 sed -i -e 's/== "xquartz"/= "xquartz"/' configure.ac || die #494864
126 eautoreconf # If you remove this: remove dev-util/gtk-doc-am from DEPEND, too
131 _clean_up_locales() {
132 [[ -z ${LINGUAS+set} ]] && return
133 einfo "Cleaning up locales..."
134 for lang in ${LANGS}; do
135 has ${lang} ${LINGUAS} && {
136 einfo "- keeping ${lang}"
139 rm -Rf "${ED}"/usr/share/locale/"${lang}" || die
154 # Workaround for bug #321111 to give GIMP the least
155 # precedence on PDF documents by default
156 mv "${ED}"/usr/share/applications/{,zzz-}gimp.desktop || die
158 prune_libtool_files --all
160 # Prevent dead symlink gimp-console.1 from downstream man page compression (bug #433527)
161 local gimp_app_version=$(get_version_component_range 1-2)
162 mv "${ED}"/usr/share/man/man1/gimp-console{-${gimp_app_version},}.1 || die