2012-07-26 11:45:39 -07:00
|
|
|
{ stdenv, fetchsvn, gyp, readline, python, which }:
|
2012-01-18 12:32:23 -08:00
|
|
|
|
|
|
|
assert readline != null;
|
2010-11-22 06:23:06 -08:00
|
|
|
|
|
|
|
let
|
|
|
|
system = stdenv.system;
|
2012-02-09 21:22:58 -08:00
|
|
|
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
|
2012-09-13 03:32:19 -07:00
|
|
|
version = "3.11.10.22";
|
2010-11-22 06:23:06 -08:00
|
|
|
in
|
2012-07-25 08:42:15 -07:00
|
|
|
|
2012-02-09 21:22:58 -08:00
|
|
|
assert arch != "";
|
2012-07-25 08:42:15 -07:00
|
|
|
|
2010-11-22 06:23:06 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2012-01-18 12:32:23 -08:00
|
|
|
name = "v8-${version}";
|
2010-11-22 06:23:06 -08:00
|
|
|
src = fetchsvn {
|
2012-01-18 12:32:23 -08:00
|
|
|
url = "http://v8.googlecode.com/svn/tags/${version}";
|
2012-09-13 03:32:19 -07:00
|
|
|
sha256 = "1bm3hg4pa17xvs8s895bwklxpaihl3f3vzghdg55s1wd0y4dj96j";
|
2010-11-22 06:23:06 -08:00
|
|
|
};
|
2012-01-18 12:32:23 -08:00
|
|
|
|
2012-07-25 08:42:15 -07:00
|
|
|
configurePhase = ''
|
|
|
|
mkdir build/gyp
|
|
|
|
ln -sv ${gyp}/bin/gyp build/gyp/gyp
|
2010-11-22 06:23:06 -08:00
|
|
|
'';
|
2012-01-18 12:32:23 -08:00
|
|
|
|
2012-12-28 10:20:09 -08:00
|
|
|
nativeBuildInputs = stdenv.lib.optional (system == "i686-linux") which;
|
2012-07-25 08:42:15 -07:00
|
|
|
buildInputs = [ readline python ];
|
|
|
|
|
|
|
|
buildFlags = [
|
|
|
|
"library=shared"
|
|
|
|
"console=readline"
|
|
|
|
"${arch}.release"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2010-11-22 06:23:06 -08:00
|
|
|
installPhase = ''
|
2012-01-18 12:16:00 -08:00
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/lib
|
2012-07-25 08:42:15 -07:00
|
|
|
mv -v out/${arch}.release/d8 $out/bin
|
2013-01-07 07:52:42 -08:00
|
|
|
|
|
|
|
${if stdenv.system == "x86_64-darwin" then
|
|
|
|
"mv -v out/${arch}.release/libv8.dylib $out/lib"
|
|
|
|
else
|
|
|
|
"mv -v out/${arch}.release/lib.target/libv8.so $out/lib"}
|
2012-07-25 08:42:15 -07:00
|
|
|
mv -v include $out/
|
2010-11-22 06:23:06 -08:00
|
|
|
'';
|
|
|
|
}
|