Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

firefox-kde-opensuse 13.0.1 w/ PGO JEMALLOC

By: a guest on Jun 24th, 2012  |  syntax: None  |  size: 5.43 KB  |  hits: 86  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Contributor: Weng Xuetian <wengxt@gmail.com>
  2.  
  3. # PGO might not build for you. And it takes very long time to compile.
  4. _enable_pgo="y"
  5. # JEMALLOC not works for me, at least. You can just try, but might waste time.
  6. _enable_jemalloc_pgo="y"
  7.  
  8.  
  9. pkgname=firefox-kde-opensuse
  10. pkgver=13.0.1
  11. pkgrel=1
  12. pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
  13. arch=('i686' 'x86_64')
  14. license=('MPL' 'GPL' 'LGPL')
  15. depends=('gtk2' 'libidl2' 'mozilla-common' 'nss>=3.13.3' 'libxt'
  16.          'libxrender' 'hunspell' 'startup-notification' 'mime-types' 'dbus-glib'
  17.          'alsa-lib' 'libevent' 'sqlite3>=3.7.4' 'libnotify' 'desktop-file-utils'
  18.          'libvpx' 'lcms' 'nspr>=4.8.8' 'libevent' 'libpng' 'cairo' 'kmozillahelper>=0.6' )
  19. makedepends=('unzip' 'zip' 'diffutils' 'python2' 'wireless_tools' 'yasm' 'mesa'
  20.              'autoconf2.13' 'libidl2' 'xorg-server-xvfb' 'imake' 'gcc>=4.7.1')
  21. # this is a charka CCR feature, AUR user can ignore it.
  22. screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
  23.  
  24. if [[ $_enable_pgo == "y" ]]; then
  25.     if [ ! -f '/etc/chakra-release' ]; then
  26.         makedepends+=('xorg-server-xvfb')
  27.     fi
  28. fi
  29. provides=("firefox=${pkgver}")
  30. conflicts=('firefox')
  31. install=firefox.install
  32. url="http://www.mozilla.org/projects/firefox"
  33. #source=(ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.bz2
  34. source=(http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.bz2
  35.         mozconfig
  36.         mozconfig-pgo
  37.         firefox.desktop
  38.         firefox-install-dir.patch
  39.         vendor.js
  40.         kde.js
  41.         firefox-cross-desktop.patch
  42.         firefox-kde.patch
  43.         firefox-browser-css.patch
  44.         mozilla-nongnome-proxies.patch
  45.         mozilla-kde.patch
  46. )
  47.  
  48.  
  49. build() {
  50.   cd "mozilla-release"
  51.   patch -Np1 -i "../firefox-install-dir.patch"
  52.  
  53.   rm -f browser/components/shell/src/nsKDEShellService.cpp \
  54.         browser/components/shell/src/nsKDEShellService.h \
  55.         browser/components/shell/src/nsUnixShellService.cpp \
  56.         browser/components/shell/src/nsUnixShellService.h \
  57.         browser/base/content/browser-kde.xul
  58.   rm -f toolkit/xre/nsKDEUtils.cpp \
  59.         toolkit/xre/nsKDEUtils.h \
  60.         uriloader/exthandler/unix/nsCommonRegistry.cpp \
  61.         uriloader/exthandler/unix/nsCommonRegistry.h \
  62.         uriloader/exthandler/unix/nsKDERegistry.cpp \
  63.         uriloader/exthandler/unix/nsKDERegistry.h \
  64.         toolkit/content/widgets/dialog-kde.xml \
  65.         toolkit/content/widgets/preferences-kde.xml
  66.  
  67.   install -m 644 "../kde.js" browser/app/profile/kde.js
  68.   patch -Np1 -i "../mozilla-nongnome-proxies.patch" || return 1
  69.   patch -Np1 -i "../mozilla-kde.patch" || return 1
  70.   patch -Np1 -i "../firefox-cross-desktop.patch" || return 1
  71.   patch -Np1 -i "../firefox-kde.patch" || return 1
  72.   patch -Np1 -i "../firefox-browser-css.patch" || return 1
  73.  
  74.   if [[ $_enable_pgo == "y" ]]; then
  75.       msg "PGO is enabled"
  76.       cp "../mozconfig-pgo" .mozconfig
  77.   else
  78.       msg "PGO is disabled"
  79.       cp "../mozconfig" .mozconfig
  80.   fi
  81.  
  82.   # Fix PRE_RELEASE_SUFFIX
  83.   sed -i '/^PRE_RELEASE_SUFFIX := ""/s/ ""//' \
  84.       browser/base/Makefile.in
  85.  
  86.   export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/firefox"
  87.   export PYTHON="/usr/bin/python2"
  88.  
  89.   # PGO
  90.   if [[ $_enable_pgo == "y" ]]; then
  91.       if [[ $_enable_jemalloc_pgo == "y" ]]; then
  92.         sed -i '/^NO_PROFILE_GUIDED_OPTIMIZE = 1$/d' \
  93.             memory/jemalloc/Makefile.in
  94.       fi
  95.       echo 'LDFLAGS += -lX11 -lXrender' \
  96.           >> layout/build/Makefile.in
  97.  
  98.       if [ "${CARCH}" = "x86_64" ]; then
  99.         make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
  100.       fi
  101.  
  102.       LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX -screen 0 1280x1024x24 :99 &
  103.       LD_PRELOAD="" DISPLAY=:99 make -j1 -f client.mk profiledbuild MOZ_MAKE_FLAGS="$MAKEFLAGS"
  104.       kill $! || true
  105.   else
  106.       make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
  107.   fi
  108.  
  109. }
  110.  
  111. package() {
  112.   cd mozilla-release
  113.   make -j1 -f client.mk DESTDIR="$pkgdir" install
  114.  
  115.   install -m644 ../vendor.js "$pkgdir/usr/lib/firefox/defaults/pref"
  116.  
  117.   for i in 16 22 24 32 48 256; do
  118.       install -Dm644 browser/branding/official/default$i.png \
  119.         "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png"
  120.   done
  121.  
  122.   install -Dm644 ../firefox.desktop \
  123.     "$pkgdir/usr/share/applications/firefox.desktop"
  124.  
  125.   # Use system-provided dictionaries
  126.   rm -rf "$pkgdir"/usr/lib/firefox/{dictionaries,hyphenation}
  127.   ln -s /usr/share/hunspell "$pkgdir/usr/lib/firefox/dictionaries"
  128.   ln -s /usr/share/hyphen "$pkgdir/usr/lib/firefox/hyphenation"
  129.  
  130.   # We don't want the development stuff
  131.   rm -r "$pkgdir"/usr/{include,lib/firefox-devel,share/idl}
  132.  
  133.   #workaround for now
  134.   #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  135.   ln -sf firefox "$pkgdir/usr/lib/firefox/firefox-bin"
  136. }
  137.  
  138. md5sums=('82deadb501c7fc0e9fa6b025f51f05a1'
  139.          'ff77c91b4bdeb0204ffa33c0957b11c1'
  140.          '84fa853f0a821c46ce0396af7c897c9f'
  141.          '1df7fd9afd75d06decb129518a769133'
  142.          '1e4bcac59e93d21fffa6a1d1ad235247'
  143.          '0d053487907de4376d67d8f499c5502b'
  144.          '75df0f88cc7a7fa7d522459e4ff82cc5'
  145.          '6e7b4f2554beacb998bbce3f0e184584'
  146.          'ea852561bc568922b25548c8d5367aee'
  147.          '90cc234d848a2060abc6a007622e1af7'
  148.          '8b0ecfdf697485d7b7dd26291c0dc478'
  149.          '4ab126609ed4362c298b5c59aa3d25c7')