1 # Contributor: Mikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>
2 # Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
4 # ALARM changes were made to the GYP_DEFINES and CFLAGS and to the
6 # macau: fix v15.x for armhf building
15 test "x${DEBUG}" = "xyes" && _buildtype=Debug
16 pkgdesc='The open-source project behind Google Chrome (Dev channel)'
18 url='http://www.chromium.org/'
20 depends=('alsa-lib' 'xdg-utils' 'hicolor-icon-theme' 'bzip2' 'libevent' 'libxss' 'libpng' 'libjpeg' 'cairo' 'dbus-glib'
21 'glib2' 'gtk2' 'nss' 'nspr' 'ffmpeg' 'libvpx' 'libxml2' 'libxslt' 'libxtst' 'icu')
22 makedepends=('git' 'python2' 'gperf' 'yasm' 'mesa' 'gcc>=4.5.0-6' 'libgnome-keyring')
23 optdepends=('libgnome-keyring')
24 replaces=('chromium-dev')
25 conflicts=('chromium-dev')
27 test ${_buildtype} = Debug && options[${#options[@]}]=!strip
28 install="${pkgname}.install"
29 source=(http://build.chromium.org/official/chromium-${pkgver}.tar.bz2
32 md5sums=('c36aa5e0c97050a27208a83810230411'
33 '7547bf60abed76fa2d3c314ceb9a4865'
34 '0c526aae227cf26b73160dcfd6a52dbe')
37 if test -x /usr/bin/gconftool-2; then
39 depends[${#depends[@]}]=gconf
43 cd "${srcdir}/chromium-${pkgver}"
45 msg "Patching sources..."
47 msg "Save configuration in ~/.config/${pkgname}"
48 sed -e "s/'filename': 'chromium-browser'/'filename': '${pkgname}'/" -e "s/'confdir': 'chromium'/'confdir': '${pkgname}'/" -i chrome/chrome_exe.gypi
50 -e "s/config_dir\.Append(\"chromium\")/config_dir.Append(\"${pkgname}\")/" \
51 -e "s/config_dir\.Append(\"chrome-frame\")/config_dir.Append(\"chrome-frame-${pkgname#chromium-}\")/" \
52 -i chrome/common/chrome_paths_linux.cc
55 msg "Force usage of python2"
56 #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|' {} \;
57 #find -type f -a -name '*.gyp*' -exec sed -i -e 's|<!(python |<!(python2 |g' -e "s|'python'|'python2'|g" {} \;
58 rm -rf "${srcdir}"/python
59 mkdir "${srcdir}"/python
60 ln -s /usr/bin/python2 "${srcdir}"/python/python
61 export PATH="${srcdir}"/python:$PATH
64 msg "Fixing vpx config"
65 sed s/libvpx.gyp:libvpx/libvpx.gyp:libvpx_include/g -i remoting/remoting.gyp
68 msg "Patching Sources Sucessfull"
70 msg "Building Chromium..."
75 no_strict_aliasing=1 \
77 linux_sandbox_path=/usr/lib/${pkgname}/chromium-sandbox \
78 linux_sandbox_chrome_path=/usr/lib/${pkgname}/chromium \
79 release_extra_cflags='${CFLAGS} -lvpx -I/usr/include -DUSE_EABI_HARDFLOAT -Wno-error=unused-but-set-variable' \
83 proprietary_codecs=1 \
84 use_system_libjpeg=1 \
85 use_system_libxslt=1 \
91 use_system_libevent=1 \
94 use_gconf=${_use_gconf} \
97 target_arch=${chromium_arch} \
98 linux_use_tcmalloc=0 \
105 test ${_buildtype} = Release \
106 && GYP_DEFINES="${GYP_DEFINES} \
107 linux_strip_binary=1 \
108 remove_webcore_debug_symbols=1"
110 echo "${pkgver} ${GYP_DEFINES}" > current.config
111 if test -f "last.config"; then
112 if cmp last.config current.config; then
113 msg2 "Configuration has not changed, reusing output files..."
115 msg2 "Configuration has changed, removing output files..."
119 mv current.config last.config
120 python2 build/gyp_chromium -f make --depth=. build/all.gyp -d general
121 make BUILDTYPE=${_buildtype} ${MAKEFLAGS} chrome chrome_sandbox
125 cd "${srcdir}/chromium-${pkgver}"
127 chromium_home="${pkgdir}/usr/lib/${pkgname}"
128 install -Dm755 -D out/${_buildtype}/chrome "${chromium_home}/chromium"
129 install -Dm4555 -o root -g root -D out/${_buildtype}/chrome_sandbox "${chromium_home}/chromium-sandbox"
130 install -Dm644 out/${_buildtype}/chrome.pak "${chromium_home}/chrome.pak"
131 install -Dm644 out/${_buildtype}/resources.pak "${chromium_home}/resources.pak"
133 if test ${_use_ffmpeg_system_libs} = 1; then
134 for n in avcodec avdevice avfilter avformat avutil postproc swscale; do
135 if test -e /usr/lib/lib${n}.so.[0-9]; then
136 f=`echo /usr/lib/lib${n}.so.[0-9]`
138 f=`echo /usr/lib/lib${n}.so.[0-9][0-9]`
141 ln -s ../$f "${chromium_home}/${f}"
144 if test -e out/${_buildtype}/libffmpegsumo.so; then
145 install -Dm644 out/${_buildtype}/libffmpegsumo.so "${chromium_home}/libffmpegsumo.so"
149 cp -a out/${_buildtype}/locales out/${_buildtype}/resources "${chromium_home}/"
150 find "${chromium_home}" -type f -name '*.d' -delete
151 install -Dm644 out/${_buildtype}/chrome.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
153 install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
154 for size in 16 22 24 32 48 128 256; do
155 install -Dm644 chrome/app/theme/chromium/product_logo_${size}.png "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/${pkgname}.png"
157 install -Dm755 ${srcdir}/${pkgname}.sh "${pkgdir}/usr/bin/${pkgname}"
159 install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"