mirror of
https://gitdl.cn/https://github.com/chakralinux/gtk.git
synced 2025-02-03 20:47:13 +08:00
217 lines
8.6 KiB
Bash
217 lines
8.6 KiB
Bash
#
|
|
# Chakra Packages for Chakra, part of chakra-project.org
|
|
#
|
|
|
|
pkgname=chromium
|
|
pkgver=33.0.1750.117
|
|
pkgrel=2
|
|
_verbld=${pkgver}-1 # used for libpdf and pepper-flash
|
|
_pepperflashver=12.0.0.70
|
|
|
|
# https://build.opensuse.org/package/view_file/network:chromium/chromium/chromium.spec
|
|
_pnacl_version=12534
|
|
_nacl_version=12464
|
|
_glibc_version=12421
|
|
|
|
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')
|
|
makedepends=('python2' 'perl' 'gperf' 'yasm' 'mesa' 'libgnome-keyring' 'elfutils' 'lib32-gcc-libs' 'subversion' 'ninja')
|
|
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
|
|
naclsdk_nacl_linux_x86-$_nacl_version.tgz::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_nacl_version/naclsdk_linux_x86.tgz
|
|
naclsdk_pnacl_linux_x86-$_pnacl_version.tgz::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_pnacl_version/naclsdk_pnacl_linux_x86.tgz
|
|
naclsdk_pnacl_translator-$_pnacl_version.tgz::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_pnacl_version/naclsdk_pnacl_translator.tgz
|
|
naclsdk_pnacl_translator-$_pnacl_version.tgz.sha1hash::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_pnacl_version/naclsdk_pnacl_translator.tgz.sha1hash
|
|
toolchain_linux_x86-$_glibc_version.tar.bz2::https://commondatastorage.googleapis.com/nativeclient-archive2/x86_toolchain/r$_glibc_version/toolchain_linux_x86.tar.bz2
|
|
chromium.desktop
|
|
chromium.sh
|
|
chromium.default
|
|
chromium-gn-r0.patch
|
|
template_url_prepopulate_data.diff
|
|
search_engine_type.diff
|
|
prepopulated_engines_json.diff
|
|
chromium-system-icu-r0.patch)
|
|
|
|
noextract=(naclsdk_nacl_linux_x86-$_nacl_version.tgz
|
|
naclsdk_pnacl_linux_x86-$_pnacl_version.tgz
|
|
naclsdk_pnacl_translator-$_pnacl_version.tgz
|
|
toolchain_linux_x86-$_glibc_version.tar.bz2)
|
|
|
|
sha1sums=('9881d7cfc1ebbc9f21dc4b686eeb6630b6849701'
|
|
'69ffd48d852bcd1796e37edda4ae64c72af66599'
|
|
'f78c3d5f420d52460b2d59f7c47e32989b3e1780'
|
|
'375b8f11781828cdc72146f0c18b4d3084d11bd5'
|
|
'291d90c75de219eb4247208e6553619e4f379564'
|
|
'f95607febc0f20a49091e469c3eb89f3da1d57a8'
|
|
'f991c0efcb96881fbc6ca944a1be289186cd6fae'
|
|
'a9c6beffc24ece6ec993a2a7d3df73fdef3450fc'
|
|
'3ab45403f3e8ddfeeba6a5aee9f683d57883fb90'
|
|
'19eff765ec1316f4ae057d48919b2fdd6b3a5bea'
|
|
'11332bcd0318d573bea1aa0744213a5d006aecc4'
|
|
'a8c367af2530c74e096bb0258c22907a4d1054f5'
|
|
'5cd50202719569cb9bc6624ad0bb3c9cbbc5a828'
|
|
'51065e45d0060374346f3c756a6b1cd0d1fb1323'
|
|
'4ac33284c534b5117741b551cc531589cfa08d75'
|
|
'88478f33ac3bad1933ca7a5cc7e0d5441d170f1a')
|
|
|
|
|
|
# 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"
|
|
|
|
# Fix build during "Generating gyp files from GN..."
|
|
patch -Np0 -i "$srcdir/chromium-gn-r0.patch"
|
|
|
|
# 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"
|
|
|
|
# Fix build with system ICU (patch from Gentoo)
|
|
#patch -Np0 -i "$srcdir/chromium-system-icu-r0.patch"
|
|
|
|
# Prepare NaCL toolchain
|
|
mkdir native_client/toolchain/{.tars,pnacl_translator}
|
|
ln -s "$srcdir/naclsdk_nacl_linux_x86-$_nacl_version.tgz" \
|
|
native_client/toolchain/.tars/naclsdk_linux_x86.tgz
|
|
ln -s "$srcdir/naclsdk_pnacl_linux_x86-$_pnacl_version.tgz" \
|
|
native_client/toolchain/.tars/naclsdk_pnacl_linux_x86.tgz
|
|
ln -s "$srcdir/naclsdk_pnacl_translator-$_pnacl_version.tgz" \
|
|
native_client/toolchain/.tars/naclsdk_pnacl_translator.tgz
|
|
ln -s "$srcdir/naclsdk_pnacl_translator-$_pnacl_version.tgz.sha1hash" \
|
|
native_client/toolchain/pnacl_translator/SOURCE_SHA1
|
|
ln -s "$srcdir/toolchain_linux_x86-$_glibc_version/.tar.bz2" \
|
|
native_client/toolchain/.tars/toolchain_linux_x86.tar.bz2
|
|
|
|
}
|
|
|
|
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
|
|
|
|
# Silence "typedef 'x' locally defined but not used" warnings
|
|
CFLAGS+=' -Wno-unused-local-typedefs'
|
|
|
|
# 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
|
|
|
|
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=
|
|
-Dpython_ver=2.7
|
|
-Dlinux_link_libpci=1
|
|
-Dlinux_link_libspeechd=1
|
|
-Dlinux_link_pulseaudio=1
|
|
-Dlinux_strip_binary=1
|
|
-Dlinux_use_gold_binary=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
|
|
-Duse_system_bzip2=1
|
|
-Duse_system_flac=1
|
|
-Duse_system_ffmpeg=0
|
|
-Duse_system_harfbuzz=1
|
|
-Duse_system_icu=1
|
|
-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_gconf=0
|
|
-Dtarget_arch=x64
|
|
-Dffmpeg_target_arch=x64
|
|
-Ddisable_glibc=1
|
|
-Ddisable_sse2=1)
|
|
|
|
build/linux/unbundle/replace_gyp_files.py "${_chromium_conf[@]}"
|
|
build/gyp_chromium -f make --depth=. "${_chromium_conf[@]}"
|
|
|
|
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
|
|
}
|
|
|
|
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/{libppGoogleNaClPluginChrome.so,nacl_irt_*.nexe} \
|
|
"$pkgdir/usr/lib/chromium/"
|
|
|
|
# override command-line options
|
|
install -Dm644 "$srcdir/chromium.default" "$pkgdir/etc/chromium/default"
|
|
|
|
cp -a out/Release/locales out/Release/resources "$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"
|
|
|
|
#### libpdf ####
|
|
install -d "${pkgdir}/usr/lib/chromium"
|
|
install -m644 opt/google/chrome/libpdf.so "${pkgdir}/usr/lib/chromium"
|
|
}
|