# $Header: /alx-cvs/smage-eglibc/mozilla-firefox-gtk1/mozilla-firefox-gtk1-2.0.0.16-r1.smage2,v 1.3 2008/08/27 14:46:17 niro Exp $ PNAME="mozilla-firefox-gtk1" PVER="2.0.0.16" PBUILD="r2" PCATEGORIE="net-www" STATE="unstable" 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/libXt-1 >= x11-libs/libXmu-1 >= media-libs/libjpeg-6b >= media-libs/libpng-1.2.24 >= dev-libs/expat-2 >= sys-libs/zlib-1.2.3 >= media-libs/fontconfig-2.5 >= dev-libs/glib1-1.2 == dev-libs/libidl-glib1-0.6.3 >= x11-libs/gtk1+-1.2" # >= app-arch/zip-2.3 SDEPEND=">= dev-util/pkgconfig-0.23 >= sys-dev/autoconf-4 >= sys-dev/automake-3" # >= sys-apps/sed-4" SRCFILE="firefox-${PVER}-source.tar.bz2" SRCDIR="${BUILDDIR}/mozilla" sminclude mozilla mtools alx SRC_URI=( ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PVER}/source/${SRCFILE} mirror://${PNAME/-gtk1/}/${SRCFILE} mirror://${PNAME/-gtk1/}/menu/firefox.png mirror://${PNAME/-gtk1/}/menu/firefox.desktop mirror://${PNAME/-gtk1/}/mozilla-firefox-1.5.0-embed-typeaheadfind.patch mirror://${PNAME/-gtk1/}/mozilla-firefox-1.5.0.11-pkgconfig.patch mirror://${PNAME/-gtk1/}/mozilla-firefox-2.0.0.5-libdeps.patch mirror://${PNAME/-gtk1/}/mozilla-firefox-2.0.0.5-asneeded.patch mirror://${PNAME/-gtk1/}/mozilla-firefox-2.0.0.5-respect-host-variable.patch mirror://${PNAME/-gtk1/}/mozilla-firefox-2.0.0.5-rpath-3.patch mirror://${PNAME/-gtk1/}/mozilla-firefox-2.0.0.5-pango-cursor.patch mirror://${PNAME/-gtk1/}/mozilla-firefox-2.0.0.9-language.patch ) #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 linking issues against pango # https://bugzilla.mozilla.org/show_bug.cgi?id=344821 mpatch mozilla-firefox-2.0.0.5-libdeps.patch || die # use as-needed with newer binutils # https://bugzilla.mozilla.org/show_bug.cgi?id=311236 mpatch mozilla-firefox-2.0.0.5-asneeded.patch || die # fixes typeahead and gtk fixes for embeded firefox browsers mpatch mozilla-firefox-1.5.0-embed-typeaheadfind.patch || die # fix pkgconfig pathes mpatch mozilla-firefox-1.5.0.11-pkgconfig.patch || die # fix some compile issues on multilib systems mpatch mozilla-firefox-2.0.0.5-respect-host-variable.patch || die mpatch mozilla-firefox-2.0.0.5-rpath-3.patch || die # fix pango-cursor issues mpatch mozilla-firefox-2.0.0.5-pango-cursor.patch || die # enable variable languages via environment vars mpatch mozilla-firefox-2.0.0.9-language.patch || die # branding the source with our tags sed -i "s|0000000000|Magellan Linux|" xpfe/global/build.dtd.in || 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 # optimize for size mozconf_add --enable-optimize=-Os # 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 mozconf_add --with-system-jpeg mozconf_add --with-system-png mozconf_add --with-system-zlib # but not nspr and nss mozconf_add --without-system-nspr mozconf_add --without-system-nss # enable gtk1 as default mozconf_add --enable-default-toolkit=gtk # no ipv6 support mozconf_add --disable-ipv6 # no xinerama mozconf_add --disable-xinerama # no xprint ? mozconf_add --disable-xprint # no freetype2 xft pango cairo and co mozconf_add --disable-freetype2 mozconf_add --disable-xft mozconf_add --disable-pango # build minimal set of image decoders mozconf_add --enable-image-decoders=png,gif,jpeg # build minimal set of protocol handlers # mozconf_add --enable-necko-protocols=http,file,res,jar mozconf_add --enable-necko-protocols=http # enable minimal profile support mozconf_add --disable-profilesharing mozconf_add --disable-profilelocking mozconf_add --enable-single-profile # disable features and skip various build steps mozconf_add --disable-accessibility mozconf_add --disable-composer mozconf_add --enable-plaintext-editor-only mozconf_add --disable-mailnews mozconf_add --disable-ldap mozconf_add --disable-postscript mozconf_add --disable-mathml mozconf_add --disable-oji mozconf_add --disable-jsd mozconf_add --disable-jsloader mozconf_add --disable-xpinstall mozconf_add --disable-xpfe-components mozconf_add --disable-necko-disk-cache mozconf_add --disable-updater mozconf_add --disable-xul mozconf_add --disable-inspector-apis mozconf_add --disable-plugins # configure necko to allocate smaller network buffers mozconf_add --enable-necko-small-buffers # disable debug logging and tests mozconf_add --disable-logging mozconf_add --disable-tests # 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 default extensions and typeaheadfind #mozconf_add --enable-extensions=default,typeaheadfind mozconf_add --enable-extensions=default # all these extensions needs xul mozconf_add --enable-extensions=-inspector mozconf_add --enable-extensions=-venkman mozconf_add --enable-extensions=-irc mozconf_add --enable-extensions=-tasks # gnome support (needs gnome-vfs) mozconf_add --disable-gnomevfs mozconf_add --enable-extensions=-gnomevfs # resolve multiple --enable-extensions down to one rebuild_extension_list # now run configure #ac_cv_visibility_pragma=no mconfigure || die 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 # not on alx # # 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 {} \; || : }