gtk/chromium/PKGBUILD

190 lines
6.8 KiB
Bash
Raw Normal View History

2013-04-29 02:49:39 +08:00
pkgname=chromium
2015-09-29 11:27:38 +08:00
pkgver=45.0.2454.101
2015-01-16 05:47:13 +08:00
pkgrel=1
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')
2015-07-08 12:01:05 +08:00
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')
optdepends=('pepperflashplugin: Pepper Flash plugin')
2013-04-29 02:49:39 +08:00
install=chromium.install
2015-01-23 05:14:44 +08:00
#backup=('etc/chromium/default') #not really needed beacuse we want to provide on chromium.default the pepperflash plugin, I keep it here as comment
source=(http://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${pkgver}.tar.xz
license.html::http://www.google.com/chrome/intl/en/eula_text.html
2013-04-29 02:49:39 +08:00
chromium.desktop
chromium.sh
chromium.default
template_url_prepopulate_data.diff
search_engine_type.diff
2015-07-08 12:01:05 +08:00
prepopulated_engines_json.diff
2015-09-24 08:59:12 +08:00
chromium-widevine.patch
0001-Demand-for-newer-POSIX-macro.patch)
2015-09-29 11:27:38 +08:00
sha1sums=('2256960eae4f92f421adbeccb997cb92534749eb'
2015-06-12 23:19:36 +08:00
'1ffba5152cb749300a016efec909b828eba9a64a'
'3ab45403f3e8ddfeeba6a5aee9f683d57883fb90'
'19eff765ec1316f4ae057d48919b2fdd6b3a5bea'
2015-01-23 05:14:44 +08:00
'51f172122f83825b64c58365620450865bbb879b'
2015-03-08 07:08:57 +08:00
'76e9844dd1357f75abf617114cc432009d7c6372'
2014-08-27 05:07:51 +08:00
'abeb1e424b35bbca954a5afea39418a5e198ac64'
2015-07-08 12:01:05 +08:00
'79fc829d740183d85fb147a3a44e572a8f304dbe'
2015-09-24 08:59:12 +08:00
'6e9f007005dabd1f254304abccfa39f3b8275eea'
'aae9267ef4a0542c2dc4c944d8018e65a684c7af')
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"
2015-09-24 08:59:12 +08:00
# Fix BoringSSL build with glibc 2.22 (FS#45965)
patch -Np1 -d third_party/boringssl/src < ../0001-Demand-for-newer-POSIX-macro.patch
2014-10-13 02:36:22 +08:00
# 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"
2015-07-08 12:01:05 +08:00
2015-09-24 08:59:12 +08:00
# Enable support for the Widevine CDM plugin
# The actual libraries are not included, but can be copied over from Chrome:
# libwidevinecdmadapter.so
# libwidevinecdm.so
# (Version string doesn't seem to matter so let's go with "Pinkie Pie")
sed "s/@WIDEVINE_VERSION@/Pinkie Pie/" ../chromium-widevine.patch |
patch -Np1
2013-04-29 02:49:39 +08:00
2014-07-18 06:33:06 +08:00
# Download NaCL toolchains
python2 build/download_nacl_toolchains.py \
2015-03-08 07:08:57 +08:00
--packages nacl_x86_newlib,pnacl_newlib,pnacl_translator \
sync --extract
}
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
2014-10-13 02:36:22 +08:00
# 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
2014-07-18 06:33:06 +08:00
-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
2013-06-06 02:19:49 +08:00
ninja -C out/Release chrome
# Build the required SUID_SANDBOX helper
2013-06-06 02:19:49 +08:00
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}/usr/lib/chromium/chromium
2013-04-29 02:49:39 +08:00
install -Dm4755 -o root -g root out/Release/chrome_sandbox \
"$pkgdir/usr/lib/chromium/chrome-sandbox"
2013-04-29 02:49:39 +08:00
2015-07-23 14:35:45 +08:00
cp out/Release/{*.pak,*.bin,nacl_helper{,_bootstrap}} \
2014-10-13 02:36:22 +08:00
out/Release/nacl_irt_*.nexe \
"$pkgdir/usr/lib/chromium/"
2013-04-29 02:49:39 +08:00
2014-10-13 02:36:22 +08:00
# 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}
2015-07-23 14:35:45 +08:00
# strip $STRIP_SHARED "$pkgdir/usr/lib/chromium/libffmpegsumo.so"
2014-10-13 02:36:22 +08:00
2013-04-29 02:49:39 +08:00
# override command-line options
install -Dm644 "$srcdir/chromium.default" "$pkgdir/etc/chromium/default"
2013-04-29 02:49:39 +08:00
cp -a out/Release/locales out/Release/icudtl.dat "$pkgdir/usr/lib/chromium/"
2013-04-29 02:49:39 +08:00
find "$pkgdir/usr/lib/chromium/" -name '*.d' -type f -delete
2013-04-29 02:49:39 +08:00
install -Dm644 out/Release/chrome.1 "$pkgdir/usr/share/man/man1/chromium.1"
2013-04-29 02:49:39 +08:00
install -Dm644 "$srcdir/chromium.desktop" \
"$pkgdir/usr/share/applications/chromium.desktop"
2013-04-29 02:49:39 +08:00
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"
2013-04-29 02:49:39 +08:00
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
2013-04-29 02:49:39 +08:00
install -D "$srcdir/chromium.sh" "$pkgdir/usr/bin/chromium"
2013-04-29 02:49:39 +08:00
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
2013-04-29 02:49:39 +08:00
}