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; 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 ""; 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"; version = "3.11.10.15";
in in
assert arch != ""; assert arch != "";
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "v8-${version}"; name = "v8-${version}";
src = fetchsvn { src = fetchsvn {
@ -15,22 +17,26 @@ stdenv.mkDerivation rec {
sha256 = "0pdw4r6crsb07gshww4kbfbavxgkal8yaxkaggnkz62lrwbcwrwi"; sha256 = "0pdw4r6crsb07gshww4kbfbavxgkal8yaxkaggnkz62lrwbcwrwi";
}; };
buildInputs = [python scons readline makeWrapper]; configurePhase = ''
mkdir build/gyp
buildPhase = '' ln -sv ${gyp}/bin/gyp build/gyp/gyp
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
''; '';
buildInputs = [ readline python ];
buildFlags = [
"library=shared"
"console=readline"
"${arch}.release"
];
enableParallelBuilding = true;
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
mkdir -p $out/lib mkdir -p $out/lib
mv -v out/${arch}.release/d8 $out/bin
cp -v libv8.* $out/lib mv -v out/${arch}.release/lib.target/libv8.so $out/lib
cp -v d8 $out/bin/d8 mv -v include $out/
cp -vR include $out/
wrapProgram $out/bin/d8 --set ${if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"} $out/lib
''; '';
} }

View File

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