v8: build with gyp.

The scons build has been deprecated
This commit is contained in:
Shea Levy 2012-07-25 11:42:15 -04:00
parent 7f4b27f464
commit 3a37f47fd4
2 changed files with 20 additions and 14 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchsvn, python, scons, readline, makeWrapper }:
{ stdenv, fetchsvn, gyp, readline, python }:
assert readline != null;
@ -7,7 +7,9 @@ let
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
version = "3.11.10.15";
in
assert arch != "";
stdenv.mkDerivation rec {
name = "v8-${version}";
src = fetchsvn {
@ -15,22 +17,26 @@ stdenv.mkDerivation rec {
sha256 = "0pdw4r6crsb07gshww4kbfbavxgkal8yaxkaggnkz62lrwbcwrwi";
};
buildInputs = [python scons readline makeWrapper];
buildPhase = ''
export CXX=`type -p g++`
export CPPPATH=${readline}/include
export LIBPATH=${readline}/lib
scons snapshot=on console=readline library=shared importenv=PATH arch=${arch} library d8
configurePhase = ''
mkdir build/gyp
ln -sv ${gyp}/bin/gyp build/gyp/gyp
'';
buildInputs = [ readline python ];
buildFlags = [
"library=shared"
"console=readline"
"${arch}.release"
];
enableParallelBuilding = true;
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
cp -v libv8.* $out/lib
cp -v d8 $out/bin/d8
cp -vR include $out/
wrapProgram $out/bin/d8 --set ${if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"} $out/lib
mv -v out/${arch}.release/d8 $out/bin
mv -v out/${arch}.release/lib.target/libv8.so $out/lib
mv -v include $out/
'';
}

View File

@ -5004,7 +5004,7 @@ let
inherit (gnome) libsoup;
};
v8 = callPackage ../development/libraries/v8 { };
v8 = callPackage ../development/libraries/v8 { inherit (pythonPackages) gyp; };
xalanj = xalanJava;
xalanJava = callPackage ../development/libraries/java/xalanj {