Last active
October 31, 2016 07:01
-
-
Save dflemstr/01137016843183420a1c55395e6d1596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 4519d89bc6e5076fb9f84e495674537d0ade0110 Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?David=20Flemstr=C3=B6m?= <[email protected]> | |
Date: Mon, 31 Oct 2016 00:15:07 +0100 | |
Subject: [PATCH] Version 5.6.178-1: use system ICU + fix pkg-config | |
--- | |
PKGBUILD | 65 +++++++++++++++++++++++++++++++++---------------------- | |
v8.pc | 1 + | |
v8_libbase.pc | 10 +++++++++ | |
v8_libplatform.pc | 10 +++++++++ | |
4 files changed, 60 insertions(+), 26 deletions(-) | |
create mode 100644 v8_libbase.pc | |
create mode 100644 v8_libplatform.pc | |
diff --git a/PKGBUILD b/PKGBUILD | |
index 0e7901d..6819b2c 100644 | |
--- a/PKGBUILD | |
+++ b/PKGBUILD | |
@@ -2,10 +2,11 @@ | |
# Contributor: Bartłomiej Piotrowski <[email protected]> | |
# Contributor: Kaiting Chen <[email protected]> | |
# Contributor: tocer <[email protected]> | |
+# Contributor: David Flemström <[email protected]> | |
# Maintainer: Marco Pompili <[email protected]> | |
pkgname=v8 | |
-pkgver=5.5.63.1 | |
+pkgver=5.6.178 | |
pkgrel=1 | |
pkgdesc="Fast and modern Javascript engine used in Google Chrome." | |
arch=('i686' 'x86_64') | |
@@ -16,9 +17,14 @@ makedepends=('clang>=3.8.1' 'clang-tools-extra>=3.8.1' 'python2' 'python2-virtua | |
conflicts=('v8-5.2' 'v8-3.14' 'v8-3.15' 'v8-3.20') | |
source=("depot_tools::git+https://chromium.googlesource.com/chromium/tools/depot_tools.git" | |
"v8.pc" | |
+ "v8_libbase.pc" | |
+ "v8_libplatform.pc" | |
"d8") | |
+ | |
sha256sums=('SKIP' | |
- '2b054309df9af9fb2e3e14527e88360b44745649b4866e592fb357ac90935f5d' | |
+ '3616bcfb15af7cd5a39bc0f223b2a52f15883a4bc8cfcfb291837c7421363d75' | |
+ 'efb37bd706e6535abfa20c77bb16597253391619dae275627312d00ee7332fa3' | |
+ 'ae23d543f655b4d8449f98828d0aff6858a777429b9ebdd2e23541f89645d4eb' | |
'cfd0712ee91d30b62e761da130e194c18f2b92a7f1654fb4af49f96ae9ce3e1b') | |
case "$CARCH" in | |
@@ -26,6 +32,8 @@ case "$CARCH" in | |
i686) V8_ARCH="ia32" ;; | |
esac | |
+OUTFLD=out.gn/Release | |
+ | |
prepare() { | |
msg2 "Creating Python Virtual Environment" | |
virtualenv2 -q venv | |
@@ -48,27 +56,35 @@ prepare() { | |
cd v8 | |
+ if [ -f third_party/icu/BUILD.gn.orig ] | |
+ then | |
+ msg2 "Restoring bundled ICU build files for syncing" | |
+ ./build/linux/unbundle/replace_gn_files.py --undo --system-libraries icu | |
+ fi | |
+ | |
msg2 "Syncing" | |
- gclient sync | |
- git checkout tags/${pkgver} | |
+ gclient sync --revision ${pkgver} | |
+ | |
+ msg2 "Using system libraries for ICU" | |
+ ./build/linux/unbundle/replace_gn_files.py --system-libraries icu | |
sed "s/@VERSION@/${pkgver}/g" -i "${srcdir}/v8.pc" | |
+ sed "s/@VERSION@/${pkgver}/g" -i "${srcdir}/v8_libbase.pc" | |
+ sed "s/@VERSION@/${pkgver}/g" -i "${srcdir}/v8_libplatform.pc" | |
} | |
-OUTFLD=out.gn/Release | |
- | |
build() { | |
cd v8 | |
msg2 "Running GN..." | |
../depot_tools/gn gen $OUTFLD \ | |
- -vv --fail-on-unused-args \ | |
- --args='is_debug=false is_clang=false use_sysroot=false clang_base_path="/usr" is_component_build=true v8_enable_i18n_support=true icu_use_data_file=false' | |
- | |
+ -vv --fail-on-unused-args \ | |
+ --args='is_debug=false is_official_build=true is_clang=false use_sysroot=false clang_base_path="/usr" is_component_build=true v8_enable_i18n_support=true v8_use_external_startup_data=false' | |
- ## Needs to resync after running GN | |
- msg2 "Resyncing..." | |
- gclient sync > /dev/null | |
+ # Fixes bug in generate_shim_headers.py that fails to create these | |
+ # dirs | |
+ mkdir -p "$OUTFLD/gen/shim_headers/icuuc_shim/third_party/icu/source/common/unicode/" | |
+ mkdir -p "$OUTFLD/gen/shim_headers/icui18n_shim/third_party/icu/source/i18n/unicode/" | |
msg2 "Building, this will take a while..." | |
ninja -C $OUTFLD | |
@@ -79,10 +95,10 @@ check() { | |
msg2 "Testing, this will take also a while..." | |
tools/run-tests.py --no-presubmit \ | |
- --outdir=out.gn \ | |
- --buildbot \ | |
- --arch=$V8_ARCH \ | |
- --mode=Release | |
+ --outdir=out.gn \ | |
+ --buildbot \ | |
+ --arch=$V8_ARCH \ | |
+ --mode=Release | |
} | |
package() { | |
@@ -90,17 +106,12 @@ package() { | |
install -d ${pkgdir}/usr/lib/v8 | |
- #install -Dm644 $srcdir/v8/$OUTFLD/obj/src/*.a $pkgdir/usr/lib/v8 | |
- | |
install -Dm755 $OUTFLD/d8 ${pkgdir}/usr/lib/v8/d8 | |
- install -Dm644 $OUTFLD/natives_blob.bin ${pkgdir}/usr/lib/v8/natives_blob.bin | |
- install -Dm644 $OUTFLD/snapshot_blob.bin ${pkgdir}/usr/lib/v8/snapshot_blob.bin | |
- | |
- install -Dm755 $OUTFLD/libicui18n.so ${pkgdir}/usr/lib/v8/libicui18n.so | |
- install -Dm755 $OUTFLD/libicuuc.so ${pkgdir}/usr/lib/v8/libicuuc.so | |
- install -Dm755 $OUTFLD/libv8.so ${pkgdir}/usr/lib/v8/libv8.so | |
- | |
- ln -s v8/libv8.so ${pkgdir}/usr/libv8.so | |
+ | |
+ install -Dm755 $OUTFLD/libv8.so ${pkgdir}/usr/lib/libv8.so | |
+ install -Dm755 $OUTFLD/libv8_libbase.so ${pkgdir}/usr/lib/libv8_libbase.so | |
+ install -Dm755 $OUTFLD/libv8_libplatform.so ${pkgdir}/usr/lib/libv8_libplatform.so | |
+ | |
install -Dm755 ${srcdir}/d8 ${pkgdir}/usr/bin/d8 | |
# V8 has several header files and ideally if it had its own folder in /usr/include | |
@@ -110,6 +121,8 @@ package() { | |
install -d ${pkgdir}/usr/lib/pkgconfig | |
install -m644 $srcdir/v8.pc ${pkgdir}/usr/lib/pkgconfig | |
+ install -m644 $srcdir/v8_libbase.pc ${pkgdir}/usr/lib/pkgconfig | |
+ install -m644 $srcdir/v8_libplatform.pc ${pkgdir}/usr/lib/pkgconfig | |
install -d ${pkgdir}/usr/share/licenses/v8 | |
install -m644 LICENSE* ${pkgdir}/usr/share/licenses/v8 | |
diff --git a/v8.pc b/v8.pc | |
index f3e604b..e839e56 100644 | |
--- a/v8.pc | |
+++ b/v8.pc | |
@@ -6,5 +6,6 @@ includedir=${prefix}/include | |
Name: v8 | |
Description: V8 JavaScript Engine | |
Version: @VERSION@ | |
+Requires: icu-uc, icu-i18n, v8_libbase = @VERSION@ | |
Libs: -L${libdir} -lv8 -pthread | |
Cflags: -I${includedir} | |
diff --git a/v8_libbase.pc b/v8_libbase.pc | |
new file mode 100644 | |
index 0000000..64c9503 | |
--- /dev/null | |
+++ b/v8_libbase.pc | |
@@ -0,0 +1,10 @@ | |
+prefix=/usr | |
+exec_prefix=${prefix} | |
+libdir=/usr/lib | |
+includedir=${prefix}/include | |
+ | |
+Name: v8 | |
+Description: V8 JavaScript Engine - Base library | |
+Version: @VERSION@ | |
+Libs: -L${libdir} -lv8_libbase | |
+Cflags: -I${includedir} | |
diff --git a/v8_libplatform.pc b/v8_libplatform.pc | |
new file mode 100644 | |
index 0000000..54c697a | |
--- /dev/null | |
+++ b/v8_libplatform.pc | |
@@ -0,0 +1,10 @@ | |
+prefix=/usr | |
+exec_prefix=${prefix} | |
+libdir=/usr/lib | |
+includedir=${prefix}/include | |
+ | |
+Name: v8 | |
+Description: V8 JavaScript Engine - Platform library | |
+Version: @VERSION@ | |
+Libs: -L${libdir} -lv8_libplatform -pthread | |
+Cflags: -I${includedir} | |
-- | |
2.10.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment