# $Id$ PNAME="mozilla-firefox" PVER="3.5.4" PBUILD="r1" PCATEGORIE="net-www" STATE="unstable" DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser." HOMEPAGE="http://www.mozilla.org/products/firefox/" DEPEND=">= virtual/java >= 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/libmng-1.0.10 >= media-libs/fontconfig-2.7 >= media-libs/libjpeg-7 >= media-libs/libpng-1.2.40 >= dev-libs/glib2-2.22 >= dev-libs/libidl-0.8.13 >= app-arch/zip-3 >= app-arch/unzip-5.52 >= x11-libs/pango-1.26 >= x11-libs/cairo-1.8.8 >= x11-libs/gtk2+-2.18 >= dev-libs/nspr-4.8.2 >= dev-libs/nss-3.12.4" SDEPEND=">= x11-proto/xineramaproto-1 >= x11-proto/compositeproto-0.4 >= dev-util/pkgconfig-0.23 >= sys-dev/autoconf-5 >= sys-dev/automake-4 >= sys-apps/sed-4" SRCFILE="firefox-${PVER}.source.tar.bz2" XUL_PVER="1.9.1" SRCDIR="${BUILDDIR}/mozilla-${XUL_PVER}" sminclude mozilla mtools 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-3.5-asneeded.patch mirror://${PNAME}/mozilla-firefox-2.0.0.5-rpath-3.patch mirror://${PNAME}/mozilla-firefox-2.0.0.9-language.patch mirror://${PNAME}/mozilla-firefox-3.5-no-app-updates.patch mirror://${PNAME}/mozilla-firefox-3.5-reload-new-plugins.patch mirror://${PNAME}/mozilla-firefox-3.5-fixed-default-uris.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 # use as-needed with newer binutils # https://bugzilla.mozilla.org/show_bug.cgi?id=311236 mpatch mozilla-firefox-3.5-asneeded.patch || die # 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 # disable auto app updates mpatch mozilla-firefox-3.5-no-app-updates.patch || die # auto reload newly installed plugins mpatch mozilla-firefox-3.5-reload-new-plugins.patch || die # fix broken default uris mpatch mozilla-firefox-3.5-fixed-default-uris.patch || 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 # 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 # no 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 # 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} # needed directories minstalldir /etc/env.d || die minstalldir /usr/bin || die minstalldir /usr/$(mlibdir)/mozilla-firefox/icons || die minstalldir /usr/$(mlibdir)/mozilla-firefox/idl || die minstalldir /usr/$(mlibdir)/mozilla-firefox/include || die minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die minstalldir /usr/$(mlibdir)/pkgconfig || die minstalldir /usr/share/applications || die # install binaries cp -RL --no-preserve=links ${SRCDIR}/dist/bin/* \ ${BINDIR}/usr/$(mlibdir)/mozilla-firefox || die # fix permissions mchown -R root:root /usr/$(mlibdir)/mozilla-firefox || die # bins mlink /usr/$(mlibdir)/mozilla-firefox/firefox /usr/bin/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 echo "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/mozilla-firefox" > ${BINDIR}/etc/env.d/90mozilla-firefox || die echo "LDPATH=/usr/$(mlibdir)/mozilla-firefox" >> ${BINDIR}/etc/env.d/90mozilla-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 # necessary includes and idl files to build against firefox cp -LfR dist/include/* ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/include || die cp -LfR dist/idl/* ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/idl || die # symlink to a missing header mlink /usr/$(mlibdir)/mozilla-firefox/include/necko/nsIURI.h \ /usr/$(mlibdir)/mozilla-firefox/include/nsIURI.h || die # pkgconfig files # minstallfile build/unix/\*.pc /usr/$(mlibdir)/pkgconfig || die # install icons minstallfile ${SRCDIR}/other-licenses/branding/firefox/mozicon16.xpm \ /usr/$(mlibdir)/mozilla-firefox/icons || die minstallfile ${SRCDIR}/other-licenses/branding/firefox/mozicon50.xpm \ /usr/$(mlibdir)/mozilla-firefox/icons || die # menu entries minstallpixmap firefox.png || die minstallfile -s firefox.desktop /usr/share/applications || die # now move all plugins to /usr/lib/nsbrowser/plugins # and symlink them (we need a defined location for the plugins of all browsers) cp -a ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/plugins/* \ ${BINDIR}/usr/$(mlibdir)/nsbrowser/plugins || die rm -rf ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/plugins || die mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/mozilla-firefox/plugins || die } preinstall() { if [[ -n $(magequery -n mozilla) ]] then echo echo "This version of ${PCATEGORIE}/${PNAME} replaces the mozilla development files" echo "and both packages cannot coexist anymore." echo "net-www/mozilla has no official support from mozilla.com" echo "and will not included in future releases of magellan-linux." echo die "Please uninstall net-www/mozilla first!" fi } postinstall() { # update environment; needed for REGXPCOM env-rebuild source ${MROOT}/etc/profile # firefoxs mozilla_five_home export MOZILLA_FIVE_HOME="${MROOT}/usr/$(mlibdir)/mozilla-firefox" # register firefox echo "Registering Components and Chrome..." HOME=~root LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME} ${MOZILLA_FIVE_HOME}/regxpcom # HOME=~root LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME} ${MOZILLA_FIVE_HOME}/regchrome # fix permissions of component registry chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat # fix directory permissions find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || : # fix permissions on chrome files find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || : }