2014-02-22 00:22:13 +00:00
|
|
|
# $Id$
|
|
|
|
# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
|
|
|
|
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
|
|
|
|
# Contributor: Kaiting Chen <kaitocracy@gmail.com>
|
|
|
|
# Contributor: tocer <tocer.deng@gmail.com>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - set ARM arch, gyp config flags
|
|
|
|
|
|
|
|
pkgname=v8
|
|
|
|
# use http://omahaproxy.appspot.com/ to find stable v8 version
|
2014-10-20 19:00:25 +00:00
|
|
|
pkgver=3.29.88.8
|
2014-02-22 00:22:13 +00:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc='Fast and modern Javascript engine'
|
|
|
|
arch=(i686 x86_64)
|
|
|
|
url='http://code.google.com/p/v8'
|
|
|
|
license=(BSD)
|
|
|
|
depends=(readline icu)
|
2014-10-20 19:00:25 +00:00
|
|
|
makedepends=(python2 ninja)
|
2014-02-22 00:22:13 +00:00
|
|
|
# unfortunately https://github.com/$pkgname/$pkgname does not contain all tags
|
2014-08-21 00:19:28 +00:00
|
|
|
source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver-lite.tar.bz2
|
2014-02-22 00:22:13 +00:00
|
|
|
v8.pc)
|
2014-10-20 19:00:25 +00:00
|
|
|
sha256sums=('7df4f844ff21cd22963d80d65bc547bb186e76f2bba06e346c5de781d041cc51'
|
2014-02-22 00:22:13 +00:00
|
|
|
'2b054309df9af9fb2e3e14527e88360b44745649b4866e592fb357ac90935f5d')
|
|
|
|
|
|
|
|
[[ "$CARCH" = 'i686' ]] && ARCH=ia32
|
|
|
|
[[ "$CARCH" = 'x86_64' ]] && ARCH=x64
|
2014-04-20 15:09:53 +00:00
|
|
|
[[ "$CARCH" = 'arm' ]] && ARCH=arm && CONFIG="-Darmv7=0 -Darm_neon=0 -Darm_float_abi=soft -Darm_thumb=" && CXXFLAGS="$CXXFLAGS -march=armv5t -mno-unaligned-access"
|
2014-02-22 00:22:13 +00:00
|
|
|
[[ "$CARCH" = 'armv6h' ]] && ARCH=arm && CONFIG="-Darmv7=0 -Darm_neon=0 -Darm_fpu=vfp -Darm_float_abi=hard -Darm_thumb="
|
|
|
|
[[ "$CARCH" = 'armv7h' ]] && ARCH=arm && CONFIG="-Darmv7=1 -Darm_neon=0 -Darm_fpu=vfpv3-d16 -Darm_float_abi=hard -Darm_thumb="
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd v8-$pkgver
|
|
|
|
|
|
|
|
find build/ test/ tools/ src/ -type f -exec \
|
|
|
|
sed -e 's_^#!/usr/bin/env python$_&2_' \
|
|
|
|
-e 's_^#!/usr/bin/python$_&2_' \
|
|
|
|
-e "s_'python'_'python2'_" -i {} \;
|
|
|
|
|
|
|
|
sed 's/\bpython\b/python2/' -i Makefile build/gyp/gyp
|
|
|
|
|
|
|
|
sed "s/@VERSION@/$pkgver/g" -i "$srcdir/v8.pc"
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd v8-$pkgver
|
|
|
|
|
2014-10-20 19:00:25 +00:00
|
|
|
build/gyp_v8 $CONFIG -Dv8_enable_i18n_support=1 -Duse_system_icu=1 -Dconsole=readline -Dcomponent=shared_library -Dv8_target_arch=$ARCH -f ninja
|
2014-02-22 00:22:13 +00:00
|
|
|
|
2014-10-20 19:00:25 +00:00
|
|
|
ninja -C out/Release v8 d8 # or target 'all' if you need tests
|
2014-02-22 00:22:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
|
|
|
cd v8-$pkgver
|
|
|
|
# A number of tests are failing. Figure out what happens and then enable tests.
|
|
|
|
# LD_LIBRARY_PATH=out/Release/lib.target tools/run-tests.py --no-presubmit --outdir=out --buildbot --arch=$ARCH --mode=Release # --progress=dots
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd v8-$pkgver
|
|
|
|
|
|
|
|
install -Dm755 out/Release/d8 "$pkgdir"/usr/bin/d8
|
2014-10-20 19:00:25 +00:00
|
|
|
install -Dm755 out/Release/lib/libv8.so "$pkgdir"/usr/lib/libv8.so
|
2014-02-22 00:22:13 +00:00
|
|
|
|
|
|
|
# V8 has several header files and ideally if it had its own folder in /usr/include
|
|
|
|
# But doing it here will break all users. Ideally if they use provided pkgconfig file.
|
|
|
|
install -d "$pkgdir"/usr/include
|
|
|
|
install -Dm644 include/*.h "$pkgdir"/usr/include
|
|
|
|
|
|
|
|
install -d "$pkgdir"/usr/lib/pkgconfig
|
|
|
|
install -m644 "$srcdir/v8.pc" "$pkgdir"/usr/lib/pkgconfig
|
|
|
|
|
|
|
|
install -d "$pkgdir"/usr/share/licenses/v8
|
|
|
|
install -m644 LICENSE* "$pkgdir"/usr/share/licenses/v8
|
|
|
|
}
|