# $Id$ PNAME="mozilla-firefox" PVER="11.0" PBUILD="r1" PCAT="net-www" DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser." HOMEPAGE="http://www.mozilla.org/products/firefox/" DEPEND=">= x11-libs/libXrender-0.9 >= x11-libs/libXcomposite-0.4 >= x11-libs/libXt-1 >= x11-libs/libXmu-1 >= dev-libs/expat-2 >= sys-libs/zlib-1.2.3 >= media-libs/fontconfig-2.8 >= media-libs/libjpeg-8 >= media-libs/libpng-1.5 >= dev-libs/glib2-2.28 >= dev-libs/libidl-0.8.14 >= app-arch/unzip-6 >= x11-libs/pango-1.28 >= x11-libs/cairo-1.10 >= x11-libs/gtk2+-2.24 >= dev-libs/nspr-4.8.8 >= dev-libs/nss-3.12.11 >= media-fonts/corefonts-2" SDEPEND=">= x11-proto/xineramaproto-1 >= x11-proto/compositeproto-0.4 >= dev-util/pkgconfig-0.25 >= sys-dev/autoconf-5 >= sys-dev/automake-4 >= sys-apps/sed-4 >= app-arch/zip-3" PROVIDE="virtual/webbrowser" SRCFILE="firefox-${PVER}.source.tar.bz2" SRCDIR="${BUILDDIR}/mozilla-release" ALX_ONLY_KEEP="etc/env.d usr/bin usr/share usr/$(mlibdir)/nsbrowser usr/$(mlibdir)/mozilla-firefox/firefox usr/$(mlibdir)/mozilla-firefox/firefox-bin usr/$(mlibdir)/mozilla-firefox/mozilla-xrmote-client usr/$(mlibdir)/mozilla-firefox/plugin-container usr/$(mlibdir)/mozilla-firefox/plugins usr/$(mlibdir)/mozilla-firefox/run-mozilla.sh usr/$(mlibdir)/mozilla-firefox/*.ini usr/$(mlibdir)/mozilla-firefox/*.xml usr/$(mlibdir)/mozilla-firefox/*.so usr/$(mlibdir)/mozilla-firefox/*.jar usr/$(mlibdir)/mozilla-firefox/chrome usr/$(mlibdir)/mozilla-firefox/chrome.manifest usr/$(mlibdir)/mozilla-firefox/components usr/$(mlibdir)/mozilla-firefox/default usr/$(mlibdir)/mozilla-firefox/dependentlibs.list usr/$(mlibdir)/mozilla-firefox/dictionaries usr/$(mlibdir)/mozilla-firefox/extensions usr/$(mlibdir)/mozilla-firefox/icons usr/$(mlibdir)/mozilla-firefox/plugins usr/$(mlibdir)/mozilla-firefox/searchplugins usr/$(mlibdir)/mozilla-firefox/update.locale" sminclude mozilla mtools alx-split SRC_URI=( ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME/mozilla-/}/releases/${PVER}/source/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/menu/firefox.png mirror://${PNAME}/menu/firefox.desktop mirror://${PNAME}/mozilla-firefox-3.0.6-pkgconfig.patch mirror://${PNAME}/mozilla-firefox-2.0.0.5-rpath-3.patch mirror://${PNAME}/mozilla-firefox-2.0.0.9-language.patch ) UP2DATE="updatecmd ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/source | sed 's:[-|.]source::' | lasttarball" export MOZ_PHOENIX=1 # 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 # now strip optimization from CFLAGS so it doesn't end up in the # compile string export CFLAGS="${CFLAGS/-O*/}" export CXXFLAGS="${CFLAGS}" # needed to build without warnings on gcc-3 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # patches, patches, patches # fix pkgconfig pathes mpatch mozilla-firefox-3.0.6-pkgconfig.patch || die # fix some compile issues on multilib systems mpatch mozilla-firefox-2.0.0.5-rpath-3.patch || die # enable variable languages via environment vars mpatch mozilla-firefox-2.0.0.9-language.patch || die # fix newer curl-headers sed -i '/#include /d' \ toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc \ toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc \ config/system-headers \ js/src/config/system-headers || die export WANT_AUTOCONF="2.1" autoconf || die } src_compile() { cd ${SRCDIR} # setup .mozconfig cp browser/config/mozconfig .mozconfig || die # where shall the files go ? mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/mozilla-firefox # set optimization level based on CFLAGS if [[ ${ARCH} = x86_64 ]] then # opts may cause segfaults on 64bit arches mozconf_add --enable-optimize=-O1 export CFLAGS="${CFLAGS} -fPIC" export CXXFLAGS="${CXXFLAGS} -fPIC" else mozconf_add --enable-optimize=-O2 fi # enable compat mode for plugins build with gcc2 mozconf_add --enable-old-abi-compat-wrappers # we don't need the installer mozconf_add --disable-installer # issue all warnings demanded by strict ANSI C mozconf_add --disable-pedantic # enable crypto support (Personal Security Manager) mozconf_add --enable-crypto # want system jpeg, pngm, zlib, nspr and nss #mozconf_add --with-system-jpeg # prefer libjpeg-turbo # doesn't work atm #mozconf_add --with-system-png mozconf_add --with-system-zlib mozconf_add --with-system-nspr mozconf_add --with-system-nss # enable cairo-gtk2 as default mozconf_add --enable-default-toolkit=cairo-gtk2 # libnotify support (disabled atm) mozconf_add --disable-libnotify # ipv6 support mozconf_add --enable-ipv6 # want xinerama mozconf_add --enable-xinerama # no xprint ? mozconf_add --disable-xprint # >= firefox-1.0.7 should use xft + pango, svg with cairo mozconf_add --disable-freetype2 mozconf_add --enable-xft mozconf_add --enable-pango mozconf_add --enable-system-cairo mozconf_add --enable-svg mozconf_add --enable-canvas # enable all image encoders mozconf_add --enable-image-encoder=all # disable debug build && enable stripping mozconf_add --disable-debug mozconf_add --disable-tests mozconf_add --enable-reorder mozconf_add --enable-strip mozconf_add --enable-strip-libs if [[ ${ARCH} = i*86 ]] then # optimze build for x86 mozconf_add --enable-elf-dynstr-gc fi # both needed to build galeon mozconf_add --enable-oji mozconf_add --enable-mathml # enable storage, places and safe-browsing mozconf_add --enable-storage mozconf_add --enable-places mozconf_add --enable-safe-browsing # enable default extensions mozconf_add --enable-extensions=default # gnome support (needs gnome-vfs) mozconf_add --disable-gnomevfs mozconf_add --enable-extension=-gnomevfs # broken with firefox-3.0.10 mozconf_add --disable-mochitest mozconf_add --disable-crashreporter # disable libnotify support on alx mozconf_add --disable-libnotify # and no dbus on alx too mozconf_add --disable-dbus # no yasm on alx atm, disable webm video format # and jpeg-turbo needs yasm too mozconf_add --disable-webm mozconf_add --disable-libjpeg-turbo # no libalsa too mozconf_add --disable-ogg mozconf_add --disable-wave # resolve multiple --enable-extensions down to one rebuild_extension_list # now run configure mconfigure || die # removes extraneous CFLAGS # to reduce RAM requirements while compiling mozilla_remove_cflags || die mmake || die } src_install() { cd ${SRCDIR} # install make DESTDIR=${BINDIR} install || die # fix permissions mchown -R root:root /usr/$(mlibdir)/mozilla-firefox || die # environment # mozilla-1.7* uses already the env var mozilla_five_home # firefox does not need this, the env var is only to compile # mozilla-based sources minstalldir /etc/env.d || die MCONFIG="/etc/env.d/90mozilla-firefox" mclearconfig || die maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/mozilla-firefox" || die maddconfig "LDPATH=/usr/$(mlibdir)/mozilla-firefox" || die # vendor information msetpref general.useragent.vendor Magellan-Linux || die # disable app.update in default config msetpref app.update.auto false || die msetpref app.update.enabled false || die msetpref app.update.autoInstallEnabled false || die # use system-colors msetpref browser.display.use_system_colors true || die # disable default-browser check msetpref browser.shell.checkDefaultBrowser false || die # menu entries minstallpixmap firefox.png || die minstalldir /usr/share/applications || die minstallfile -s firefox.desktop /usr/share/applications || die # now move all plugins to /usr/lib/nsbrowser/plugins minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die if [[ -d ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/plugins ]] then cp -a ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/plugins/* ${BINDIR}/usr/$(mlibdir)/nsbrowser/plugins || die rm -rf ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/plugins || die fi # and symlink them (we need a defined location for the plugins of all browsers) mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/mozilla-firefox/plugins || die # alx-only - alway export LANG=de_DE # we don't support any locales but firefox needs this to load the german i18n plugin sed -i 's:^\(#!/.*\):\1\nexport LANG="de_DE":' /usr/$(mlibdir)/mozilla-firefox/firefox || die }