gtk/chromium/PKGBUILD

191 lines
8.0 KiB
Bash
Raw Normal View History

2013-04-29 02:49:39 +08:00
#
# Chakra Packages for Chakra, part of chakra-project.org
#
pkgname=chromium
pkgver=30.0.1599.101
pkgrel=1
_verbld=${pkgver}-1 # used for libpdf and pepper-flash
_pepperflashver=11.9.900.117
_toolchains_rev=12029
pkgdesc="The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser. Include PepperFlash and libpdf plugins"
2013-04-29 02:49:39 +08:00
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' 'v8' 'zlib' 'lib32-gcc-libs' 'filesystem-extra')
makedepends=('python2' 'perl' 'gperf' 'yasm' 'mesa' 'libgnome-keyring' 'elfutils' 'subversion' 'ninja')
2013-04-29 02:49:39 +08:00
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
license.html::http://www.google.com/chrome/intl/en/eula_text.html
naclsdk_nacl_linux_x86-$_toolchains_rev.tgz::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_toolchains_rev/naclsdk_linux_x86.tgz
naclsdk_pnacl_linux_x86-$_toolchains_rev.tgz::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_toolchains_rev/naclsdk_pnacl_linux_x86.tgz
naclsdk_pnacl_translator-$_toolchains_rev.tgz::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_toolchains_rev/naclsdk_pnacl_translator.tgz
naclsdk_pnacl_translator-$_toolchains_rev.tgz.sha1hash::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_toolchains_rev/naclsdk_pnacl_translator.tgz.sha1hash
toolchain_linux_x86-$_toolchains_rev.tar.bz2::https://commondatastorage.googleapis.com/nativeclient-archive2/x86_toolchain/r$_toolchains_rev/toolchain_linux_x86.tar.bz2
2013-04-29 02:49:39 +08:00
chromium.desktop
chromium.sh
chromium.default
template_url_prepopulate_data.diff
search_engine_type.diff
prepopulated_engines_json.diff
chromium-system-icu-r0.patch)
noextract=(naclsdk_nacl_linux_x86-$_toolchains_rev.tgz
naclsdk_pnacl_linux_x86-$_toolchains_rev.tgz
naclsdk_pnacl_translator-$_toolchains_rev.tgz
toolchain_linux_x86-$_toolchains_rev.tar.bz2)
sha1sums=('141c29c614574ec24992c620e7e49c4e89e5b73b'
'4c8049b1f68a284e3101e657d7d8149342e73f8b'
'cdda47faa791d56089f92854957070b1ec135c2e'
'b8145d737f60b5518bf439cfd8a64ac10b244c6b'
'3b4526c84f7e585bf3fa719e6e83b117d42b6c34'
'4dba1c5504537a3565cd93345e4c6eabd98d5d05'
'd9f4b2b624e8580c947ddf2377480122b295460f'
'b595fda0dc2f18af1723976a9bf9c5725d3ec31c'
2013-04-29 02:49:39 +08:00
'd02e7eaaa5de9407d8744a03a1306c117b659098'
'fa93e2d3d4d52a1a29a1c446092a158f05751fcc'
2013-04-29 02:49:39 +08:00
'3d9663f614113c137016fadb963e150f11f17402'
'5cd50202719569cb9bc6624ad0bb3c9cbbc5a828'
'51065e45d0060374346f3c756a6b1cd0d1fb1323'
'4ac33284c534b5117741b551cc531589cfa08d75'
'88478f33ac3bad1933ca7a5cc7e0d5441d170f1a')
2013-04-29 02:49:39 +08:00
# 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
2013-04-29 02:49:39 +08:00
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"
# Fix build with system ICU (patch from Gentoo)
#patch -Np0 -i "$srcdir/chromium-system-icu-r0.patch"
2013-04-29 02:49:39 +08:00
# Prepare NaCL toolchain
mkdir native_client/toolchain/{.tars,pnacl_translator}
ln -s "$srcdir/naclsdk_nacl_linux_x86-$_toolchains_rev.tgz" \
native_client/toolchain/.tars/naclsdk_linux_x86.tgz
ln -s "$srcdir/naclsdk_pnacl_linux_x86-$_toolchains_rev.tgz" \
native_client/toolchain/.tars/naclsdk_pnacl_linux_x86.tgz
ln -s "$srcdir/naclsdk_pnacl_translator-$_toolchains_rev.tgz" \
native_client/toolchain/.tars/naclsdk_pnacl_translator.tgz
ln -s "$srcdir/naclsdk_pnacl_translator-$_toolchains_rev.tgz.sha1hash" \
native_client/toolchain/pnacl_translator/SOURCE_SHA1
ln -s "$srcdir/toolchain_linux_x86-$_toolchains_rev.tar.bz2" \
native_client/toolchain/.tars/toolchain_linux_x86.tar.bz2
}
build() {
cd "$srcdir/$pkgname-$pkgver"
# activate ninja compile method
export GYP_GENERATORS='ninja'
# ToDo
# enable icu with new version, 30.0.1599.66 returns some error during configuration
# NOTE
# -Dremove_webcore_debug_symbols=1 speed up the build by removing debug symbols for webkit
2013-04-29 02:49:39 +08:00
build/gyp_chromium --depth=. \
-Dgoogle_api_key=$_google_api_key \
-Dgoogle_default_client_id=$_google_default_client_id \
-Dgoogle_default_client_secret=$_google_default_client_secret \
2013-04-29 02:49:39 +08:00
-Dwerror= \
-Dlinux_strip_binary=1 \
-Dlinux_use_gold_binary=0 \
-Dlinux_use_gold_flags=0 \
-Dlogging_like_official_build=1 \
-Dlinux_link_pulseaudio=1 \
-Dlinux_link_libspeechd=1 \
2013-04-29 02:49:39 +08:00
-Drelease_extra_cflags="$CFLAGS" \
-Dlibspeechd_h_prefix=speech-dispatcher/ \
2013-04-29 02:49:39 +08:00
-Dffmpeg_branding=Chrome \
-Dproprietary_codecs=1 \
-Duse_system_bzip2=1 \
-Duse_system_flac=1 \
2013-04-29 02:49:39 +08:00
-Duse_system_ffmpeg=0 \
-Duse_system_icu=0 \
2013-04-29 02:49:39 +08:00
-Duse_system_libevent=1 \
-Duse_system_libjpeg=1 \
-Duse_system_libpng=1 \
-Duse_system_libxml=1 \
-Duse_system_opus=1 \
2013-04-29 02:49:39 +08:00
-Duse_system_ssl=0 \
-Duse_system_xdg_utils=1 \
2013-04-29 02:49:39 +08:00
-Duse_system_yasm=1 \
-Duse_system_zlib=1 \
-Duse_system_v8=1 \
2013-04-29 02:49:39 +08:00
-Duse_gconf=0 \
-Dtarget_arch=x64 \
-Dremove_webcore_debug_symbols=1
#-Ddisable_nacl=1
2013-04-29 02:49:39 +08:00
#make chrome chrome_sandbox BUILDTYPE=Release
# Build chrome base
ninja -C out/Release chrome
# Build the required SUID_SANDBOX helper
ninja -C out/Release chrome_sandbox
2013-04-29 02:49:39 +08:00
}
package() {
cd "$srcdir/$pkgname-$pkgver"
2013-04-29 02:49:39 +08:00
install -D out/Release/chrome ${pkgdir}/extra/usr/lib/chromium/chromium
install -Dm4755 -o root -g root out/Release/chrome_sandbox \
"$pkgdir/extra/usr/lib/chromium/chrome-sandbox"
2013-04-29 02:49:39 +08:00
cp out/Release/{*.pak,libffmpegsumo.so,nacl_helper{,_bootstrap}} \
out/Release/{libppGoogleNaClPluginChrome.so,nacl_irt_*.nexe} \
2013-04-29 02:49:39 +08:00
"$pkgdir/extra/usr/lib/chromium/"
# override command-line options
install -Dm644 "$srcdir/chromium.default" "$pkgdir/extra/etc/chromium/default"
cp -a out/Release/locales out/Release/resources "$pkgdir/extra/usr/lib/chromium/"
find "$pkgdir/extra/usr/lib/chromium/" -name '*.d' -type f -delete
install -Dm644 out/Release/chrome.1 "$pkgdir/extra/usr/share/man/man1/chromium.1"
install -Dm644 "$srcdir/chromium.desktop" \
"$pkgdir/extra/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/extra/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/extra/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
done
2013-04-29 02:49:39 +08:00
install -D "$srcdir/chromium.sh" "$pkgdir/extra/usr/bin/chromium"
install -Dm644 LICENSE "$pkgdir/extra/usr/share/licenses/chromium/LICENSE"
#### PepperFlash ####
cd "$srcdir"
install -d "$pkgdir/extra/usr/lib/PepperFlash"
install -m644 opt/google/chrome/PepperFlash/* "$pkgdir/extra/usr/lib/PepperFlash"
sed -i "s/flashver=.*/flashver=$_pepperflashver/" "$startdir/chromium.install"
install -Dm644 "$srcdir/license.html" "$pkgdir/extra/usr/share/licenses/$pkgname/license.html"
#### libpdf ####
install -d "${pkgdir}/extra/usr/lib/chromium"
install -m644 opt/google/chrome/libpdf.so "${pkgdir}/extra/usr/lib/chromium"
}