Advertisement
Marcel-

firefox-pgo-beta 5.0b4build1 PKGBUILD

Jun 7th, 2011
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.92 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=5.0b4
  24. _ffver=${_ffmajorver}
  25. _build=build1
  26. pkgver=${_ffver}${_build}
  27. pkgrel=1
  28. pkgdesc="Mozilla Firefox customizable web browser (XULRunner-independent, profile-guided optimization)"
  29. url="http://www.mozilla.com/firefox/"
  30. arch=('i686' 'x86_64')
  31. license=('MPL' 'GPL' 'LGPL')
  32.  
  33. _soundsystem='alsa-lib'  # 'alsa-lib' for ALSA, 'oss' for OSS
  34.  
  35. makedepends=('autoconf2.13' 'zip' 'diffutils' 'python2'
  36.              'yasm>=0.7.1' 'mesa' 'xorg-server-xvfb')
  37. # 'wireless_tools'
  38. depends=('gtk2' 'gcc-libs' 'libidl2' 'mozilla-common' 'nspr' 'nss' 'libxt'
  39.          'hunspell' 'startup-notification' 'libnotify' 'mime-types' 'lcms'
  40.          'dbus-glib' 'desktop-file-utils' 'libpng' 'cairo>=1.10.2-2' 'libevent'
  41.          'libvpx>=0.9.6-2' ${_soundsystem})
  42. # 'nspr'
  43. optdepends=('firefox-i18n: Language packs')
  44. provides=("$_realname=$pkgver")
  45. conflicts=('firefox' 'firefox-beta' 'firefox-pgo' 'firefox-pgo-minefield' 'firefox-pgo-minefield-smp')
  46.  
  47. source=("ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/$_ffver-candidates/$_build/source/firefox-$_ffver.source.tar.bz2"
  48.         'mozconfig'
  49.         'firefox.desktop'
  50.         'firefox-safe.desktop'
  51.         'firefox.install'
  52.         'profile-manual.sh'
  53.         'mozilla-pkgconfig.patch'
  54.         'xulrunner-version.patch'
  55.         'firefox-version.patch'
  56.         'xulrunner-omnijar.patch'
  57.         'port_gnomevfs_to_gio.patch'
  58.         'mozilla-firefox-1.0-lang.patch'
  59.         'crashreporter-remove-static.patch'
  60.         'mozilla-libjpeg-turbo.patch'
  61.         'fix-nsGIOService.patch'
  62.         'eliminate-deprecated-gtk-type-macros.patch'
  63.         'update-ply-2.5-to-3.3.patch'
  64.         'reload-new-plugins.patch'
  65.         'plugin-for-mimetype-pref.patch'
  66.         'firefox-browser-css.patch'
  67.         'ldflags-namespec.patch'
  68.         'jemalloc-enable-pgo.patch')
  69. sha256sums=('9709130535cc1cf874b4cbec3f48264375a4cc56d98688aa7a7c36455e9597ce'
  70.             '53fdf43532125d5b2e17eb2546dadbd2ea0abdc3c975f9cbfc4ad43b08cd80cb'
  71.             'cfb1b3442d94650ee3629d7a0a860f6e0ffd337773e4c25ec39c3a061af673f9'
  72.             '4b6de45753856a890f4482055666e77f9b01bdfb7e0df08bafaa3a4d9937eed3'
  73.             'd7e29cff81972da7008e9eb036fa2e74674a854134791d5df6ae94e3c536ef00'
  74.             'dbbdfa2edd8d45e1cdafa852877f2df0c9926f0407d78b49da9e6ab1856a0622'
  75.             '1530226270332c89c8debf5d638080c59dff05c328811a7321e1c31ae3d6d702'
  76.             '1aee4194691b2f1cc007117e9cd4f84128c3dfa8179a0a869466551f032d3ed0'
  77.             '101def78fe2959fb2c6cacd9b6abe2906faa74788a1e680496b521b1643bb5e5'
  78.             '85477a548a90d98446f618cecb280c5a5fdb74f83f39da74327653bbc41f653e'
  79.             'ef502dbaac234cda064abb060e6f8df033942c57bdf759396fd3f481fe4e32c8'
  80.             '0ca095ff2af57297f615877a7e79ddc84d1a3f62509a8af6ca50aad7a8671f6a'
  81.             '72d8ef7b40172a0cbef957b5f6d459fb53beb9c07e8b713f530b3d7844df091c'
  82.             'e1cad999850104b575f9a2e4471ebc0ceaadab26a592b13cd5b9f2c73395ebf9'
  83.             '991d0b968794b569d3b107b0aab8786d9c83007c892c7e76143b5af09ef94405'
  84.             'b325edc321808db9928a42316f2394e1df7c5e44c7e43664c74ef0f293fbfd78'
  85.             '50a72984b0b9c724960e9fafec761fcf8504bf4cf581247e492ca996cb8fae1a'
  86.             '0f48011fd69c5fdbbcf399feb47270f8d54d74f91da501d5e5d314a9eb0fcd4f'
  87.             '13924242f13f295867fe9108868ac6cfbb04cfc10dffe75f0fa69bbfa8688a92'
  88.             'd706a6e6febedf707f9f525cf7a3025cc64ebef96d25f486ce84e96941739dfa'
  89.             '0e9631fdad5efa3fd7a95b59171f5d15420d10aa61748b920cc994ee9227915c'
  90.             'e6b8345215eb0c595cadfd6b1abb3a12a1cad8b8b1f3528e6affc58900695215')
  91. install='firefox.install'
  92.  
  93.  
  94. build() {
  95.     # 93 length = 80 on output
  96. #   msg "* Note: If the build fails, try again, try without jemalloc PGO, and try without"
  97. #   msg "* PGO at all. PGO can be very temperamental -- it can sometimes take two or"
  98. #   msg "* three builds before you'll get a good one."
  99. #   sleep 5
  100.     cd "$srcdir"/mozilla-$_mozver
  101.  
  102.     cp "$srcdir"/mozconfig .mozconfig
  103.  
  104.     ### MK's own options:
  105.     sed -i 's/--enable-printing/--disable-printing/' .mozconfig
  106.     sed -i 's/--enable-xinerama/--disable-xinerama/' .mozconfig
  107.     sed -i 's/--enable-canvas3d/--disable-canvas3d/' .mozconfig
  108.     echo "ac_add_options --disable-necko-wifi --disable-gnomeui" >> .mozconfig
  109.     ###
  110.  
  111.     # Don't strip if the user doesn't want us to... ;p
  112.     if [ "$(check_option strip)" = "n" ]; then
  113.         sed -i 's/--enable-strip/--disable-strip/' .mozconfig
  114.         sed -i 's/--enable-install-strip/--disable-install-strip/' \
  115.             .mozconfig
  116.     fi
  117.     if [ "$_soundsystem" = "oss" ]; then
  118.         msg2 "Using OSS instead of ALSA."
  119.         sed -i 's/sydney_audio_alsa/sydney_audio_oss/' \
  120.                media/libsydneyaudio/src/Makefile.in
  121.         # Get rid of ALSA config system stuff (requires autoconf rerun)
  122.         sed -i '/alsa\//d' config/system-headers
  123.         sed -i '/alsa\//d' js/src/config/system-headers
  124.         sed -i '/LIB(asound/d' configure.in
  125.     fi
  126.  
  127.  
  128.     msg2 "Patches from distro packages..."
  129.     # Fix libdir/sdkdir - Fedora, Arch
  130.     patch -Np1 -i "$srcdir"/mozilla-pkgconfig.patch
  131.     # Force installation to the same path for every version - Arch, Fedora
  132.     patch -Np1 -i "$srcdir"/xulrunner-version.patch
  133.     patch -Np1 -i "$srcdir"/firefox-version.patch
  134.     # Mozilla bug #620931 - Arch, Fedora
  135. #   patch -Np1 -i "$srcdir"/xulrunner-omnijar.patch
  136.     # Mozilla bug #494163 - Arch, Fedora
  137. #   patch -Np1 -i "$srcdir"/port_gnomevfs_to_gio.patch
  138.     # Use LANG environment variable to choose locale - Arch
  139.     patch -Np1 -i "$srcdir"/mozilla-firefox-1.0-lang.patch
  140.     # We don't have an old libstdc++ - Fedora
  141.     patch -Np1 -i "$srcdir"/crashreporter-remove-static.patch
  142.     # libjpeg-turbo - Fedora
  143.     patch -Np2 -i "$srcdir"/mozilla-libjpeg-turbo.patch
  144.     # nsGIOService fixes - Ubuntu
  145.     patch -Np1 -i "$srcdir"/fix-nsGIOService.patch
  146.     # Update deprecated GTK type macros - Ubuntu
  147. #   patch -Np1 -i "$srcdir"/eliminate-deprecated-gtk-type-macros.patch
  148.     # Ensure that new plugins are reloaded - Ubuntu
  149.     patch -Np1 -i "$srcdir"/reload-new-plugins.patch
  150.     # Update PLY - Ubuntu
  151. #   patch -Np1 -i "$srcdir"/update-ply-2.5-to-3.3.patch
  152.     # Add control over plugins used for each mime-type via preferences - Ubuntu
  153.     patch -Np1 -i "$srcdir"/plugin-for-mimetype-pref.patch
  154.     # Dark color theme support - OpenSUSE
  155. #   patch -Np1 -i "$srcdir"/firefox-browser-css.patch
  156.  
  157.     msg2 "Patches from this package..."
  158.     # PGO compilation LDFLAGS fix
  159.     patch -Np1 -i "$srcdir"/ldflags-namespec.patch
  160.     # Enable experimental PGO for jemalloc (speed).
  161.     # See Mozilla bugs #418866 and #419470.
  162.     patch -Np0 -i "$srcdir"/jemalloc-enable-pgo.patch
  163.  
  164.  
  165.     msg2 "Setting up build..."
  166.     # Changing the user's optimization flags is justified, because this is
  167.     # a package specifically for an optimized software build, and because of
  168.     # the official branding, binaries can't be redistributed anyways.
  169.     # These flags just set guidelines for the build, they are overridden in
  170.     # most compile job pieces by Firefox's better judgement.
  171.     export CFLAGS="-march=native -O2 -fpermissive -pipe -mssse3 -funroll-loops -fomit-frame-pointer"
  172.     export CXXFLAGS="${CFLAGS}"
  173.     # The hash-style and as-needed flags are in Arch defaults anyways,
  174.     # and the other optimization flags are almost definitely safe.
  175.     export LDFLAGS="-Wl,-rpath,/usr/lib/firefox-$_ffmajorver -Wl,-O1,--sort-common,--hash-style=gnu,--as-needed"
  176.     export PYTHON=python2
  177.     echo -n "mk_add_options MOZ_MAKE_FLAGS=\"$MAKEFLAGS\"" >> .mozconfig
  178.     autoconf-2.13
  179.  
  180.  
  181.     msg2 "Actual build..."
  182.     # Yes, all this is SMP -- MOZ_MAKE_FLAGS take care of it.
  183.     # Uncomment to compile a non-PGO build first, to reduce
  184.     # chance of error in PGO build.  Comment lines after this also if
  185.     # you want a non-PGO build.
  186.     make -j1 -f client.mk build
  187.  
  188. #   msg2 "PGO build..."
  189.     # Use this block instead of the next if you wish to manually profile Firefox.
  190.     # Just go to the desired sites and close the browser when done.
  191. #   cp "$srcdir"/profile-manual.sh ff-pgo/_profile/pgo/profile-manual.sh
  192. #   echo -e 'mk_add_options PROFILE_GEN_SCRIPT='\''dash $(MOZ_OBJDIR)/_profile/pgo/profile-manual.sh'\''' >> .mozconfig
  193. #   make -j1 -f client.mk profiledbuild
  194.  
  195.     # Don't let auto-PGO disrupt the user, use a virtual framebuffer.
  196. #   LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX -terminate :99 &
  197. #   LD_PRELOAD="" DISPLAY=:99 make -j1 -f client.mk profiledbuild
  198. }
  199. package() {
  200.     cd "$srcdir"/mozilla-$_mozver
  201.  
  202.     make -j1 DESTDIR="$pkgdir" -C ff-pgo install
  203.  
  204.     for i in 16x16 22x22 24x24 32x32 48x48 256x256; do
  205.         install -Dm644 other-licenses/branding/firefox/default${i/x*/}.png \
  206.             "$pkgdir"/usr/share/icons/hicolor/$i/apps/firefox.png
  207.     done
  208.  
  209.     install -Dm644 "$srcdir"/firefox.desktop \
  210.         "$pkgdir"/usr/share/applications/firefox.desktop
  211.     install -Dm644 "$srcdir"/firefox-safe.desktop \
  212.         "$pkgdir"/usr/share/applications/firefox-safe.desktop
  213.  
  214.     # Remove devel stuff
  215.     rm -rf "$pkgdir"/usr/include/
  216. #   rm -rf "$pkgdir"/usr/lib/firefox-devel-$_ffmajorver/
  217. #   hard-coded work around:
  218.     rm -rf "$pkgdir"/usr/lib/firefox-devel-4.0/
  219.     rm -rf "$pkgdir"/usr/share/idl/
  220. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement