refactor v8 to GYP, beat over head for v5

This commit is contained in:
WarheadsSE 2012-08-06 05:52:09 -04:00
parent 2175cfe085
commit 2a1f47b353
3 changed files with 39 additions and 16 deletions

View file

@ -5,7 +5,7 @@
pkgname=sunxi-tools
pkgver=20120716
pkgver=20120806
pkgrel=1
pkgdesc="Tools for Allwinner A10 (sun4i): fex, fel, pheonix_info"
arch=('arm' 'armv7h')

View file

@ -8,7 +8,7 @@
pkgname=nodejs
pkgver=0.8.5
pkgrel=1
pkgrel=2
pkgdesc='Evented I/O for V8 javascript'
arch=('i686' 'x86_64' 'arm')
url='http://nodejs.org/'

View file

@ -4,14 +4,14 @@
pkgname=v8
pkgver=3.11.10
pkgrel=1
pkgrel=2
plugrel=1
pkgdesc='A fast and modern javascript engine'
arch=('i686' 'x86_64')
url='http://code.google.com/p/v8'
license=('BSD')
depends=('gcc-libs')
makedepends=('subversion' 'scons')
makedepends=('subversion' 'python2')
build() {
_source="http://v8.googlecode.com/svn/tags/${pkgver}"
@ -20,29 +20,52 @@ build() {
cd "${srcdir}/${pkgname}-${pkgver}"
if [ "$CARCH" == "arm" ]; then
msg 'pre-compiling v8 for v5'
# we need to override the arch (last one will be used) because
# v8 thinks armv5te can use unaligned.. the kirkwood can't!
CCFLAGS="$CCFLAGS -march=armv5t" ;
export CCFLAGS ;
CARCH_V8="armeabi=soft"
# We'll also beat it over the head.
CXXFLAGS="$CXXFLAGS -march=armv5t -mno-unaligned-access" ;
export CXXFLAGS ;
GYP_FLAGS="-Darmeabi=soft "
VFP=off
fi
if [ "$CARCH" == "armv6h" ]; then
CARCH_V8="armeabi=hard vfpv3=off"
GYP_FLAGS="-Darmeabi=hard "
VFP=off
fi
if [ "$CARCH" == "armv7h" ]; then
CARCH_V8="armeabi=hard vfpv3=on"
GYP_FLAGS="-Darmeabi=hard "
VFP=on
fi
scons mode=release library=shared arch=arm snapshot=off $CARCH_V8
scons d8 arch=arm $CARCH_V8
# short-cutting python=python2 for GYP, as it will only be used here.
export PYTHON=python2
if [ ! -f "${srcdir}/python" ]; then
ln -s `which python2` ${srcdir}/python ;
fi
PATH="${srcdir}:$PATH";
export PATH ;
# gets gyp
make dependencies
# make
# arm.release & arm.debug = just arm
GYP_FLAGS=$GYP_FLAGS make arm.release library=shared snapshot=off vfp3=$VFP
# eo build
}
# seperated to possibly split v8-debug in the future.
package (){
cd "${srcdir}/${pkgname}-${pkgver}"
find include -type f \
-exec install -Dm644 {} ${pkgdir}/usr/{} \;
rm -rf ${pkgdir}/usr/include/.svn
install -Dm755 d8 "${pkgdir}/usr/bin/d8"
install -Dm755 libv8.so "${pkgdir}/usr/lib/libv8.so"
# these barf, need updated.
# src/v8-3.11.10/out/arm.release/d8
# src/v8-3.11.10/out/arm.release/lib.target/libv8.so
install -Dm755 out/arm.release/d8 "${pkgdir}/usr/bin/d8"
install -Dm755 out/arm.release/lib.target/libv8.so "${pkgdir}/usr/lib/libv8.so"
install -d ${pkgdir}/usr/share/licenses/v8
install -m644 LICENSE* ${pkgdir}/usr/share/licenses/v8