Want more features on Pastebin? Sign Up, it's FREE!
Guest

firefox-kde-opensuse arch PKG file w/ pgo/jemalloc

By: a guest on Jun 12th, 2012  |  syntax: None  |  size: 5.51 KB  |  views: 73  |  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
  11. pkgrel=2
  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' 'gcc-libs' 'libidl2' 'mozilla-common' 'nss>=3.13.2' '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=('zip' 'pkg-config' 'diffutils' 'python2' 'wireless_tools' 'yasm'
  20.              'mesa' 'unzip' 'autoconf2.13' 'libidl2' 'mesa' 'xorg-server-xvfb' 'imake' 'gcc4.6')
  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.      
  87.   export CC=gcc-4.6
  88.   export CXX=g++-4.6
  89.   export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/firefox"
  90.   export PYTHON="/usr/bin/python2"
  91.  
  92.   # PGO
  93.   if [[ $_enable_pgo == "y" ]]; then
  94.       if [[ $_enable_jemalloc_pgo == "y" ]]; then
  95.         sed -i '/^NO_PROFILE_GUIDED_OPTIMIZE = 1$/d' \
  96.             memory/jemalloc/Makefile.in
  97.       fi
  98.       echo 'LDFLAGS += -lX11 -lXrender' \
  99.           >> layout/build/Makefile.in
  100.  
  101.       if [ "${CARCH}" = "x86_64" ]; then
  102.         make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
  103.       fi
  104.  
  105.       LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX -screen 0 1280x1024x24 :99 &
  106.       LD_PRELOAD="" DISPLAY=:99 make -j1 -f client.mk profiledbuild MOZ_MAKE_FLAGS="$MAKEFLAGS"
  107.       kill $! || true
  108.   else
  109.       make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
  110.   fi
  111.  
  112. }
  113.  
  114. package() {
  115.   cd mozilla-release
  116.   make -j1 -f client.mk DESTDIR="$pkgdir" install
  117.  
  118.   install -m644 ../vendor.js "$pkgdir/usr/lib/firefox/defaults/pref"
  119.  
  120.   for i in 16 22 24 32 48 256; do
  121.       install -Dm644 browser/branding/official/default$i.png \
  122.         "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png"
  123.   done
  124.  
  125.   install -Dm644 ../firefox.desktop \
  126.     "$pkgdir/usr/share/applications/firefox.desktop"
  127.  
  128.   # Use system-provided dictionaries
  129.   rm -rf "$pkgdir"/usr/lib/firefox/{dictionaries,hyphenation}
  130.   ln -s /usr/share/hunspell "$pkgdir/usr/lib/firefox/dictionaries"
  131.   ln -s /usr/share/hyphen "$pkgdir/usr/lib/firefox/hyphenation"
  132.  
  133.   # We don't want the development stuff
  134.   rm -r "$pkgdir"/usr/{include,lib/firefox-devel,share/idl}
  135.  
  136.   #workaround for now
  137.   #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  138.   ln -sf firefox "$pkgdir/usr/lib/firefox/firefox-bin"
  139. }
  140.  
  141. md5sums=('f50ca7656eec47030b396f39075fa980'
  142.          'ff77c91b4bdeb0204ffa33c0957b11c1'
  143.          '84fa853f0a821c46ce0396af7c897c9f'
  144.          '1df7fd9afd75d06decb129518a769133'
  145.          '1e4bcac59e93d21fffa6a1d1ad235247'
  146.          '0d053487907de4376d67d8f499c5502b'
  147.          '75df0f88cc7a7fa7d522459e4ff82cc5'
  148.          '6e7b4f2554beacb998bbce3f0e184584'
  149.          'ea852561bc568922b25548c8d5367aee'
  150.          '90cc234d848a2060abc6a007622e1af7'
  151.          '8b0ecfdf697485d7b7dd26291c0dc478'
  152.          '4ab126609ed4362c298b5c59aa3d25c7')
clone this paste RAW Paste Data