2012-01-18 20:32:23 +00:00
|
|
|
{ stdenv, fetchsvn, python, scons, readline, makeWrapper }:
|
|
|
|
|
|
|
|
assert readline != null;
|
2010-11-22 14:23:06 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
system = stdenv.system;
|
2012-02-10 05:22:58 +00:00
|
|
|
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
|
2012-02-06 19:08:56 +00:00
|
|
|
version = "3.6.6.20";
|
2010-11-22 14:23:06 +00:00
|
|
|
in
|
2012-02-10 05:22:58 +00:00
|
|
|
assert arch != "";
|
2010-11-22 14:23:06 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2012-01-18 20:32:23 +00:00
|
|
|
name = "v8-${version}";
|
2010-11-22 14:23:06 +00:00
|
|
|
src = fetchsvn {
|
2012-01-18 20:32:23 +00:00
|
|
|
url = "http://v8.googlecode.com/svn/tags/${version}";
|
2012-02-06 19:08:56 +00:00
|
|
|
sha256 = "68565086baa5a37a0fa15e1c0b7914210fa590b29a8196014cd83789da6a01ba";
|
2010-11-22 14:23:06 +00:00
|
|
|
};
|
2012-01-18 20:32:23 +00:00
|
|
|
|
|
|
|
buildInputs = [python scons readline makeWrapper];
|
|
|
|
|
2010-11-22 14:23:06 +00:00
|
|
|
buildPhase = ''
|
|
|
|
export CXX=`type -p g++`
|
2012-01-18 20:32:23 +00:00
|
|
|
export CPPPATH=${readline}/include
|
|
|
|
export LIBPATH=${readline}/lib
|
|
|
|
scons snapshot=on console=readline library=shared importenv=PATH arch=${arch} library d8
|
2010-11-22 14:23:06 +00:00
|
|
|
'';
|
2012-01-18 20:32:23 +00:00
|
|
|
|
2010-11-22 14:23:06 +00:00
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/lib
|
2012-01-18 20:32:23 +00:00
|
|
|
|
2010-11-22 14:23:06 +00:00
|
|
|
cp -v libv8.* $out/lib
|
2012-01-18 20:32:23 +00:00
|
|
|
cp -v d8 $out/bin/d8
|
2010-11-22 14:23:06 +00:00
|
|
|
cp -vR include $out/
|
2012-02-10 05:22:58 +00:00
|
|
|
wrapProgram $out/bin/d8 --set ${if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"} $out/lib
|
2010-11-22 14:23:06 +00:00
|
|
|
'';
|
|
|
|
}
|