1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit nsplugins multilib
7 if [[ ${PN: -4} != "-bin" ]] ; then
11 # update_mozilla_launcher_symlinks
12 # --------------------------------
13 # Create or remove the following symlinks in /usr/bin:
15 # firefox -> firefox-bin
16 # thunderbird -> thunderbird-bin
17 # mozilla -> mozilla-bin
18 # sunbird -> sunbird-bin
19 # seamonkey -> seamonkey-bin
21 # The symlinks are removed if they're found to be dangling. They are
22 # created according to the following rules:
24 # - If there's a -bin symlink in /usr/bin, and no corresponding
25 # non-bin symlink, then create one.
27 # - Can't do this in src_install otherwise it overwrites the one
28 # for the non-bin package.
30 # - Link to the -bin symlink so it's easier to detect when to
33 # NOTE: This eclass does *not* manage the launcher stubs in /usr/bin except
34 # when a -bin package is installed and the corresponding from-source
35 # package is not installed. The usual stubs are actually installed in
36 # src_install so they are included in the package inventory.
38 update_mozilla_launcher_symlinks() {
39 local f browsers="mozilla firefox thunderbird sunbird seamonkey"
42 # Remove launcher symlinks that no longer apply
44 for f in ${browsers}; do
45 if [[ -L ${f} && ! -f ${f} ]]; then
46 einfo "Removing dangling ${f} launcher"
53 for f in ${browsers}; do
54 if [[ -e ${f}-bin && ! -e ${f} ]]; then
55 einfo "Adding link from ${f}-bin to ${f}"
61 # install_mozilla_launcher_stub name libdir
62 # -----------------------------------------
63 # Install a stub called /usr/bin/$name that executes mozilla-launcher
65 # Note: $PLUGINS_DIR comes from nsplugins (specifically the deprecated section).
67 install_mozilla_launcher_stub() {
68 [[ -n $2 ]] || die "install_launcher_stub requires two arguments"
72 # If we use xulrunner, the name of the binary should be the same
73 if [[ ${name: -3} == "xul" ]]; then
75 declare appname=xulrunner
76 declare xulparams="export XUL_PARAMS=${libdir}/application.ini"
77 declare libdir="/usr/$(get_libdir)/xulrunner-1.9"
79 declare appname=${name}
84 if [[ ${PN: -4} == "-bin" ]] || ! use moznopango; then
85 cat <<EOF >"${D}"/usr/bin/${name}
88 # Stub script to run mozilla-launcher. We used to use a symlink here
89 # but OOo brokenness makes it necessary to use a stub instead:
90 # https://bugs.gentoo.org/show_bug.cgi?id=78890
92 export MOZILLA_LAUNCHER=${appname}
93 export MOZILLA_LIBDIR=${libdir}
94 export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-/usr/$(get_libdir)/$PLUGINS_DIR}
96 exec /usr/libexec/mozilla-launcher "\$@"
99 cat <<EOF >"${D}"/usr/bin/${name}
102 # Stub script to run mozilla-launcher. We used to use a symlink here
103 # but OOo brokenness makes it necessary to use a stub instead:
104 # https://bugs.gentoo.org/show_bug.cgi?id=78890
106 export MOZILLA_LAUNCHER=${appname}
107 export MOZILLA_LIBDIR=${libdir}
108 export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-/usr/$(get_libdir)/$PLUGINS_DIR}
109 export MOZ_DISABLE_PANGO=1
111 exec /usr/libexec/mozilla-launcher "\$@"
114 chmod 0755 "${D}"/usr/bin/${name}
117 warn_mozilla_launcher_stub() {
118 elog "Not all locales support the disabling of pango."
119 elog "If your locale does not support disabling pango,"
120 elog "please open a bug report on https://bugs.gentoo.org"
121 elog "Then we can filter around the problem with those"
122 elog "specific locales."