aboutsummaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/mozilla-app.eclass (renamed from eclass/mozilla-config.eclass)206
-rw-r--r--eclass/mozilla-scm-fetch.eclass27
-rw-r--r--eclass/mozilla-scm.eclass140
3 files changed, 189 insertions, 184 deletions
diff --git a/eclass/mozilla-config.eclass b/eclass/mozilla-app.eclass
index ee1b144..d00e3fe 100644
--- a/eclass/mozilla-config.eclass
+++ b/eclass/mozilla-app.eclass
@@ -5,14 +5,37 @@
# @ECLASS: mozilla-config.eclass
# @MAINTAINER:
# Sardem FF7 <sardemff7.pub@gmail.com>
-# @BLURB: This eclass provides Mozilla config support
+# @BLURB: This eclass provides Mozilla app build support
-inherit flag-o-matic
+WANT_AUTOCONF="2.1"
+
+inherit base multilib toolchain-funcs autotools python flag-o-matic pax-utils mozilla-scm
+
+MAJ_XUL_PV="7.0"
+
+S="${WORKDIR}/${XULRUNNER_HG_MODULE}"
+
+#
+# Some per-application stuff
+#
+MOZLIBDIR="/usr/$(get_libdir)/xulrunner-${MAJ_XUL_PV}"
+MOZDEVELDIR="/usr/$(get_libdir)/xulrunner-devel-${MAJ_XUL_PV}"
+SDKDIR="${MOZDEVELDIR}/sdk"
+MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
+case "${PN}" in
+ firefox)
+ MOZ_APPLICATION=browser
+ ;;
+ thunderbird)
+ MOZ_APPLICATION=mail
+ ;;
+esac
-##
-## Base common stuff
-##
RDEPEND="
+ x11-libs/libXrender
+ x11-libs/libXt
+ x11-libs/libXmu
+ >=sys-libs/zlib-1.1.4
virtual/jpeg
dev-libs/expat
app-arch/unzip
@@ -32,6 +55,7 @@ RDEPEND="
alsa? ( media-libs/alsa-lib )
dbus? ( >=dev-libs/dbus-glib-0.72 )
+ gconf? ( gnome-base/gconf:2 )
libnotify? ( >=x11-libs/libnotify-0.4 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
system-sqlite? ( >=dev-db/sqlite-3.7.5[fts3,secure-delete,unlock-notify] )
@@ -40,18 +64,79 @@ RDEPEND="
"
DEPEND="${RDEPEND}
+ meta-sync/mozilla-repositories[mozdom=]
webm? ( dev-lang/yasm )
>=sys-devel/gcc-4.1
"
-IUSE="+alsa custom-optimization dbus +ipc libnotify mozdom raw startup-notification +system-sqlite +webm wifi"
-${IS_LIBXUL} || IUSE+=" bindist"
+RDEPEND+="
+ !net-libs/xulrunner
+ !www-plugins/weave
+ "
+
+IUSE="+alsa bindist custom-optimization debug dbus gconf +ipc libnotify mozdom raw startup-notification +system-sqlite +webm wifi"
+
+
+EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst
+
+function mozilla-app_pkg_setup() {
+ # Set by configure (plus USE_AUTOCONF=1), but useful for NSPR
+ export MOZILLA_CLIENT=1
+ export BUILD_OPT=1
+ export NO_STATIC_LIB=1
+ export USE_PTHREADS=1
+
+ if [ "${XULRUNNER_HG_MODULE}" = "mozilla-aurora" ]; then
+ MOZ_BRANDING=aurora
+ elif use bindist; then
+ MOZ_BRANDING=nightly
+ else
+ MOZ_BRANDING=official
+
+ elog "You are enabling official branding. You may not redistribute this build"
+ elog "to any users on your network or the internet. Doing so puts yourself into"
+ elog "a legal problem with Mozilla Foundation"
+ fi
+}
+
+function mozilla-app_src_prepare() {
+ epatch "${FILESDIR}"/gcc46.patch
+
+ # fix double symbols due to double -ljemalloc
+ sed -i \
+ -e '/^LIBS += $(JEMALLOC_LIBS)/s/^/#/' \
+ xulrunner/stub/Makefile.in \
+ || die
+
+ # Enable gnomebreakpad
+ if use debug; then
+ sed -i \
+ -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
+ build/unix/run-mozilla.sh \
+ || die "sed failed!"
+ fi
+
+ # tmp fix
+ sed -i \
+ -e '/XPIDL_LINK =/s|$(LIBXUL_DIST)/sdk/bin|$(DEPTH)/xpcom/typelib/xpt/tools|' \
+ config/config.mk \
+ js/src/config/config.mk \
+ || die "tmp fix failed (maybe the time to remove it)"
+
+ # Gentoo install dirs
+ sed -i \
+ -e 's:$(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION):$(includedir)/idl:' \
+ -e 's:$(MOZ_APP_NAME)-$(MOZ_APP_VERSION):firefox:' \
+ -e 's:$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION):firefox:' \
+ -e 's:$(MOZ_APP_VERSION):'"${MAJ_XUL_PV}:" \
+ config/autoconf.mk.in \
+ || die "${MAJ_XUL_PV} sed failed!"
-# Set by configure (plus USE_AUTOCONF=1), but useful for NSPR
-export MOZILLA_CLIENT=1
-export BUILD_OPT=1
-export NO_STATIC_LIB=1
-export USE_PTHREADS=1
+ eautoreconf
+
+ cd js/src
+ eautoreconf
+}
mozconfig_annotate() {
declare reason=$1 x ; shift
@@ -73,10 +158,18 @@ mozconfig_use_with() {
mozconfig_flag "$1" "$(use_with "$@")"
}
-##
-## mozconfig_configure
-##
-function mozconfig_configure {
+function mozilla-app_src_configure() {
+ MAKEOPTS=${MAKEOPTS/--no-print-directory/}
+
+ # Ensure that are plugins dir is enabled as default
+ sed -i -e "s:/usr/lib/mozilla/plugins:/usr/$(get_libdir)/nsbrowser/plugins:" \
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path!"
+
+ # hack added to workaround bug 299905 on hosts with libc that doesn't
+ # support tls, (probably will only hit this condition with Gentoo Prefix)
+ tc-has-tls -l || export ac_cv_thread_keyword=no
+
+
####################################
#
# Setup the initial .mozconfig
@@ -211,28 +304,19 @@ function mozconfig_configure {
# jemalloc won't build with older glibc
! has_version ">=sys-libs/glibc-2.4" && mozconfig_annotate 'old glibc' --disable-jemalloc
- if ! ${IS_LIBXUL}; then
- mozconfig_annotate 'libxul application' \
- --enable-official-branding \
- --with-system-libxul \
- --with-libxul-sdk="${EPREFIX}"${MOZDEVELDIR}
- if [ "${MOZ_BRANDING}" = "official" ]; then
- mozconfig_annotate 'Official branding' \
- --enable-official-branding
- else
- mozconfig_annotate 'Unofficial branding' \
- --with-branding=${MOZ_APPLICATION}/branding/${MOZ_BRANDING}
- fi
+ if [ "${MOZ_BRANDING}" = "official" ]; then
+ mozconfig_annotate 'Official branding' \
+ --enable-official-branding
+ else
+ mozconfig_annotate 'Unofficial branding' \
+ --with-branding=${MOZ_APPLICATION}/branding/${MOZ_BRANDING}
fi
- [[ $# -gt 0 ]] && \
- mozconfig_annotate 'Ebuild specific option: '"${P}" \
- ${*}
-
# Use system libraries
mozconfig_use_enable alsa ogg
mozconfig_use_enable alsa wave
mozconfig_use_enable dbus
+ mozconfig_use_enable gconf
mozconfig_use_enable ipc # +ipc, upstream default
mozconfig_use_enable libnotify
mozconfig_use_enable raw
@@ -250,7 +334,7 @@ function mozconfig_configure {
# Debug
- if use debug ; then
+ if use debug; then
mozconfig_annotate 'Debug activated' \
--disable-optimize \
--enable-valgrind \
@@ -297,12 +381,21 @@ function mozconfig_configure {
echo '=========================================================='
echo
- mozilla-scm_src_configure
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" PYTHON="$(PYTHON)" econf "$@"
+}
+
+function mozilla-app_src_compile() {
+ emake tier_app_dirs=xulrunner || die "emake failed"
}
-function mozilla_application_install() {
- [ -d "${S}"/${MOZ_APPLICATION}/branding/official ] || \
- ln -s ../../other-licenses/branding/${PN} "${S}"/${MOZ_APPLICATION}/branding/official
+function mozilla-app_src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ local prefdir="${ED}/${MOZILLA_FIVE_HOME}/defaults/pref"
+ [[ -d "${prefdir}erences" ]] && prefdir+="erences"
+ cp "${FILESDIR}"/default-prefs.js \
+ "${prefdir}/all-gentoo.js" || \
+ die "failed to cp default-prefs.js"
local size branding_path icon
branding_path="${S}"/${MOZ_APPLICATION}/branding/${MOZ_BRANDING}
@@ -338,20 +431,35 @@ function mozilla_application_install() {
if use startup-notification ; then
echo "StartupNotify=true" >> "${ED}"/usr/share/applications/${PN}.desktop
fi
+
+ rm "${ED}"/usr/bin/xulrunner
+
+ # env.d file for ld search path
+ dodir /etc/env.d
+ echo "LDPATH=${EPREFIX}/${MOZLIBDIR}" > "${ED}"/etc/env.d/08xulrunner || die "env.d failed"
+
+ pax-mark m "${ED}"/${MOZLIBDIR}/plugin-container
+ pax-mark m "${ED}"/${MOZILLA_FIVE_HOME}/firefox
+
+ # Plugins dir
+ dosym ../nsbrowser/plugins "${MOZILLA_FIVE_HOME}"/plugins \
+ || die "failed to symlink"
}
-EXPORT_FUNCTIONS pkg_setup
+##
+## eclass exported function
+## pkg_postinst
+##
+function mozilla-scm_pkg_postinst {
+ ewarn "All the packages built against ${PN} won't compile,"
+ ewarn "any package that fails to build warrants a bug report."
-function mozilla-config_pkg_setup() {
- if [ "${XULRUNNER_HG_MODULE}" = "mozilla-aurora" ]; then
- MOZ_BRANDING=aurora
- elif use bindist; then
- MOZ_BRANDING=nightly
- else
- MOZ_BRANDING=official
+ inherit fdo-mime
+ # Update mimedb for the new .desktop file
+ fdo-mime_desktop_database_update
- elog "You are enabling official branding. You may not redistribute this build"
- elog "to any users on your network or the internet. Doing so puts yourself into"
- elog "a legal problem with Mozilla Foundation"
- fi
+ ewarn "This is highly experimental DO NOT file a bug report"
+ ewarn "on Gentoo's bugzilla, please visit the Mozilla one instead"
+
+ einfo "Don't forget to sync with meta-sync/mozilla-repositories"
}
diff --git a/eclass/mozilla-scm-fetch.eclass b/eclass/mozilla-scm-fetch.eclass
index 9db6d3a..6e1d720 100644
--- a/eclass/mozilla-scm-fetch.eclass
+++ b/eclass/mozilla-scm-fetch.eclass
@@ -121,3 +121,30 @@ function moz_hg_unpack {
"${dest}" || die "hg clone failed"
einfo "Work directory: ${dest}"
}
+
+EXPORT_FUNCTIONS pkg_setup src_unpack
+
+##
+## eclass exported function
+## pkg_setup
+##
+function mozilla-scm_pkg_setup {
+ # Ensure we always build with C locale.
+ export LANG="C"
+ export LC_ALL="C"
+ export LC_MESSAGES="C"
+ export LC_CTYPE="C"
+
+ python_set_active_version 2
+}
+
+##
+## eclass exported function
+## src_unpack
+##
+function mozilla-scm-fetch_src_unpack {
+ local base_dest=${1:-${XULRUNNER_HG_MODULE}}
+ addwrite "$(dirname "${EHG_STORE_DIR}")" || die "addwrite failed"
+ moz_hg_unpack "${XULRUNNER_HG_MODULE}" "${base_dest}"
+ use mozdom && moz_hg_unpack "${MOZDOM_HG_MODULE}" "${base_dest}/extensions/inspector"
+}
diff --git a/eclass/mozilla-scm.eclass b/eclass/mozilla-scm.eclass
index 2d1117f..b619fa5 100644
--- a/eclass/mozilla-scm.eclass
+++ b/eclass/mozilla-scm.eclass
@@ -7,39 +7,8 @@
# Sardem FF7 <sardemff7.pub@gmail.com>
# @BLURB: This eclass provides Mozilla SCM building support
-WANT_AUTOCONF="2.1"
-inherit mozilla-scm-fetch base multilib toolchain-funcs autotools python
-
-MAJ_XUL_PV="7.0"
-
-MOZ_HG_BASE_URI="http://hg.mozilla.org"
-
-S="${WORKDIR}/${XULRUNNER_HG_MODULE}"
-
-#
-# Some per-application stuff
-#
-IS_LIBXUL=false
-MOZLIBDIR="/usr/$(get_libdir)/xulrunner-${MAJ_XUL_PV}"
-MOZDEVELDIR="/usr/$(get_libdir)/xulrunner-devel-${MAJ_XUL_PV}"
-SDKDIR="${MOZDEVELDIR}/sdk"
-MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
-case "${PN}" in
- xulrunner)
- IS_LIBXUL=true
- MOZ_APPLICATION=xulrunner
- MOZILLA_FIVE_HOME="${MOZLIBDIR}"
- ;;
- firefox)
- MOZ_APPLICATION=browser
- ;;
- thunderbird)
- MOZ_APPLICATION=mail
- ;;
-esac
-
-EXPORT_FUNCTIONS pkg_setup src_unpack src_configure src_install pkg_postinst
+inherit mozilla-scm-fetch
# @ECLASS-VARIABLE: EHG_REVISION
# @DESCRIPTION:
@@ -49,110 +18,11 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_configure src_install pkg_postinst
# just a revision, please consult `hg help revisions' for more details.
: ${EHG_REVISION:=tip}
-
-##
-## Base common stuff
-##
-RDEPEND=""
-[ "${PN}" != "nspr" ] && RDEPEND+="~dev-libs/nspr-9999"
-if [ -n "${MOZ_APPLICATION}" ]; then
- IUSE="mozdom"
-
- DEPEND="
- meta-sync/mozilla-repositories[mozdom=]
- "
- RDEPEND+="
- x11-libs/libXrender
- x11-libs/libXt
- x11-libs/libXmu
- >=sys-libs/zlib-1.1.4
- "
-
- ${IS_LIBXUL} || \
- RDEPEND+="
- ~net-libs/xulrunner-9999[libnotify=,mozdom=,raw=,system-sqlite=,webm=,wifi=]
- "
-else
- DEPEND="
- meta-sync/mozilla-repositories
- "
-fi
-
-DEPEND+="${RDEPEND}
+[ "${PN}" != "nspr" ] && RDEPEND="~dev-libs/nspr-9999"
+DEPEND="${RDEPEND}
app-arch/zip
dev-util/pkgconfig
=dev-lang/python-2*[threads]
- "
-##
-## eclass exported function
-## src_unpack
-##
-function mozilla-scm_src_unpack {
- local base_dest=${1:-${XULRUNNER_HG_MODULE}}
- addwrite "$(dirname "${EHG_STORE_DIR}")" || die "addwrite failed"
- moz_hg_unpack "${XULRUNNER_HG_MODULE}" "${base_dest}"
- use mozdom && moz_hg_unpack "${MOZDOM_HG_MODULE}" "${base_dest}/extensions/inspector"
-}
-
-##
-## eclass exported function
-## pkg_setup
-##
-function mozilla-scm_pkg_setup {
- # Ensure we always build with C locale.
- export LANG="C"
- export LC_ALL="C"
- export LC_MESSAGES="C"
- export LC_CTYPE="C"
-
- python_set_active_version 2
-}
-
-##
-## eclass exported function
-## src_configure
-##
-function mozilla-scm_src_configure {
- CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" PYTHON="$(PYTHON)" econf "$@"
-}
-
-##
-## eclass exported function
-## src_install
-##
-function mozilla-scm_src_install {
- emake DESTDIR="${D}" install || die "emake install failed"
-
- local prefdir="${ED}/${MOZILLA_FIVE_HOME}/defaults/pref"
- [[ -d "${prefdir}erences" ]] && prefdir+="erences"
- cp "${FILESDIR}"/default-prefs.js \
- "${prefdir}/all-gentoo.js" || \
- die "failed to cp default-prefs.js"
-
- # Workaround
- if ! ${IS_LIBXUL}; then
- dosym ../xulrunner-${MAJ_XUL_PV} "${MOZILLA_FIVE_HOME}"/xulrunner \
- || die "failed to workaround xulrunner gre stuff"
- fi
-}
-
-##
-## eclass exported function
-## pkg_postinst
-##
-function mozilla-scm_pkg_postinst {
- if ! ${IS_LIBXUL}; then
- ewarn "All the packages built against ${PN} won't compile,"
- ewarn "any package that fails to build warrants a bug report."
-
- inherit fdo-mime
- # Update mimedb for the new .desktop file
- fdo-mime_desktop_database_update
- fi
-
- ewarn "This is highly experimental DO NOT file a bug report"
- ewarn "on Gentoo's bugzilla, please visit the Mozilla one instead"
-
- einfo "Don't forget to sync with meta-sync/mozilla-repositories"
-}
+ meta-sync/mozilla-repositories
+ "