# Maintainer: Mikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>
pkgname=chromium-dev
pkgver=10.0.612.3 # Check for new Dev Channel (Linux) releases in: http://googlechromereleases.blogspot.com/
pkgrel=1
_buildtype=Release # The two available build types are 'Release' and 'Debug'. See e.g.:
# http://wiki.answers.com/Q/Difference_between_debug_mode_and_release_mode
test "x${DEBUG}" = "xyes" && _buildtype=Debug
pkgdesc='The open-source project behind Google Chrome (Dev channel)'
arch=('i686' 'x86_64')
url='http://www.chromium.org/'
license=('BSD')
depends=('alsa-lib' 'xdg-utils' 'hicolor-icon-theme' 'bzip2' 'libevent' 'libxss'
'libpng' 'libjpeg' 'cairo' 'dbus-glib' 'glib2' 'gtk2' 'nss' 'nspr' 'ffmpeg'
'libvpx' 'libxml2' 'libxslt' 'libxtst')
makedepends=('python2' 'gperf' 'yasm' 'mesa' 'gcc>=4.5.0-6' 'libgnome-keyring')
optdepends=('libgnome-keyring' 'flashplugin' 'moonlight' 'gecko-mediaplayer')
options=() # Put your custom compile options here
[ "${_buildtype}" = "Debug" ] && options=(${options[*]} '!strip')
install="${pkgname}.install"
source=(http://build.chromium.org/buildbot/official/chromium-${pkgver}.tar.bz2
"${pkgname}.desktop" "${pkgname}.sh"
ffmpeg-gyp-vpx.patch
webkit-debug-build.patch)
md5sums=('a40ce353d3572c09a183a85f2508139d'
'a9356c9d15ae6aa96ed69650cc7879a7'
'eaeaf4a71707d8a767be9a7d467bb809'
'13f1d9302560a04268427bf0c2db021f'
'd736bcccedbe7ab66fffe7d5e0020bfc')
_use_gconf=0
test -x /usr/bin/gconftool-2 && _use_gconf=1 && depends[${#depends[@]}]=gconf
build() {
cd chromium-${pkgver}
msg2 "Patching sources..."
# see http://code.google.com/p/chromium/issues/detail?id=41887
sed \
-e 's/url->insert(start/url->replace(start, 0/' \
-e 's/url\.insert(i->index/url.replace(i->index, 0/' \
-i chrome/browser/search_engines/template_url.cc
# save configuration in ~/.config/${pkgname}
sed \
-e "s/'filename': 'chromium-browser'/'filename': '${pkgname}'/" \
-e "s/'confdir': 'chromium'/'confdir': '${pkgname}'/" \
-i chrome/chrome_exe.gypi
sed \
-e "s/config_dir\.Append(\"chromium\")/config_dir.Append(\"${pkgname}\")/" \
-e "s/config_dir\.Append(\"chrome-frame\")/config_dir.Append(\"chrome-frame-${pkgname#chromium-}\")/" \
-i chrome/common/chrome_paths_linux.cc
# see http://code.google.com/p/chromium/issues/detail?id=26496
patch -p1 -i "${srcdir}/webkit-debug-build.patch"
# see http://code.google.com/p/chromium/issues/detail?id=61759
patch -p1 -i "${srcdir}/ffmpeg-gyp-vpx.patch"
# force usage of python2
find -type f -a -name '*.py' -exec sed -i \
-e 's|#![ ]*/usr/bin/python$|#!/usr/bin/python2|' \
-e 's|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' {} \;
find -type f -a -name '*.gyp*' -exec sed -i \
-e 's|<!(python |<!(python2 |g' \
-e "s|'python'|'python2'|g" {} \;
msg2 "Building Chromium..."
chromium_arch=ia32
test "$CARCH" = "x86_64" && chromium_arch=x64
GYP_DEFINES="\
gcc_version=44 \
werror= \
no_strict_aliasing=1 \
linux_sandbox_path=/usr/lib/${pkgname}/chromium-sandbox \
linux_sandbox_chrome_path=/usr/lib/${pkgname}/chromium \
release_extra_cflags='${CFLAGS}' \
use_system_ffmpeg=1 \
use_system_vpx=1 \
proprietary_codecs=1 \
use_system_libjpeg=1 \
use_system_libxslt=1 \
use_system_libxml=1 \
use_system_bzip2=1 \
use_system_zlib=1 \
use_system_libpng=1 \
use_system_yasm=1 \
use_system_libevent=1 \
use_system_ssl=0 \
use_gconf=${_use_gconf} \
target_arch=${chromium_arch} \
disable_sse2=1"
test ${_buildtype} = Release \
&& GYP_DEFINES="${GYP_DEFINES} \
linux_strip_binary=1 \
remove_webcore_debug_symbols=1"
export GYP_DEFINES
echo "${pkgver} ${GYP_DEFINES}" > current.config
if test -f "last.config" && cmp last.config current.config; then
msg2 "Configuration has not changed, reusing output files..."
else
msg2 "Configuration has changed, removing output files..."
rm -rf out
fi
mv current.config last.config
python2 build/gyp_chromium -f make --depth=. build/all.gyp
make BUILDTYPE=${_buildtype} chrome chrome_sandbox
}
package() {
cd chromium-${pkgver}
chromium_home="${pkgdir}/usr/lib/${pkgname}"
install -Dm755 -D out/${_buildtype}/chrome "${chromium_home}/chromium"
install -Dm4555 -o root -g root -D out/${_buildtype}/chrome_sandbox \
"${chromium_home}/chromium-sandbox"
install -Dm644 out/${_buildtype}/chrome.pak "${chromium_home}/chrome.pak"
install -Dm644 out/${_buildtype}/resources.pak "${chromium_home}/resources.pak"
for n in avcodec avdevice avfilter avformat avutil postproc swscale; do
if test -e /usr/lib/lib${n}.so.[0-9]; then
f=`echo /usr/lib/lib${n}.so.[0-9]`
else
f=`echo /usr/lib/lib${n}.so.[0-9][0-9]`
fi
f=`basename "$f"`
ln -s ../$f "${chromium_home}/${f}"
done
cp -a out/${_buildtype}/locales out/${_buildtype}/resources "${chromium_home}/"
find "${chromium_home}" -type f -name '*.d' -delete
install -Dm644 out/${_buildtype}/chrome.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
for size in 16 22 24 32 48 64 128 256; do
install -Dm644 chrome/app/theme/chromium/product_logo_${size}.png \
"${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/${pkgname}.png"
done
install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}