*/*: [QA] Remove redundant --disable-{dependency-tracking,silent-rules}
[gentoo.git] / media-gfx / gimp / gimp-2.8.22-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit versionator virtualx autotools eutils gnome2 fdo-mime ltprune multilib python-single-r1
8
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"
13 SLOT="2"
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"
15
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"
18
19 RDEPEND=">=dev-libs/glib-2.30.2:2
20         >=dev-libs/atk-2.2.0
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
28         sys-libs/zlib
29         dev-libs/libxml2
30         dev-libs/libxslt
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 )
46         python? (
47                 ${PYTHON_DEPS}
48                 $(python_gen_cond_dep '
49                         >=dev-python/pygtk-2.10.4:2[${PYTHON_MULTI_USEDEP}]
50                 ')
51         )
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 )
55         x11-libs/libXcursor
56         sys-libs/zlib
57         bzip2? ( app-arch/bzip2 )
58         postscript? ( app-text/ghostscript-gpl )
59         udev? ( dev-libs/libgudev:= )"
60 DEPEND="${RDEPEND}
61         sys-apps/findutils
62         virtual/pkgconfig
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)
69
70 DOCS="AUTHORS ChangeLog* HACKING NEWS README*"
71
72 S="${WORKDIR}"/${P}
73
74 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
75
76 pkg_setup() {
77         G2CONF="--enable-default-binary \
78                 $(use_with !aqua x) \
79                 $(use_with aalib aa) \
80                 $(use_with alsa) \
81                 $(use_enable altivec) \
82                 $(use_with bzip2) \
83                 $(use_with curl libcurl) \
84                 $(use_with dbus) \
85                 $(use_with gnome gvfs) \
86                 --without-webkit \
87                 $(use_with jpeg libjpeg) \
88                 --without-libjasper \
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) \
102                 $(use_with wmf) \
103                 --with-xmc \
104                 $(use_with xpm libxpm) \
105                 --without-xvfb-run"
106
107         if use python; then
108                 python-single-r1_pkg_setup
109         fi
110 }
111
112 src_prepare() {
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
120
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
124
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
127
128         gnome2_src_prepare
129 }
130
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}"
137                         continue
138                 }
139                 rm -Rf "${ED}"/usr/share/locale/"${lang}" || die
140         done
141 }
142
143 src_test() {
144         Xemake check
145 }
146
147 src_install() {
148         gnome2_src_install
149
150         if use python; then
151                 python_optimize
152         fi
153
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
157
158         prune_libtool_files --all
159
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
163
164         _clean_up_locales
165 }
166
167 pkg_postinst() {
168         gnome2_pkg_postinst
169 }
170
171 pkg_postrm() {
172         gnome2_pkg_postrm
173 }