Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 22nd, 2010  |  syntax: Bash  |  size: 5.64 KB  |  hits: 58  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Mikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>
  2. pkgname=chromium-dev
  3. pkgver=10.0.612.3   # Check for new Dev Channel (Linux) releases in: http://googlechromereleases.blogspot.com/
  4. pkgrel=1
  5. _buildtype=Release  # The two available build types are 'Release' and 'Debug'. See e.g.:
  6.                     # http://wiki.answers.com/Q/Difference_between_debug_mode_and_release_mode
  7. test "x${DEBUG}" = "xyes" && _buildtype=Debug
  8. pkgdesc='The open-source project behind Google Chrome (Dev channel)'
  9. arch=('i686' 'x86_64')
  10. url='http://www.chromium.org/'
  11. license=('BSD')
  12. depends=('alsa-lib' 'xdg-utils' 'hicolor-icon-theme' 'bzip2' 'libevent' 'libxss'
  13.          'libpng' 'libjpeg' 'cairo' 'dbus-glib' 'glib2' 'gtk2' 'nss' 'nspr' 'ffmpeg'
  14.          'libvpx' 'libxml2' 'libxslt' 'libxtst')
  15. makedepends=('python2' 'gperf' 'yasm' 'mesa' 'gcc>=4.5.0-6' 'libgnome-keyring')
  16. optdepends=('libgnome-keyring' 'flashplugin' 'moonlight' 'gecko-mediaplayer')
  17. options=()     # Put your custom compile options here
  18. [ "${_buildtype}" = "Debug" ] && options=(${options[*]} '!strip')
  19. install="${pkgname}.install"
  20. source=(http://build.chromium.org/buildbot/official/chromium-${pkgver}.tar.bz2
  21.         "${pkgname}.desktop" "${pkgname}.sh"
  22.         ffmpeg-gyp-vpx.patch
  23.         webkit-debug-build.patch)
  24. md5sums=('a40ce353d3572c09a183a85f2508139d'
  25.          'a9356c9d15ae6aa96ed69650cc7879a7'
  26.          'eaeaf4a71707d8a767be9a7d467bb809'
  27.          '13f1d9302560a04268427bf0c2db021f'
  28.          'd736bcccedbe7ab66fffe7d5e0020bfc')
  29. _use_gconf=0
  30. test -x /usr/bin/gconftool-2 && _use_gconf=1 && depends[${#depends[@]}]=gconf
  31.  
  32. build() {
  33.   cd chromium-${pkgver}
  34.  
  35.   msg2 "Patching sources..."
  36.   # see http://code.google.com/p/chromium/issues/detail?id=41887
  37.   sed \
  38.     -e 's/url->insert(start/url->replace(start, 0/' \
  39.     -e 's/url\.insert(i->index/url.replace(i->index, 0/' \
  40.     -i chrome/browser/search_engines/template_url.cc
  41.   # save configuration in ~/.config/${pkgname}
  42.   sed \
  43.     -e "s/'filename': 'chromium-browser'/'filename': '${pkgname}'/" \
  44.     -e "s/'confdir': 'chromium'/'confdir': '${pkgname}'/" \
  45.     -i chrome/chrome_exe.gypi
  46.   sed \
  47.     -e "s/config_dir\.Append(\"chromium\")/config_dir.Append(\"${pkgname}\")/" \
  48.     -e "s/config_dir\.Append(\"chrome-frame\")/config_dir.Append(\"chrome-frame-${pkgname#chromium-}\")/" \
  49.     -i chrome/common/chrome_paths_linux.cc
  50.   # see http://code.google.com/p/chromium/issues/detail?id=26496
  51.   patch -p1 -i "${srcdir}/webkit-debug-build.patch"
  52.   # see http://code.google.com/p/chromium/issues/detail?id=61759
  53.   patch -p1 -i "${srcdir}/ffmpeg-gyp-vpx.patch"
  54.   # force usage of python2
  55.   find -type f -a -name '*.py' -exec sed -i \
  56.     -e 's|#![ ]*/usr/bin/python$|#!/usr/bin/python2|' \
  57.     -e 's|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' {} \;
  58.   find -type f -a -name '*.gyp*' -exec sed -i \
  59.     -e 's|<!(python |<!(python2 |g' \
  60.     -e "s|'python'|'python2'|g" {} \;
  61.  
  62.   msg2 "Building Chromium..."
  63.   chromium_arch=ia32
  64.   test "$CARCH" = "x86_64" && chromium_arch=x64
  65.   GYP_DEFINES="\
  66.    gcc_version=44 \
  67.    werror= \
  68.    no_strict_aliasing=1 \
  69.    linux_sandbox_path=/usr/lib/${pkgname}/chromium-sandbox \
  70.    linux_sandbox_chrome_path=/usr/lib/${pkgname}/chromium \
  71.    release_extra_cflags='${CFLAGS}' \
  72.    use_system_ffmpeg=1 \
  73.    use_system_vpx=1 \
  74.    proprietary_codecs=1 \
  75.    use_system_libjpeg=1 \
  76.    use_system_libxslt=1 \
  77.    use_system_libxml=1 \
  78.    use_system_bzip2=1 \
  79.    use_system_zlib=1 \
  80.    use_system_libpng=1 \
  81.    use_system_yasm=1 \
  82.    use_system_libevent=1 \
  83.    use_system_ssl=0 \
  84.    use_gconf=${_use_gconf} \
  85.    target_arch=${chromium_arch} \
  86.    disable_sse2=1"
  87.   test ${_buildtype} = Release \
  88.     && GYP_DEFINES="${GYP_DEFINES} \
  89.                    linux_strip_binary=1 \
  90.                    remove_webcore_debug_symbols=1"
  91.   export GYP_DEFINES
  92.   echo "${pkgver} ${GYP_DEFINES}" > current.config
  93.   if test -f "last.config" && cmp last.config current.config; then
  94.       msg2 "Configuration has not changed, reusing output files..."
  95.     else
  96.       msg2 "Configuration has changed, removing output files..."
  97.       rm -rf out
  98.   fi
  99.   mv current.config last.config
  100.   python2 build/gyp_chromium -f make --depth=. build/all.gyp
  101.   make BUILDTYPE=${_buildtype} chrome chrome_sandbox
  102. }
  103.  
  104. package() {
  105.   cd chromium-${pkgver}
  106.  
  107.   chromium_home="${pkgdir}/usr/lib/${pkgname}"
  108.   install -Dm755 -D out/${_buildtype}/chrome "${chromium_home}/chromium"
  109.   install -Dm4555 -o root -g root -D out/${_buildtype}/chrome_sandbox \
  110.     "${chromium_home}/chromium-sandbox"
  111.   install -Dm644 out/${_buildtype}/chrome.pak "${chromium_home}/chrome.pak"
  112.   install -Dm644 out/${_buildtype}/resources.pak "${chromium_home}/resources.pak"
  113.   for n in avcodec avdevice avfilter avformat avutil postproc swscale; do
  114.     if test -e /usr/lib/lib${n}.so.[0-9]; then
  115.       f=`echo /usr/lib/lib${n}.so.[0-9]`
  116.     else
  117.       f=`echo /usr/lib/lib${n}.so.[0-9][0-9]`
  118.     fi
  119.     f=`basename "$f"`
  120.     ln -s ../$f "${chromium_home}/${f}"
  121.   done
  122.   cp -a out/${_buildtype}/locales out/${_buildtype}/resources "${chromium_home}/"
  123.   find "${chromium_home}" -type f -name '*.d' -delete
  124.   install -Dm644 out/${_buildtype}/chrome.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
  125.  
  126.   install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  127.   for size in 16 22 24 32 48 64 128 256; do
  128.     install -Dm644 chrome/app/theme/chromium/product_logo_${size}.png \
  129.       "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/${pkgname}.png"
  130.   done
  131.   install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
  132.  
  133.   install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  134. }