media-gfx/gimp: 9999.ebuild update
[gentoo.git] / media-gfx / gimp / gimp-2.9.8-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit versionator virtualx autotools eutils gnome2 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 ~ppc ~ppc64 ~x86"
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 debug doc openexr gnome postscript cpu_flags_x86_mmx mng pdf python smp cpu_flags_x86_sse udev vector-icons webp wmf xpm"
18
19 RDEPEND=">=dev-libs/glib-2.40.0:2
20         >=dev-libs/atk-2.2.0
21         >=x11-libs/gtk+-2.24.10:2
22         dev-util/gtk-update-icon-cache
23         >=x11-libs/gdk-pixbuf-2.31:2
24         >=x11-libs/cairo-1.12.2
25         >=x11-libs/pango-1.29.4
26         xpm? ( x11-libs/libXpm )
27         >=media-libs/freetype-2.1.7
28         >=media-libs/harfbuzz-0.9.19
29         >=media-libs/gexiv2-0.10.6
30         >=media-libs/libmypaint-1.3.0[gegl]
31         >=media-libs/fontconfig-2.2.0
32         sys-libs/zlib
33         dev-libs/libxml2
34         dev-libs/libxslt
35         x11-themes/hicolor-icon-theme
36         >=media-libs/babl-0.1.38
37         >=media-libs/gegl-0.3.24:0.3[cairo]
38         aalib? ( media-libs/aalib )
39         alsa? ( media-libs/alsa-lib )
40         aqua? ( x11-libs/gtk-mac-integration )
41         gnome? ( gnome-base/gvfs )
42         virtual/jpeg:0
43         >=media-libs/lcms-2.8:2
44         mng? ( media-libs/libmng )
45         openexr? ( >=media-libs/openexr-1.6.1 )
46         pdf? ( >=app-text/poppler-0.44[cairo] >=app-text/poppler-data-0.4.7 )
47         >=media-libs/libpng-1.6.25:0
48         python? (
49                 ${PYTHON_DEPS}
50                 >=dev-python/pygtk-2.10.4:2[${PYTHON_USEDEP}]
51                 >=dev-python/pycairo-1.0.2[${PYTHON_USEDEP}]
52         )
53         >=media-libs/tiff-3.5.7:0
54         >=gnome-base/librsvg-2.40.6:2
55         webp? ( >=media-libs/libwebp-0.6.0 )
56         wmf? ( >=media-libs/libwmf-0.2.8 )
57         net-libs/glib-networking[ssl]
58         x11-libs/libXcursor
59         sys-libs/zlib
60         app-arch/bzip2
61         >=app-arch/xz-utils-5.0.0
62         postscript? ( app-text/ghostscript-gpl )
63         udev? ( dev-libs/libgudev:= )"
64 DEPEND="${RDEPEND}
65         >=dev-lang/perl-5.10.0
66         dev-libs/appstream-glib
67         sys-apps/findutils
68         virtual/pkgconfig
69         >=dev-util/intltool-0.40.1
70         >=sys-devel/gettext-0.19
71         doc? ( >=dev-util/gtk-doc-1 )
72         >=sys-devel/libtool-2.2
73         >=sys-devel/automake-1.11
74         dev-util/gtk-doc-am"  # due to our call to eautoreconf below (bug #386453)
75
76 DOCS="AUTHORS ChangeLog* HACKING NEWS README*"
77
78 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
79
80 pkg_setup() {
81         if use python; then
82                 python-single-r1_pkg_setup
83         fi
84 }
85
86 PATCHES=(
87         "${FILESDIR}"/${P}-cve-2017-17784.patch  # bug 641954
88         "${FILESDIR}"/${PN}-2.8.22-cve-2017-17785.patch  # bug 641954
89         "${FILESDIR}"/${PN}-2.8.22-cve-2017-17786-1.patch  # bug 641954
90         "${FILESDIR}"/${PN}-2.8.22-cve-2017-17786-2.patch  # bug 641954
91         "${FILESDIR}"/${PN}-2.8.22-cve-2017-17787.patch  # bug 641954
92         # NOTE:                           CVE-2017-17788 already fixed upstream
93         "${FILESDIR}"/${PN}-2.8.22-cve-2017-17789.patch  # bug 641954
94 )
95
96 src_prepare() {
97         gnome2_src_prepare
98
99         sed -i -e 's/== "xquartz"/= "xquartz"/' configure.ac || die #494864
100         sed 's:-DGIMP_DISABLE_DEPRECATED:-DGIMP_protect_DISABLE_DEPRECATED:g' -i configure.ac || die #615144
101         eautoreconf  # If you remove this: remove dev-util/gtk-doc-am from DEPEND, too
102
103         sed 's:-DGIMP_protect_DISABLE_DEPRECATED:-DGIMP_DISABLE_DEPRECATED:g' -i configure || die #615144
104         fgrep -q GIMP_DISABLE_DEPRECATED configure || die #615144, self-test
105 }
106
107 src_configure() {
108         local myconf=(
109                 GEGL=${EPREFIX}/usr/bin/gegl-0.3
110                 GDBUS_CODEGEN=${EPREFIX}/bin/false
111
112                 --enable-default-binary
113                 --disable-silent-rules
114
115                 $(use_with !aqua x)
116                 $(use_with aalib aa)
117                 $(use_with alsa)
118                 $(use_enable altivec)
119                 --with-appdata-test
120                 --without-webkit
121                 --without-libjasper
122                 $(use_with postscript gs)
123                 $(use_enable cpu_flags_x86_mmx mmx)
124                 $(use_with mng libmng)
125                 $(use_with openexr)
126                 $(use_with webp)
127                 $(use_with pdf poppler)
128                 $(use_enable python)
129                 $(use_enable smp mp)
130                 $(use_enable cpu_flags_x86_sse sse)
131                 $(use_with udev gudev)
132                 $(use_with wmf)
133                 --with-xmc
134                 $(use_with xpm libxpm)
135                 $(use_enable vector-icons)
136                 --without-xvfb-run
137         )
138
139         gnome2_src_configure "${myconf[@]}"
140 }
141
142 src_compile() {
143         # Bugs #569738 and #591214
144         local nv
145         for nv in /dev/nvidia-uvm /dev/nvidiactl /dev/nvidia{0..9} ; do
146                 # We do not check for existence as they may show up later
147                 # https://bugs.gentoo.org/show_bug.cgi?id=569738#c21
148                 addwrite "${nv}"
149         done
150         addwrite /dev/dri/  # bug #574038
151         addwrite /dev/ati/  # bug 589198
152         addwrite /proc/mtrr  # bug 589198
153
154         export XDG_DATA_DIRS=${EPREFIX}/usr/share  # bug 587004
155         gnome2_src_compile
156 }
157
158 _clean_up_locales() {
159         [[ -z ${LINGUAS+set} ]] && return
160         einfo "Cleaning up locales..."
161         for lang in ${LANGS}; do
162                 has ${lang} ${LINGUAS} && {
163                         einfo "- keeping ${lang}"
164                         continue
165                 }
166                 rm -Rf "${ED}"/usr/share/locale/"${lang}" || die
167         done
168 }
169
170 src_test() {
171         virtx emake check
172 }
173
174 src_install() {
175         gnome2_src_install
176
177         if use python; then
178                 python_optimize
179         fi
180
181         # Workaround for bug #321111 to give GIMP the least
182         # precedence on PDF documents by default
183         mv "${ED}"/usr/share/applications/{,zzz-}gimp.desktop || die
184
185         prune_libtool_files --all
186
187         # Prevent dead symlink gimp-console.1 from downstream man page compression (bug #433527)
188         local gimp_app_version=$(get_version_component_range 1-2)
189         mv "${ED}"/usr/share/man/man1/gimp-console{-${gimp_app_version},}.1 || die
190
191         _clean_up_locales
192 }
193
194 pkg_postinst() {
195         gnome2_pkg_postinst
196 }
197
198 pkg_postrm() {
199         gnome2_pkg_postrm
200 }