updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / chromium15 / PKGBUILD
blob3af93fdfeab40c172ce20b0e4636be91d15b40b5
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
5 # target architecture.
6 # macau: fix v15.x for armhf building
8 plugrel=2
9 noautobuild=1
11 pkgname=chromium15
12 pkgver=15.0.858.0
13 pkgrel=1
14 _buildtype=Release
15 test "x${DEBUG}" = "xyes" && _buildtype=Debug
16 pkgdesc='The open-source project behind Google Chrome (Dev channel)'
17 arch=('armv7h')
18 url='http://www.chromium.org/'
19 license=('BSD')
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')
26 options=()
27 test ${_buildtype} = Debug && options[${#options[@]}]=!strip
28 install="${pkgname}.install"
29 source=(http://build.chromium.org/official/chromium-${pkgver}.tar.bz2
30         ${pkgname}.desktop 
31         ${pkgname}.sh)
32 md5sums=('c36aa5e0c97050a27208a83810230411'
33         '7547bf60abed76fa2d3c314ceb9a4865'
34         '0c526aae227cf26b73160dcfd6a52dbe')
35 _use_gconf=0
37 if test -x /usr/bin/gconftool-2; then
38   _use_gconf=1
39   depends[${#depends[@]}]=gconf
42 build() {
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
49   sed \
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
53   msg2 "Done"
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
62   msg2 "Done"
64   msg "Fixing vpx config"
65   sed s/libvpx.gyp:libvpx/libvpx.gyp:libvpx_include/g -i remoting/remoting.gyp
66   msg2 "Done"
67   
68   msg "Patching Sources Sucessfull"
69   
70   msg "Building Chromium..."
71   chromium_arch=arm
72   GYP_DEFINES="\
73     gcc_version=46 \
74     arm_thumb=1 \
75     no_strict_aliasing=1 \
76     build_ffmpegsumo=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' \
80     disable_nacl=1 \
81     use_system_ffmpeg=0 \
82     use_system_vpx=1 \
83     proprietary_codecs=1 \
84     use_system_libjpeg=1 \
85     use_system_libxslt=1 \
86     use_system_libxml=1 \
87     use_system_bzip2=1 \
88     use_system_zlib=1 \
89     use_system_libpng=1 \
90     use_system_yasm=1 \
91     use_system_libevent=1 \
92     use_system_icu=0 \
93     use_system_ssl=0 \
94     use_gconf=${_use_gconf} \
95     use_cups=0 \
96     werror= \
97     target_arch=${chromium_arch} \
98     linux_use_tcmalloc=0 \
99     armv7=1 \
100     arm_neon=0 \
101     arm_fpu=vfpv3-d16 \
102     enable_webrtc=0 \
103     remoting=0 \
104     disable_sse2=1"
105   test ${_buildtype} = Release \
106     && GYP_DEFINES="${GYP_DEFINES} \
107                     linux_strip_binary=1 \
108                     remove_webcore_debug_symbols=1"
109   export GYP_DEFINES
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..."
114     else
115       msg2 "Configuration has changed, removing output files..."
116       rm -rf out
117     fi
118   fi
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
124 package() {
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"
132   
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]`
137       else
138         f=`echo /usr/lib/lib${n}.so.[0-9][0-9]`
139       fi
140       f=`basename "$f"`
141       ln -s ../$f "${chromium_home}/${f}"
142     done
143   else
144     if test -e out/${_buildtype}/libffmpegsumo.so; then
145       install -Dm644 out/${_buildtype}/libffmpegsumo.so "${chromium_home}/libffmpegsumo.so"
146     fi
147   fi
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"
156   done
157   install -Dm755 ${srcdir}/${pkgname}.sh "${pkgdir}/usr/bin/${pkgname}"
159   install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"