diff options
author | Sardem FF7 <sardemff7.pub@gmail.com> | 2011-04-16 17:26:35 +0200 |
---|---|---|
committer | Sardem FF7 <sardemff7.pub@gmail.com> | 2011-04-16 17:26:35 +0200 |
commit | c49571ec303801e9234e04b5cc34e2a05bf730bd (patch) | |
tree | d21db4675b0dcfaea56808fb5616e40921896bde | |
parent | mozilla-scm.eclass: Update (diff) | |
download | sardemff7-c49571ec303801e9234e04b5cc34e2a05bf730bd.tar.gz sardemff7-c49571ec303801e9234e04b5cc34e2a05bf730bd.tar.bz2 sardemff7-c49571ec303801e9234e04b5cc34e2a05bf730bd.zip |
mozilla-config.eclass: Full branding support
-rw-r--r-- | eclass/mozilla-config.eclass | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/eclass/mozilla-config.eclass b/eclass/mozilla-config.eclass index 88129b7..2410463 100644 --- a/eclass/mozilla-config.eclass +++ b/eclass/mozilla-config.eclass @@ -45,6 +45,7 @@ DEPEND="${RDEPEND} " IUSE="+alsa custom-optimization dbus +ipc libnotify mozdom raw startup-notification +system-sqlite +webm wifi" +${IS_LIBXUL} || IUSE+=" bindist" # Set by configure (plus USE_AUTOCONF=1), but useful for NSPR export MOZILLA_CLIENT=1 @@ -209,6 +210,13 @@ function mozconfig_configure { --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 fi [[ $# -gt 0 ]] && \ @@ -288,12 +296,49 @@ function mozconfig_configure { function mozilla_application_install() { [ -d "${S}"/${MOZ_APPLICATION}/branding/official ] || \ ln -s ../../other-licences/${PN} "${S}"/${MOZ_APPLICATION}/branding/official - # Install icon and .desktop for menu entry - newicon "${S}"/${MOZ_APPLICATION}/branding/official/content/icon64.png ${PN}.png - newmenu "${FILESDIR}"/${PN}.desktop ${PN}.desktop + + local size branding_path icon + branding_path="${S}"/${MOZ_APPLICATION}/branding/${MOZ_BRANDING} + source "${branding_path}"/configure.sh + icon="${MOZ_APP_DISPLAYNAME,,}" + + # Install icons and .desktop for menu entry + for size in 16 22 24 32 256; do + insinto "/usr/share/icons/hicolor/${size}x${size}/apps" + [ -f "${branding_path}/default${size}.png" ] && { + newins "${branding_path}/default${size}.png" "${icon}.png" || die + } + done + + # The 128x128 icon has a different name + insinto "/usr/share/icons/hicolor/128x128/apps" + newins "${branding_path}/mozicon128.png" "${icon}.png" || die + + # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs + newicon "${branding_path}/content/icon48.png" "${icon}.png" || die + newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" || die + + sed -i -e "s:@NAME@:${MOZ_APP_DISPLAYNAME}:" -e "s:@ICON@:${icon}:" \ + "${ED}/usr/share/applications/${PN}.desktop" || die # Add StartupNotify=true bug 237317 if use startup-notification ; then echo "StartupNotify=true" >> "${ED}"/usr/share/applications/${PN}.desktop fi } + +EXPORT_FUNCTIONS pkg_setup + +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 + + 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 +} |