media-gfx/gimp: 2.10.{10,12} update and fix TEST FAIL: test-appdata.sh
[gentoo.git] / media-gfx / gimp / gimp-2.8.22-r1.ebuild
1 # Copyright 1999-2019 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 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                 >=dev-python/pygtk-2.10.4:2[${PYTHON_USEDEP}]
49         )
50         tiff? ( >=media-libs/tiff-3.5.7:0 )
51         svg? ( >=gnome-base/librsvg-2.36.0:2 )
52         wmf? ( >=media-libs/libwmf-0.2.8 )
53         x11-libs/libXcursor
54         sys-libs/zlib
55         bzip2? ( app-arch/bzip2 )
56         postscript? ( app-text/ghostscript-gpl )
57         udev? ( dev-libs/libgudev:= )"
58 DEPEND="${RDEPEND}
59         sys-apps/findutils
60         virtual/pkgconfig
61         >=dev-util/intltool-0.40.1
62         >=sys-devel/gettext-0.19
63         doc? ( >=dev-util/gtk-doc-1 )
64         >=sys-devel/libtool-2.2
65         >=sys-devel/automake-1.11
66         dev-util/gtk-doc-am"  # due to our call to eautoreconf below (bug #386453)
67
68 DOCS="AUTHORS ChangeLog* HACKING NEWS README*"
69
70 S="${WORKDIR}"/${P}
71
72 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
73
74 pkg_setup() {
75         G2CONF="--enable-default-binary \
76                 --disable-silent-rules \
77                 $(use_with !aqua x) \
78                 $(use_with aalib aa) \
79                 $(use_with alsa) \
80                 $(use_enable altivec) \
81                 $(use_with bzip2) \
82                 $(use_with curl libcurl) \
83                 $(use_with dbus) \
84                 $(use_with gnome gvfs) \
85                 --without-webkit \
86                 $(use_with jpeg libjpeg) \
87                 --without-libjasper \
88                 $(use_with exif libexif) \
89                 $(use_with lcms lcms lcms2) \
90                 $(use_with postscript gs) \
91                 $(use_enable cpu_flags_x86_mmx mmx) \
92                 $(use_with mng libmng) \
93                 $(use_with pdf poppler) \
94                 $(use_with png libpng) \
95                 $(use_enable python) \
96                 $(use_enable smp mp) \
97                 $(use_enable cpu_flags_x86_sse sse) \
98                 $(use_with svg librsvg) \
99                 $(use_with tiff libtiff) \
100                 $(use_with udev gudev) \
101                 $(use_with wmf) \
102                 --with-xmc \
103                 $(use_with xpm libxpm) \
104                 --without-xvfb-run"
105
106         if use python; then
107                 python-single-r1_pkg_setup
108         fi
109 }
110
111 src_prepare() {
112         epatch "${FILESDIR}"/${P}-cve-2017-17784.patch  # bug 641954
113         epatch "${FILESDIR}"/${P}-cve-2017-17785.patch  # bug 641954
114         epatch "${FILESDIR}"/${P}-cve-2017-17786-1.patch  # bug 641954
115         epatch "${FILESDIR}"/${P}-cve-2017-17786-2.patch  # bug 641954
116         epatch "${FILESDIR}"/${P}-cve-2017-17787.patch  # bug 641954
117         epatch "${FILESDIR}"/${P}-cve-2017-17788.patch  # bug 641954
118         epatch "${FILESDIR}"/${P}-cve-2017-17789.patch  # bug 641954
119
120         epatch "${FILESDIR}"/${PN}-2.8.14-blend-center.patch  # bug 558878
121         epatch "${FILESDIR}"/${PN}-2.7.4-no-deprecation.patch  # bug 395695, comment 9 and 16
122         epatch "${FILESDIR}"/${PN}-2.8.10-clang.patch # bug 449370 compile with clang
123
124         sed -i -e 's/== "xquartz"/= "xquartz"/' configure.ac || die #494864
125         eautoreconf  # If you remove this: remove dev-util/gtk-doc-am from DEPEND, too
126
127         gnome2_src_prepare
128 }
129
130 _clean_up_locales() {
131         [[ -z ${LINGUAS+set} ]] && return
132         einfo "Cleaning up locales..."
133         for lang in ${LANGS}; do
134                 has ${lang} ${LINGUAS} && {
135                         einfo "- keeping ${lang}"
136                         continue
137                 }
138                 rm -Rf "${ED}"/usr/share/locale/"${lang}" || die
139         done
140 }
141
142 src_test() {
143         Xemake check
144 }
145
146 src_install() {
147         gnome2_src_install
148
149         if use python; then
150                 python_optimize
151         fi
152
153         # Workaround for bug #321111 to give GIMP the least
154         # precedence on PDF documents by default
155         mv "${ED}"/usr/share/applications/{,zzz-}gimp.desktop || die
156
157         prune_libtool_files --all
158
159         # Prevent dead symlink gimp-console.1 from downstream man page compression (bug #433527)
160         local gimp_app_version=$(get_version_component_range 1-2)
161         mv "${ED}"/usr/share/man/man1/gimp-console{-${gimp_app_version},}.1 || die
162
163         _clean_up_locales
164 }
165
166 pkg_postinst() {
167         gnome2_pkg_postinst
168 }
169
170 pkg_postrm() {
171         gnome2_pkg_postrm
172 }