x11-themes/gentoo10-backgrounds: Cleanup per bug #85210
[gentoo.git] / eclass / mozconfig-v6.42.eclass
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4 #
5 # @ECLASS: mozconfig-v6.40.eclass
6 # @MAINTAINER:
7 # mozilla team <mozilla@gentoo.org>
8 # @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
9 # @DESCRIPTION:
10 # This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
11 # to provide a single common place for the common mozilla engine compoments.
12 #
13 # The eclass provides all common dependencies as well as common use flags.
14 #
15 # Some use flags which may be optional in particular mozilla packages can be
16 # supported through setting eclass variables.
17 #
18 # This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
19 # and so ebuilds inheriting this eclass do not need to inherit that.
20
21 inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
22
23 case ${EAPI} in
24         0|1|2|3|4) die "EAPI=${EAPI} not supported"
25 esac
26
27 # @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
28 # @DESCRIPTION:
29 # Set this variable before the inherit line, when an ebuild needs to provide
30 # optional necko-wifi support via IUSE="wifi".  Currently this would include
31 # ebuilds for firefox, and potentially seamonkey.
32 #
33 # Leave the variable UNSET if necko-wifi support should not be available.
34 # Set the variable to "enabled" if the use flag should be enabled by default.
35 # Set the variable to any value if the use flag should exist but not be default-enabled.
36
37 # @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
38 # @DESCRIPTION:
39 # Set this variable before the inherit line, when an ebuild needs to provide
40 # optional necko-wifi support via IUSE="jit".  Currently this would include
41 # ebuilds for firefox, and potentially seamonkey.
42 #
43 # Leave the variable UNSET if optional jit support should not be available.
44 # Set the variable to "enabled" if the use flag should be enabled by default.
45 # Set the variable to any value if the use flag should exist but not be default-enabled.
46
47 # @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
48 # @DESCRIPTION:
49 # Set this variable before the inherit line, when an ebuild can provide
50 # optional gtk3 support via IUSE="gtk3".  Currently this would include
51 # ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
52 #
53 # Leave the variable UNSET if gtk3 support should not be available.
54 # Set the variable to "enabled" if the use flag should be enabled by default.
55 # Set the variable to any value if the use flag should exist but not be default-enabled.
56
57 # use-flags common among all mozilla ebuilds
58 IUSE="${IUSE} dbus debug +gstreamer gstreamer-0 +jemalloc3 neon pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
59
60 # some notes on deps:
61 # gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
62 # media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
63
64 RDEPEND=">=app-text/hunspell-1.2
65         dev-libs/atk
66         dev-libs/expat
67         >=dev-libs/libevent-1.4.7
68         >=x11-libs/cairo-1.10[X]
69         >=x11-libs/gtk+-2.18:2
70         x11-libs/gdk-pixbuf
71         >=x11-libs/pango-1.22.0
72         >=media-libs/libpng-1.6.17:0=[apng]
73         >=media-libs/mesa-10.2:*
74         media-libs/fontconfig
75         >=media-libs/freetype-2.4.10
76         kernel_linux? ( media-libs/alsa-lib )
77         pulseaudio? ( media-sound/pulseaudio )
78         virtual/freedesktop-icon-theme
79         dbus? ( >=sys-apps/dbus-0.60
80                 >=dev-libs/dbus-glib-0.72 )
81         startup-notification? ( >=x11-libs/startup-notification-0.8 )
82         >=dev-libs/glib-2.26:2
83         >=sys-libs/zlib-1.2.3
84         >=virtual/libffi-3.0.10
85         gstreamer? (
86                 >=media-libs/gstreamer-1.4.5:1.0
87                 >=media-libs/gst-plugins-base-1.4.5:1.0
88                 >=media-libs/gst-plugins-good-1.4.5:1.0
89                 >=media-plugins/gst-plugins-libav-1.4.5:1.0
90         )
91         gstreamer-0? (
92                 >=media-libs/gstreamer-0.10.25:0.10
93                 media-plugins/gst-plugins-meta:0.10[ffmpeg]
94         )
95         x11-libs/libX11
96         x11-libs/libXcomposite
97         x11-libs/libXdamage
98         x11-libs/libXext
99         x11-libs/libXfixes
100         x11-libs/libXrender
101         x11-libs/libXt
102         system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
103         system-icu? ( >=dev-libs/icu-51.1:= )
104         system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
105         system-sqlite? ( >=dev-db/sqlite-3.8.11.1:3[secure-delete,debug=] )
106         system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
107 "
108
109 if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
110         if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
111                 IUSE+=" +gtk3"
112         else
113                 IUSE+=" gtk3"
114         fi
115         RDEPEND+="
116         gtk3? ( >=x11-libs/gtk+-3.14.0:3 )"
117 fi
118 if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
119         if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
120                 IUSE+=" +wifi"
121         else
122                 IUSE+=" wifi"
123         fi
124         RDEPEND+="
125         wifi? (
126                 kernel_linux? ( >=sys-apps/dbus-0.60
127                         >=dev-libs/dbus-glib-0.72
128                         net-misc/networkmanager )
129         )"
130 fi
131 if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
132         if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
133                 IUSE+=" +jit"
134         else
135                 IUSE+=" jit"
136         fi
137 fi
138
139 DEPEND="app-arch/zip
140         app-arch/unzip
141         >=sys-devel/binutils-2.16.1
142         ${RDEPEND}"
143
144 RDEPEND+="
145         selinux? ( sec-policy/selinux-mozilla )"
146
147 # only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this
148 REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
149
150 # @FUNCTION: mozconfig_config
151 # @DESCRIPTION:
152 # Set common configure options for mozilla packages.
153 # Call this within src_configure() phase, after mozconfig_init
154 #
155 # Example:
156 #
157 # inherit mozconfig-v5.33
158 #
159 # src_configure() {
160 #       mozconfig_init
161 #       mozconfig_config
162 #       # ... misc ebuild-unique settings via calls to
163 #       # ... mozconfig_{annotate,use_with,use_enable}
164 #       mozconfig_final
165 # }
166
167 mozconfig_config() {
168         # Migrated from mozcoreconf-2
169         mozconfig_annotate 'system_libs' \
170                 --with-system-zlib \
171                 --enable-pango \
172                 --enable-svg \
173                 --with-system-bz2
174
175         if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
176                 mozconfig_annotate 'gtk3 use flag' --enable-default-toolkit=$(usex gtk3 cairo-gtk3 cairo-gtk2)
177         else
178                 mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
179         fi
180
181         if has bindist ${IUSE}; then
182                 mozconfig_use_enable !bindist official-branding
183                 if [[ ${PN} == firefox ]] && use bindist ; then
184                         mozconfig_annotate '' --with-branding=browser/branding/aurora
185                 fi
186         fi
187
188         mozconfig_use_enable debug
189         mozconfig_use_enable debug tests
190
191         if ! use debug ; then
192                 mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
193         else
194                 mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
195         fi
196
197         mozconfig_use_enable startup-notification
198
199         if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
200                 # wifi pulls in dbus so manage both here
201                 mozconfig_use_enable wifi necko-wifi
202                 if use kernel_linux && use wifi && ! use dbus; then
203                         echo "Enabling dbus support due to wifi request"
204                         mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
205                 else
206                         mozconfig_use_enable dbus
207                 fi
208         else
209                 mozconfig_use_enable dbus
210                 mozconfig_annotate 'disabled' --disable-necko-wifi
211         fi
212
213         # These are forced-on for webm support
214         mozconfig_annotate 'required' --enable-ogg
215         mozconfig_annotate 'required' --enable-wave
216
217         if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
218                 mozconfig_use_enable jit ion
219         fi
220
221         # These are enabled by default in all mozilla applications
222         mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
223         mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
224         mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
225         mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
226         mozconfig_annotate '' --prefix="${EPREFIX}"/usr
227         mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
228         mozconfig_annotate 'Gentoo default' --enable-system-hunspell
229         mozconfig_annotate '' --disable-gnomevfs
230         mozconfig_annotate '' --disable-gnomeui
231         mozconfig_annotate '' --enable-gio
232         mozconfig_annotate '' --disable-crashreporter
233         mozconfig_annotate 'Gentoo default' --with-system-png
234         mozconfig_annotate '' --enable-system-ffi
235         mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
236         mozconfig_annotate 'Gentoo default' --disable-skia
237         mozconfig_annotate '' --disable-gconf
238         mozconfig_annotate '' --with-intl-api
239
240         # Use jemalloc unless libc is not glibc >= 2.4
241         # at this time the minimum glibc in the tree is 2.9 so we should be safe.
242         if use elibc_glibc && use jemalloc3; then
243                 # We must force-enable jemalloc 3 via .mozconfig
244                 echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
245                 mozconfig_annotate '' --enable-jemalloc
246                 mozconfig_annotate '' --enable-replace-malloc
247         fi
248
249         mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
250         mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
251
252         if use gstreamer ; then
253                 mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
254         elif use gstreamer-0 ; then
255                 mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
256         else
257                 mozconfig_annotate '' --disable-gstreamer
258         fi
259         mozconfig_use_enable pulseaudio
260
261         mozconfig_use_enable system-cairo
262         mozconfig_use_enable system-sqlite
263         mozconfig_use_with system-jpeg
264         mozconfig_use_with system-icu
265         mozconfig_use_with system-libvpx
266
267         # Modifications to better support ARM, bug 553364
268         if use neon ; then
269                 mozconfig_annotate '' --with-fpu=neon
270                 mozconfig_annotate '' --with-thumb=yes
271                 mozconfig_annotate '' --with-thumb-interwork=no
272         fi
273         if [[ ${CHOST} == armv* ]] ; then
274                 mozconfig_annotate '' --with-float-abi=hard
275                 mozconfig_annotate '' --enable-skia
276
277                 if ! use system-libvpx ; then
278                         sed -i -e "s|softfp|hard|" \
279                                 "${S}"/media/libvpx/moz.build
280                 fi
281         fi
282 }