Advertisement
Marcel-

firefox-pgo-beta 6.0b4build1

Aug 6th, 2011
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 8.47 KB | None | 0 0
  1. # Maintainer:  Devin Cofer <ranguvar@archlinux.us>
  2. # Contributor: wantilles <wantilles@adslgr.com>
  3. # Contributor: blasse <koralik(at)gmail(dot)com>
  4.  
  5. # Package Maintenance Resources:
  6. # http://projects.archlinux.org/svntogit/packages.git/tree/xulrunner/trunk/
  7. # http://projects.archlinux.org/svntogit/packages.git/tree/firefox/trunk/
  8. # http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-libs/xulrunner/
  9. # http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/firefox/
  10. # http://dev.gentoo.org/~anarchy/mozilla/patchsets/
  11. # http://bazaar.launchpad.net/~mozillateam/xulrunner/xulrunner-2.0.head/files/head:/debian/patches/
  12. # http://bazaar.launchpad.net/~mozillateam/firefox/firefox-4.0.head/files/head:/debian/patches/
  13. # http://pkgs.fedoraproject.org/gitweb/?p=xulrunner.git;a=summary
  14. # http://pkgs.fedoraproject.org/gitweb/?p=firefox.git;a=summary
  15. # http://www.freebsd.org/cgi/cvsweb.cgi/ports/www/libxul/
  16. # http://www.freebsd.org/cgi/cvsweb.cgi/ports/www/firefox/
  17. # http://aur.archlinux.org/packages.php?ID=45446
  18.  
  19. pkgname=firefox-pgo-beta
  20. _realname=firefox
  21. _mozver=beta
  22. _xulver=2.0
  23. _ffmajorver=6.0
  24. _ffbetaver=b4
  25. _ffver=${_ffmajorver}${_ffbetaver}
  26. _build=build1
  27. pkgver=${_ffver}${_build}
  28. pkgrel=1
  29. pkgdesc="Mozilla Firefox customizable web browser (XULRunner-independent, profile-guided optimization)"
  30. url="http://www.mozilla.com/firefox/"
  31. arch=('i686' 'x86_64')
  32. license=('MPL' 'GPL' 'LGPL')
  33.  
  34. _soundsystem='alsa-lib'  # 'alsa-lib' for ALSA, 'oss' for OSS
  35.  
  36. makedepends=('autoconf2.13' 'zip' 'diffutils' 'python2'
  37.              'yasm>=0.7.1' 'mesa' 'xorg-server-xvfb')
  38. # 'wireless_tools'
  39. depends=('gtk2' 'gcc-libs' 'libidl2' 'mozilla-common' 'nspr' 'nss' 'libxt'
  40.          'hunspell' 'startup-notification' 'libnotify' 'mime-types' 'lcms'
  41.          'dbus-glib' 'desktop-file-utils' 'libpng' 'cairo>=1.10.2-2' 'libevent'
  42.          'libvpx>=0.9.6-2' ${_soundsystem})
  43. # 'nspr'
  44. optdepends=('firefox-i18n: Language packs')
  45. provides=("$_realname=$pkgver")
  46. conflicts=('firefox' 'firefox-beta' 'firefox-pgo' 'firefox-pgo-minefield' 'firefox-pgo-minefield-smp')
  47.  
  48. source=("ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/$_ffver-candidates/$_build/source/firefox-$_ffver.source.tar.bz2"
  49.         'mozconfig'
  50.         'firefox.desktop'
  51.         'firefox-safe.desktop'
  52.         'firefox.install'
  53.         'profile-manual.sh'
  54.         'firefox-version.patch'
  55.         'mozilla-pkgconfig.patch'
  56.         'mozilla-firefox-1.0-lang.patch'
  57.         'mozilla-libjpeg-turbo.patch'
  58.         'reload-new-plugins.patch'
  59.         'firefox-browser-css.patch')
  60. sha256sums=('6782d6a6e160dde291c61e51ea79d6bc3c888cf4af392f3f5e99bc5fbb3f24c8'
  61.             '53fdf43532125d5b2e17eb2546dadbd2ea0abdc3c975f9cbfc4ad43b08cd80cb'
  62.             'cfb1b3442d94650ee3629d7a0a860f6e0ffd337773e4c25ec39c3a061af673f9'
  63.             '4b6de45753856a890f4482055666e77f9b01bdfb7e0df08bafaa3a4d9937eed3'
  64.             'd7e29cff81972da7008e9eb036fa2e74674a854134791d5df6ae94e3c536ef00'
  65.             'dbbdfa2edd8d45e1cdafa852877f2df0c9926f0407d78b49da9e6ab1856a0622'
  66.             '123012f8db4b749ba4612a1e806f187cdcd73a179370a0ee4bcdb22105930f44'
  67.             '1530226270332c89c8debf5d638080c59dff05c328811a7321e1c31ae3d6d702'
  68.             '0ca095ff2af57297f615877a7e79ddc84d1a3f62509a8af6ca50aad7a8671f6a'
  69.             'e1cad999850104b575f9a2e4471ebc0ceaadab26a592b13cd5b9f2c73395ebf9'
  70.             '0f48011fd69c5fdbbcf399feb47270f8d54d74f91da501d5e5d314a9eb0fcd4f'
  71.             'd706a6e6febedf707f9f525cf7a3025cc64ebef96d25f486ce84e96941739dfa')
  72. install='firefox.install'
  73.  
  74.  
  75. build() {
  76.     # 93 length = 80 on output
  77. #   msg "* Note: If the build fails, try again, try without jemalloc PGO, and try without"
  78. #   msg "* PGO at all. PGO can be very temperamental -- it can sometimes take two or"
  79. #   msg "* three builds before you'll get a good one."
  80. #   sleep 5
  81.     cd "$srcdir"/mozilla-$_mozver
  82.  
  83.     cp "$srcdir"/mozconfig .mozconfig
  84.  
  85.     ### MK's own options:
  86.     sed -i 's/--enable-printing/--disable-printing/' .mozconfig
  87.     sed -i 's/--enable-xinerama/--disable-xinerama/' .mozconfig
  88.     sed -i 's/--enable-canvas3d/--disable-canvas3d/' .mozconfig
  89.     echo "ac_add_options --disable-necko-wifi --disable-gnomeui" >> .mozconfig
  90.     ###
  91.  
  92.     # Don't strip if the user doesn't want us to... ;p
  93.     if [ "$(check_option strip)" = "n" ]; then
  94.         sed -i 's/--enable-strip/--disable-strip/' .mozconfig
  95.         sed -i 's/--enable-install-strip/--disable-install-strip/' \
  96.             .mozconfig
  97.     fi
  98.     if [ "$_soundsystem" = "oss" ]; then
  99.         msg2 "Using OSS instead of ALSA."
  100.         sed -i 's/sydney_audio_alsa/sydney_audio_oss/' \
  101.                media/libsydneyaudio/src/Makefile.in
  102.         # Get rid of ALSA config system stuff (requires autoconf rerun)
  103.         sed -i '/alsa\//d' config/system-headers
  104.         sed -i '/alsa\//d' js/src/config/system-headers
  105.         sed -i '/LIB(asound/d' configure.in
  106.     fi
  107.  
  108.  
  109.     msg2 "Patches from distro packages..."
  110.     # Force installation to the same path for every version - Arch, Fedora
  111.     patch -Np1 -i "$srcdir"/firefox-version.patch
  112.     # Fix libdir/sdkdir - Fedora, Arch
  113.     patch -Np1 -i "$srcdir"/mozilla-pkgconfig.patch
  114.     # Use LANG environment variable to choose locale - Arch
  115.     patch -Np1 -i "$srcdir"/mozilla-firefox-1.0-lang.patch
  116.     # We don't have an old libstdc++ - Fedora
  117.     patch -Np2 -i "$srcdir"/mozilla-libjpeg-turbo.patch
  118.     # Ensure that new plugins are reloaded - Ubuntu
  119.     patch -Np1 -i "$srcdir"/reload-new-plugins.patch
  120.     # Dark color theme support - OpenSUSE
  121.     patch -Np1 -i "$srcdir"/firefox-browser-css.patch
  122.  
  123.  
  124.     # Kill @PRE_RELEASE_SUFFIX@ from browser.xul because it
  125.     # gets set to \177 for an unknown reason
  126.     sed -i 's/@PRE_RELEASE_SUFFIX@//g' \
  127.         browser/base/content/browser.xul
  128.  
  129.     # Don't generate startup cache. Unbreaks build
  130.     sed -i 's/^GENERATE_CACHE .*/GENERATE_CACHE = true/' \
  131.         toolkit/mozapps/installer/packager.mk
  132.  
  133.     # PGO -- see Mozilla bugs #418866 and #419470
  134.     sed -i '/^NO_PROFILE_GUIDED_OPTIMIZE = 1$/d' \
  135.         memory/jemalloc/Makefile.in
  136.     echo 'LDFLAGS += -lX11 -lXrender' >> layout/build/Makefile.in
  137.  
  138.  
  139.     msg2 "Setting up build..."
  140.     # Changing the user's optimization flags is justified, because this is
  141.     # a package specifically for an optimized software build, and because of
  142.     # the official branding, binaries can't be redistributed anyways.
  143.     # These flags just set guidelines for the build, they are overridden in
  144.     # most compile job pieces by Firefox's better judgement.
  145.     export CFLAGS="-march=native -O2 -fpermissive -pipe -mssse3 -funroll-loops -fomit-frame-pointer -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
  146.     export CXXFLAGS="${CFLAGS}"
  147.     # The hash-style and as-needed flags are in Arch defaults anyways,
  148.     # and the other optimization flags are almost definitely safe.
  149.     export LDFLAGS="-Wl,-rpath,/usr/lib/firefox-$_ffmajorver -Wl,-O1,--sort-common,--hash-style=gnu,--as-needed,-z,relro"
  150.     export PYTHON='python2'
  151.     echo -n "mk_add_options MOZ_MAKE_FLAGS=\"$MAKEFLAGS\"" >> .mozconfig
  152.     autoconf-2.13
  153.  
  154.  
  155.     msg2 "Actual build..."
  156.     # Yes, all this is SMP -- MOZ_MAKE_FLAGS take care of it.
  157.     # Uncomment to compile a non-PGO build first, to reduce
  158.     # chance of error in PGO build.  Comment lines after this also if
  159.     # you want a non-PGO build.
  160.     make -j1 -f client.mk build
  161.  
  162.     msg2 "PGO build..."
  163.     # Use this block instead of the next if you wish to manually profile Firefox.
  164.     # Just go to the desired sites and close the browser when done.
  165. #   cp "$srcdir"/profile-manual.sh ff-pgo/_profile/pgo/profile-manual.sh
  166. #   echo -e 'mk_add_options PROFILE_GEN_SCRIPT='\''dash $(MOZ_OBJDIR)/_profile/pgo/profile-manual.sh'\''' >> .mozconfig
  167. #   make -j1 -f client.mk profiledbuild
  168.  
  169.     # Don't let auto-PGO disrupt the user, use a virtual framebuffer.
  170.     LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX -terminate :99 &
  171.     LD_PRELOAD="" DISPLAY=:99 make -j1 -f client.mk profiledbuild
  172. }
  173.  
  174. package() {
  175.     cd "$srcdir"/mozilla-$_mozver
  176.  
  177.     make -j1 DESTDIR="$pkgdir" -C ff-pgo install
  178.  
  179. #   for i in 16x16 22x22 24x24 32x32 48x48 256x256; do
  180. #       install -Dm644 other-licenses/branding/firefox/default${i/x*/}.png \
  181. #           "$pkgdir"/usr/share/icons/hicolor/$i/apps/firefox.png
  182. #   done
  183.  
  184.     for i in 16x16 32x32 48x48; do
  185.         install -Dm644 ff-pgo/dist/branding/default${i/x*/}.png \
  186.             "$pkgdir"/usr/share/icons/hicolor/$i/apps/firefox.png
  187.     done
  188.  
  189.     install -Dm644 "$srcdir"/firefox.desktop \
  190.         "$pkgdir"/usr/share/applications/firefox.desktop
  191.     install -Dm644 "$srcdir"/firefox-safe.desktop \
  192.         "$pkgdir"/usr/share/applications/firefox-safe.desktop
  193.  
  194.     # Remove devel stuff
  195.     rm -rf "$pkgdir"/usr/include/
  196.     rm -rf "$pkgdir"/usr/lib/firefox-devel-$_ffmajorver/
  197.     rm -rf "$pkgdir"/usr/share/idl/
  198. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement