gtk/chromium/PKGBUILD
2014-12-13 23:11:14 +00:00

189 lines
6.7 KiB
Bash

#
# Chakra Packages for Chakra, part of chakra-project.org
#
pkgname=chromium
pkgver=39.0.2171.95
pkgrel=1
_verbld=${pkgver}-1 # used for pepper-flash
_pepperflashver=16.0.0.235
pkgdesc="The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser. Include PepperFlash and libpdf plugins"
arch=('x86_64')
url="http://www.chromium.org/"
license=('BSD')
depends=('gtk2' 'dbus-glib' 'nss' 'alsa-lib' 'xdg-utils' 'bzip2' 'libevent' 'libxss' 'libgcrypt' 'ttf-dejavu' 'dbus' 'desktop-file-utils' 'hicolor-icon-theme' 'systemd' 'speech-dispatcher' 'flac' 'opus' 'libxml2' 'libpulse' 'icu' 'zlib' 'harfbuzz' 'glib2' 'libexif')
makedepends=('python2' 'perl' 'gperf' 'yasm' 'mesa' 'libgnome-keyring' 'elfutils' 'lib32-gcc-libs' 'subversion' 'ninja' 'clang')
install=chromium.install
source=(http://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${pkgver}.tar.xz
#http://dl.google.com/linux/chrome/rpm/stable/${CARCH}/google-chrome-stable-${_verbld}.x86_64.rpm
https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
license.html::http://www.google.com/chrome/intl/en/eula_text.html
chromium.desktop
chromium.sh
chromium.default
template_url_prepopulate_data.diff
search_engine_type.diff
prepopulated_engines_json.diff)
sha1sums=('fa6c4d5d9b5817578dc55b9273e9ae623fed5ff0'
'66b59c537b4cc835183a9521fc301e6048954c0a'
'f78c3d5f420d52460b2d59f7c47e32989b3e1780'
'3ab45403f3e8ddfeeba6a5aee9f683d57883fb90'
'19eff765ec1316f4ae057d48919b2fdd6b3a5bea'
'11332bcd0318d573bea1aa0744213a5d006aecc4'
'59b34d1e1070c918fbbe4e81875a1bed6a1c40e3'
'abeb1e424b35bbca954a5afea39418a5e198ac64'
'79fc829d740183d85fb147a3a44e572a8f304dbe')
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Chakra Linux use ONLY. For your own distribution, please
# get your own set of keys.
_google_api_key=AIzaSyA33sdKPff0x3KBByOhpzc1i7RS2A1mEpY
_google_default_client_id=3502044743.apps.googleusercontent.com
_google_default_client_secret=TPvjII_2SwZn_9Ic0kRKqjtG
prepare() {
cd "$srcdir/$pkgname-$pkgver"
# Set DDG as default search
patch -p1 -i "$srcdir/template_url_prepopulate_data.diff"
patch -p1 -i "$srcdir/search_engine_type.diff"
patch -p1 -i "$srcdir/prepopulated_engines_json.diff"
# Download NaCL toolchains
python2 build/download_nacl_toolchains.py \
--packages nacl_x86_newlib,pnacl_newlib,pnacl_translator
}
build() {
cd "$srcdir/$pkgname-$pkgver"
# activate ninja compile method
export GYP_GENERATORS='ninja'
# CFLAGS are passed through release_extra_cflags below
export -n CFLAGS CXXFLAGS
# Build with clang as a temporary solution to startup crash with GCC 4.9
# https://code.google.com/p/chromium/issues/detail?id=412967
export CC=clang
export CXX=clang++
# NOTE
# -Dremove_webcore_debug_symbols=1 speed up the build by removing debug symbols for webkit
local _chromium_conf=(
-Dgoogle_api_key=$_google_api_key
-Dgoogle_default_client_id=$_google_default_client_id
-Dgoogle_default_client_secret=$_google_default_client_secret
-Dwerror=
-Dclang=1
-Dclang_use_chrome_plugins=0
-Dpython_ver=2.7
-Dlinux_link_libpci=1
-Dlinux_link_libspeechd=1
-Dlinux_link_pulseaudio=1
-Dlinux_strip_binary=1
-Dlinux_use_bundled_binutils=0
-Dlinux_use_bundled_gold=0
-Dlinux_use_gold_flags=0
-Dlogging_like_official_build=1
-Drelease_extra_cflags="$CFLAGS"
-Dlibspeechd_h_prefix=speech-dispatcher/
-Dffmpeg_branding=Chrome
-Dproprietary_codecs=1
-Dremove_webcore_debug_symbols=1
-Duse_system_bzip2=1
-Duse_system_flac=1
-Duse_system_ffmpeg=0
-Duse_system_harfbuzz=1
-Duse_system_icu=0
-Duse_system_libevent=1
-Duse_system_libjpeg=1
-Duse_system_libpng=1
-Duse_system_libxml=1
-Duse_system_opus=1
-Duse_system_snappy=0
-Duse_system_ssl=0
-Duse_system_xdg_utils=1
-Duse_system_yasm=1
-Duse_system_zlib=0
-Duse_system_v8=0
-Duse_mojo=0
-Duse_gconf=0
-Dtarget_arch=x64
-Dffmpeg_target_arch=x64
-Ddisable_nacl=0
-Ddisable_glibc=1
-Ddisable_pnacl=0
-Ddisable_newlib_untar=0
-Ddisable_fatal_linker_warnings=1
-Ddisable_sse2=1)
build/linux/unbundle/replace_gyp_files.py "${_chromium_conf[@]}"
#build/gyp_chromium -f make --depth=. "${_chromium_conf[@]}"
build/gyp_chromium build/all.gyp --depth=. "${_chromium_conf[@]}"
#make BUILDTYPE=Release chrome chrome_sandbox
# Build chrome base
ninja -C out/Release chrome
# Build the required SUID_SANDBOX helper
ninja -C out/Release chrome_sandbox
}
package() {
cd "$srcdir/$pkgname-$pkgver"
install -D out/Release/chrome ${pkgdir}/usr/lib/chromium/chromium
install -Dm4755 -o root -g root out/Release/chrome_sandbox \
"$pkgdir/usr/lib/chromium/chrome-sandbox"
cp out/Release/{*.pak,libffmpegsumo.so,nacl_helper{,_bootstrap}} \
out/Release/nacl_irt_*.nexe \
out/Release/libpdf.so \
"$pkgdir/usr/lib/chromium/"
# Manually strip binaries so that 'nacl_irt_*.nexe' is left intact
strip $STRIP_BINARIES "$pkgdir/usr/lib/chromium/"{chromium,chrome-sandbox} \
"$pkgdir/usr/lib/chromium/"nacl_helper{,_bootstrap}
strip $STRIP_SHARED "$pkgdir/usr/lib/chromium/libffmpegsumo.so" \
"$pkgdir/usr/lib/chromium/libpdf.so"
# override command-line options
install -Dm644 "$srcdir/chromium.default" "$pkgdir/etc/chromium/default"
cp -a out/Release/locales out/Release/icudtl.dat "$pkgdir/usr/lib/chromium/"
find "$pkgdir/usr/lib/chromium/" -name '*.d' -type f -delete
install -Dm644 out/Release/chrome.1 "$pkgdir/usr/share/man/man1/chromium.1"
install -Dm644 "$srcdir/chromium.desktop" \
"$pkgdir/usr/share/applications/chromium.desktop"
for size in 22 24 48 64 128 256; do
install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
done
for size in 16 32; do
install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
done
install -D "$srcdir/chromium.sh" "$pkgdir/usr/bin/chromium"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
#### PepperFlash ####
cd "$srcdir"
install -d "$pkgdir/usr/lib/PepperFlash"
install -m644 opt/google/chrome/PepperFlash/* "$pkgdir/usr/lib/PepperFlash"
sed -i "s/flashver=.*/flashver=$_pepperflashver/" "$startdir/chromium.install"
install -Dm644 "$srcdir/license.html" "$pkgdir/usr/share/licenses/$pkgname/license.html"
}