Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

chromium-browser-svn

By: a guest on Aug 23rd, 2011  |  syntax: Bash  |  size: 7.77 KB  |  views: 143  |  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: piojo <aur at zwell dot net>
  2. # Maintainer:  MiakoMiyamura <miyamiyamura at gmail dot com>
  3.  
  4. pkgname=chromium-browser-svn
  5. pkgrel=67
  6. pkgdesc='An open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web'
  7. arch=('i686' 'x86_64')
  8. url='http://www.chromium.org'
  9. license=('BSD')
  10. depends=('alsa-lib' 'bzip2' 'ffmpeg' 'gconf' 'hicolor-icon-theme' 'icu' 'libevent' 'libxss' 'libxslt' 'nss' 'speex' 'xdg-utils')
  11. makedepends=('subversion' 'perl' 'python2' 'gperf>=3.0.3' 'rsync' 'libgnome-keyring' 'yasm' 'mesa')
  12. provides=('chromium-browser')
  13. conflicts=('chromium-browser')
  14. source=( 'chromium.desktop'
  15.          '.gclient'
  16.          'chromium-browser.sh'
  17.        )
  18. install='chromium.install'
  19. md5sums=( 'b9849a247ca75c2def39d7f63762dc48'
  20.           '42654e72df052e0ec064e1ab3deab0e2'
  21.           '2178331349c6ee8f8300bf71d585dc6d'
  22.         )
  23.  
  24. # Change this to "trunk" or some other revision number to get that
  25. # version instead of the "safe sync" version:
  26. _revision=
  27. _builddir="${srcdir}"/builddir
  28.  
  29. _svntrunk_gclient=http://src.chromium.org/svn/trunk/tools/depot_tools
  30. _gclient="${srcdir}"/depot_tools
  31.  
  32. build() {
  33.     if [ "x$CHROMIUM_WATERFALL_REMINDER" != x ]; then
  34.         read -p "Remember to check http://build.chromium.org/buildbot/waterfall/console"
  35.     fi
  36.    
  37.     cd "${srcdir}"
  38.     _source ||
  39.         { msg "Failed to download gclient and chromium sources"; return 1; }
  40.     python2 src/build/download_nacl_irt.py
  41.     _setup_builddir ||
  42.         { msg "Failed to make a copy of the build dir."
  43.           msg" Are you out of disk space?"; return 1; }
  44.    
  45.     msg "Preparing build of Chromium revision ${pkgver}..."
  46.     cd "${_builddir}"
  47.    
  48.     # Write out corrrect revision number in 'About Chromium'
  49.     _revision > build/LASTCHANGE.in || return 1
  50.    
  51.     # see http://code.google.com/p/chromium/issues/detail?id=41887
  52.     export CXXFLAGS="${CXXFLAGS} -fno-ipa-cp"
  53.     export GYP_GENERATORS='make'
  54.     export GYP_DEFINES="
  55.     gcc_version=46
  56.     no_strict_aliasing=1
  57.     linux_sandbox_path=/usr/lib/chromium/chromium-sandbox
  58.     linux_strip_binary=1
  59.     proprietary_codecs=1
  60.     remove_webcore_debug_symbols=1
  61.     use_system_bzip2=1
  62.     use_system_ffmpeg=0
  63.     use_system_icu=0
  64.     use_system_libevent=1
  65.     use_system_libjpeg=1
  66.     use_system_libpng=1
  67.     use_system_libxml=1
  68.     use_system_libxslt=1
  69.     use_system_speex=1
  70.     use_system_ssl=0
  71.     use_system_vpx=1
  72.     use_system_yasm=1
  73.     use_system_zlib=1
  74.     werror=
  75.    "
  76.    
  77.     if [ "${_shared_build}" = "true" ]; then
  78.         msg "Preparing a shared build..."
  79.         GYP_DEFINES="${GYP_DEFINES} library=shared_library"
  80.     fi
  81.    
  82.     if [ "${CARCH}" = 'x86_64' ]; then
  83.         # 64-bit instructions from
  84.         # http://code.google.com/p/chromium/wiki/LinuxBuildInstructions
  85.         GYP_DEFINES="${GYP_DEFINES} target_arch=x64"
  86.     fi
  87.  
  88.     msg "Running gyp in builddir using these settings: "
  89.     echo ${GYP_DEFINES}
  90.     build/gyp_chromium -f make build/all.gyp --depth=. || return 1
  91.    
  92.     msg "Now starting build..."
  93.     make ${MAKEFLAGS} BUILDTYPE=Release V=1 chrome chrome_sandbox || return 1
  94.  }
  95.  
  96. _source() {
  97.     msg "Checking out gclient..."
  98.     rm -rf "${_gclient}"
  99.     svn co ${_svntrunk_gclient} --config-dir ./ "${_gclient}" || return 1
  100.     find "${_gclient}" -type f -print0 | xargs -0 sed -i 's$\/usr\/bin\/python$'"${srcdir}"'\/python\/python$g'
  101.  
  102.     # Arch uses python3 by default, so we want Python in $PATH to point to python2
  103.     rm -rf "${srcdir}"/python
  104.     mkdir "${srcdir}"/python
  105.     ln -s /usr/bin/python2 "${srcdir}"/python/python
  106.     export PATH="${srcdir}"/python:$PATH
  107.    
  108.     # There have been complaints about Google's servers closing connections:
  109.     msg "Downloading Chromium's sources."
  110.     msg "Will retry up to 5 times; press ctrl-c to abort."
  111.     for n in {1..5}; do
  112.         python2 "${_gclient}"/gclient.py sync --force --nohooks --revision "src@${_revision}" && break
  113.     done
  114.    
  115.     if test $? -ne 0; then
  116.         return 1
  117.     fi
  118. }
  119.  
  120. _setup_builddir() {
  121.     # Always prepare a new, clean && save environment... ;-)
  122.     # This technique will prevent the above "patch" invocations from
  123.     # failing (when the source/build directory has already been patched),
  124.     # but it's wasteful of disk space.
  125.     _exclude_dirs="
  126.    --exclude=.svn
  127.    --exclude=gears
  128.    --exclude=chrome/test/data
  129.    --exclude=chrome/tools/test/reference_build
  130.    --exclude=chrome_frame
  131.    --exclude=net/data/cache_tests
  132.    --exclude=o3d/documentation
  133.    --exclude=o3d/samples
  134.    --exclude=third_party/active_doc
  135.    --exclude=third_party/activscp
  136.    --exclude=third_party/apple
  137.    --exclude=third_party/apple_apsl
  138.    --exclude=third_party/bidichecker
  139.    --exclude=third_party/harfbuzz-ng
  140.    --exclude=third_party/hyphen
  141.    --exclude=third_party/lighttpd
  142.    --exclude=third_party/WebKit/LayoutTests
  143.    --exclude=webkit/data/layout_tests
  144.    --exclude=webkit/tools/test/reference_build
  145.    "
  146.    
  147.     msg "Syncing local build directory (can take a while)..."
  148.     rsync -rlpgo --delete ${_exclude_dirs} "${srcdir}"/src/ "${_builddir}" || return 1
  149.     msg "Replacing Python interpreter in ${_builddir} (can take a while)..."
  150.     find "${_builddir}" -type f -print0 | xargs -0 sed -i 's$\/usr\/bin\/python$'"${srcdir}"'\/python\/python$g'
  151.  
  152.     cd "${_builddir}"
  153. }
  154.  
  155. _revision() {
  156.     LC_ALL=C svn info "${srcdir}"/src/ | awk '/Revision/ {print $2}'
  157. }
  158.  
  159. package() {
  160.     msg "Installing Chromium to ${pkgdir}..."
  161.     cd "${_builddir}"
  162.     _revision
  163.     pkgver=$(_revision)
  164.    
  165.     install -m 0755 -D \
  166.         out/Release/chrome \
  167.         "${pkgdir}"/usr/lib/chromium/chromium
  168.  
  169.     install -m 4555 -o root -g root -D \
  170.         out/Release/chrome_sandbox \
  171.         "${pkgdir}"/usr/lib/chromium/chromium-sandbox
  172.  
  173.     install -m 0644 -D \
  174.         out/Release/chrome.pak \
  175.         "${pkgdir}"/usr/lib/chromium/chrome.pak
  176.    
  177.     install -m 0644 -D \
  178.         out/Release/resources.pak \
  179.             "${pkgdir}"/usr/lib/chromium/resources.pak
  180.    
  181.     cp -a out/Release/locales \
  182.         "${pkgdir}"/usr/lib/chromium/
  183.     cp -a out/Release/resources \
  184.         "${pkgdir}"/usr/lib/chromium/
  185.    
  186.     find "${pkgdir}"/usr/lib/chromium/ -name '*.d' -type f -delete
  187.    
  188.     # ln -s /usr/lib/libavcodec.so.52 \
  189.     #    "${pkgdir}"/usr/lib/chromium/libavcodec.so.52
  190.     # ln -s /usr/lib/libavformat.so.52 \
  191.     #     "${pkgdir}"/usr/lib/chromium/libavformat.so.52
  192.     # ln -s /usr/lib/libavutil.so.50 \
  193.     #     "${pkgdir}"/usr/lib/chromium/libavutil.so.50
  194.  
  195.      install -m 0755 -D \
  196.         out/Release/libffmpegsumo.so \
  197.         "${pkgdir}"/usr/lib/chromium/libffmpegsumo.so
  198.  
  199.     # Native Client
  200.     install -m 0775 out/Release/libppGoogleNaClPluginChrome.so \
  201.         "${pkgdir}"/usr/lib/chromium/libppGoogleNaClPluginChrome.so
  202.     install -m 664 out/Release/nacl_irt_x86_64.nexe \
  203.         "${pkgdir}"/usr/lib/chromium/nacl_irt_x86_64.nexe
  204.  
  205.    
  206.         install -m 0644 -D \
  207.         out/Release/chrome.1 \
  208.         "${pkgdir}"/usr/share/man/man1/chromium.1
  209.    
  210.     install -m 0644 -D \
  211.         LICENSE \
  212.         "${pkgdir}"/usr/share/licenses/chromium/LICENSE
  213.    
  214.         install -m 0644 -D \
  215.         "${srcdir}"/chromium.desktop \
  216.         "${pkgdir}"/usr/share/applications/chromium.desktop
  217.    
  218.     install -m 0755 -D \
  219.         "${srcdir}"/chromium-browser.sh \
  220.         "${pkgdir}"/usr/bin/chromium
  221.    
  222.     for size in 16 22 24 32 48 128 256; do
  223.         install -m 0644 -D \
  224.             chrome/app/theme/chromium/product_logo_${size}.png \
  225.             "${pkgdir}"/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png
  226.         done
  227. }
  228.  
  229. # This pkgver is for aur.archlinux.org and tools that quickly parse this
  230. # PKGBUILD. The true version is set within _revision().
  231. pkgver=2011