summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /eclass/mozilla-launcher.eclass
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'eclass/mozilla-launcher.eclass')
-rw-r--r--eclass/mozilla-launcher.eclass123
1 files changed, 123 insertions, 0 deletions
diff --git a/eclass/mozilla-launcher.eclass b/eclass/mozilla-launcher.eclass
new file mode 100644
index 000000000000..0d7063859638
--- /dev/null
+++ b/eclass/mozilla-launcher.eclass
@@ -0,0 +1,123 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit nsplugins multilib
+
+if [[ ${PN: -4} != "-bin" ]] ; then
+ IUSE="moznopango"
+fi
+
+# update_mozilla_launcher_symlinks
+# --------------------------------
+# Create or remove the following symlinks in /usr/bin:
+#
+# firefox -> firefox-bin
+# thunderbird -> thunderbird-bin
+# mozilla -> mozilla-bin
+# sunbird -> sunbird-bin
+# seamonkey -> seamonkey-bin
+#
+# The symlinks are removed if they're found to be dangling. They are
+# created according to the following rules:
+#
+# - If there's a -bin symlink in /usr/bin, and no corresponding
+# non-bin symlink, then create one.
+#
+# - Can't do this in src_install otherwise it overwrites the one
+# for the non-bin package.
+#
+# - Link to the -bin symlink so it's easier to detect when to
+# remove the symlink.
+#
+# NOTE: This eclass does *not* manage the launcher stubs in /usr/bin except
+# when a -bin package is installed and the corresponding from-source
+# package is not installed. The usual stubs are actually installed in
+# src_install so they are included in the package inventory.
+#
+update_mozilla_launcher_symlinks() {
+ local f browsers="mozilla firefox thunderbird sunbird seamonkey"
+ cd "${ROOT}"/usr/bin
+
+ # Remove launcher symlinks that no longer apply
+
+ for f in ${browsers}; do
+ if [[ -L ${f} && ! -f ${f} ]]; then
+ einfo "Removing dangling ${f} launcher"
+ rm -f ${f}
+ fi
+ done
+
+ # Create new symlinks
+
+ for f in ${browsers}; do
+ if [[ -e ${f}-bin && ! -e ${f} ]]; then
+ einfo "Adding link from ${f}-bin to ${f}"
+ ln -s ${f}-bin ${f}
+ fi
+ done
+}
+
+# install_mozilla_launcher_stub name libdir
+# -----------------------------------------
+# Install a stub called /usr/bin/$name that executes mozilla-launcher
+#
+# Note: $PLUGINS_DIR comes from nsplugins (specifically the deprecated section).
+#
+install_mozilla_launcher_stub() {
+ [[ -n $2 ]] || die "install_launcher_stub requires two arguments"
+ declare name=$1
+ declare libdir=$2
+
+ # If we use xulrunner, the name of the binary should be the same
+ if [[ ${name: -3} == "xul" ]]; then
+ name=${name/xul/}
+ declare appname=xulrunner
+ declare xulparams="export XUL_PARAMS=${libdir}/application.ini"
+ declare libdir="/usr/$(get_libdir)/xulrunner-1.9"
+ else
+ declare appname=${name}
+ fi
+
+ dodir /usr/bin
+
+ if [[ ${PN: -4} == "-bin" ]] || ! use moznopango; then
+ cat <<EOF >"${D}"/usr/bin/${name}
+#!/bin/sh
+#
+# Stub script to run mozilla-launcher. We used to use a symlink here
+# but OOo brokenness makes it necessary to use a stub instead:
+# http://bugs.gentoo.org/show_bug.cgi?id=78890
+
+export MOZILLA_LAUNCHER=${appname}
+export MOZILLA_LIBDIR=${libdir}
+export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-/usr/$(get_libdir)/$PLUGINS_DIR}
+${xulparams}
+exec /usr/libexec/mozilla-launcher "\$@"
+EOF
+ else
+ cat <<EOF >"${D}"/usr/bin/${name}
+#!/bin/sh
+#
+# Stub script to run mozilla-launcher. We used to use a symlink here
+# but OOo brokenness makes it necessary to use a stub instead:
+# http://bugs.gentoo.org/show_bug.cgi?id=78890
+
+export MOZILLA_LAUNCHER=${appname}
+export MOZILLA_LIBDIR=${libdir}
+export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-/usr/$(get_libdir)/$PLUGINS_DIR}
+export MOZ_DISABLE_PANGO=1
+${xulparams}
+exec /usr/libexec/mozilla-launcher "\$@"
+EOF
+ fi
+ chmod 0755 "${D}"/usr/bin/${name}
+}
+
+warn_mozilla_launcher_stub() {
+ elog "Not all locales support the disabling of pango."
+ elog "If your locale does not support disabling pango,"
+ elog "please open a bug report on http://bugs.gentoo.org"
+ elog "Then we can filter around the problem with those"
+ elog "specific locales."
+}