1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: mozconfig-v5.33.eclass
7 # mozilla team <mozilla@gentoo.org>
8 # @BLURB: the new mozilla common configuration eclass for FF33 and newer, v5
10 # This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
11 # to provide a single common place for the common mozilla engine compoments.
13 # The eclass provides all common dependencies as well as common use flags.
15 # Some use flags which may be optional in particular mozilla packages can be
16 # supported through setting eclass variables.
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.
21 inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
24 0|1|2|3|4) die "EAPI=${EAPI} not supported"
27 # @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
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.
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.
37 # @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
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.
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.
47 # use-flags common among all mozilla ebuilds
48 IUSE="${IUSE} dbus debug gstreamer pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
51 # gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
52 # media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
54 RDEPEND=">=app-text/hunspell-1.2
57 >=dev-libs/libevent-1.4.7
58 >=x11-libs/cairo-1.10[X]
59 >=x11-libs/gtk+-2.14:2
61 >=x11-libs/pango-1.22.0
62 >=media-libs/libpng-1.6.13:0=[apng]
63 >=media-libs/mesa-10.2:*
65 >=media-libs/freetype-2.4.10
66 kernel_linux? ( media-libs/alsa-lib )
67 pulseaudio? ( media-sound/pulseaudio )
68 virtual/freedesktop-icon-theme
69 dbus? ( >=sys-apps/dbus-0.60
70 >=dev-libs/dbus-glib-0.72 )
71 startup-notification? ( >=x11-libs/startup-notification-0.8 )
72 >=dev-libs/glib-2.26:2
76 >=media-libs/gstreamer-1.2.3:1.0
77 >=media-libs/gst-plugins-base-1.2.3:1.0
78 >=media-libs/gst-plugins-good-1.2.3:1.0
79 >=media-plugins/gst-plugins-libav-1.1.0_pre20130128-r1:1.0
82 x11-libs/libXcomposite
88 system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
89 system-icu? ( >=dev-libs/icu-51.1:= )
90 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
91 system-sqlite? ( >=dev-db/sqlite-3.8.6:3[secure-delete,debug=] )
92 system-libvpx? ( =media-libs/libvpx-1.3.0*[postproc] )
95 if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
96 if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
102 wifi? ( >=sys-apps/dbus-0.60
103 >=dev-libs/dbus-glib-0.72
104 net-wireless/wireless-tools )"
106 if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
107 if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
116 >=sys-devel/binutils-2.16.1
120 selinux? ( sec-policy/selinux-mozilla )"
122 # @FUNCTION: mozconfig_config
124 # Set common configure options for mozilla packages.
125 # Call this within src_configure() phase, after mozconfig_init
129 # inherit mozconfig-v5.33
134 # # ... misc ebuild-unique settings via calls to
135 # # ... mozconfig_{annotate,use_with,use_enable}
140 # Migrated from mozcoreconf-2
141 mozconfig_annotate 'system_libs' \
147 mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
149 if has bindist ${IUSE}; then
150 mozconfig_use_enable !bindist official-branding
151 if [[ ${PN} == firefox ]] && use bindist ; then
152 mozconfig_annotate '' --with-branding=browser/branding/aurora
156 mozconfig_use_enable debug
157 mozconfig_use_enable debug tests
159 if ! use debug ; then
160 mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
162 mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
165 mozconfig_use_enable startup-notification
167 if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
168 # wifi pulls in dbus so manage both here
169 mozconfig_use_enable wifi necko-wifi
170 if use wifi && ! use dbus; then
171 echo "Enabling dbus support due to wifi request"
172 mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
174 mozconfig_use_enable dbus
177 mozconfig_use_enable dbus
178 mozconfig_annotate 'disabled' --disable-necko-wifi
181 # These are forced-on for webm support
182 mozconfig_annotate 'required' --enable-ogg
183 mozconfig_annotate 'required' --enable-wave
185 if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
186 mozconfig_use_enable jit ion
187 mozconfig_use_enable jit yarr-jit
190 # These are enabled by default in all mozilla applications
191 mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
192 mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
193 mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
194 mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
195 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
196 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
197 mozconfig_annotate 'Gentoo default' --enable-system-hunspell
198 mozconfig_annotate '' --disable-gnomevfs
199 mozconfig_annotate '' --disable-gnomeui
200 mozconfig_annotate '' --enable-gio
201 mozconfig_annotate '' --disable-crashreporter
202 mozconfig_annotate 'Gentoo default' --with-system-png
203 mozconfig_annotate '' --enable-system-ffi
204 mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
205 mozconfig_annotate '' --disable-gconf
207 # Use jemalloc unless libc is not glibc >= 2.4
208 # at this time the minimum glibc in the tree is 2.9 so we should be safe.
209 if use elibc_glibc; then
210 # We must force-enable jemalloc 3 via .mozconfig
211 echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
212 mozconfig_annotate '' --enable-jemalloc
213 mozconfig_annotate '' --enable-replace-malloc
216 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
217 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
219 if use gstreamer; then
220 mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
222 mozconfig_annotate '' --disable-gstreamer
224 mozconfig_use_enable pulseaudio
226 mozconfig_use_enable system-cairo
227 mozconfig_use_enable system-sqlite
228 mozconfig_use_with system-jpeg
229 mozconfig_use_with system-icu
230 mozconfig_use_enable system-icu intl-api
231 mozconfig_use_with system-libvpx