nixpkgs/pkgs/development/libraries/v8/default.nix
Rob Vermaas 1c86c832c1 add google v8 engine
svn path=/nixpkgs/trunk/; revision=24809
2010-11-22 14:23:06 +00:00

35 lines
995 B
Nix

{ stdenv, fetchsvn, python, scons, makeWrapper }:
let
system = stdenv.system;
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" then "x64" else abort "not supported";
in
stdenv.mkDerivation rec {
name = "v8-r${toString src.rev}";
src = fetchsvn {
url = http://v8.googlecode.com/svn/trunk ;
sha256 = "1p51zh1l9c2gq3g4qk713n6qki9by3llx4p46inncvqfrimgshxb";
rev = 5865;
};
buildInputs = [python scons makeWrapper];
buildPhase = ''
export CXX=`type -p g++`
scons snapshot=on importenv=PATH arch=${arch}
scons snapshot=on library=shared importenv=PATH arch=${arch}
scons sample=shell snapshot=on importenv=PATH arch=${arch}
'';
installPhase = ''
ensureDir $out/bin
ensureDir $out/lib
cp -v libv8.* $out/lib
cp -v shell $out/bin/v8-shell
cp -vR include $out/
wrapProgram $out/bin/v8-shell --set LD_LIBRARY_PATH $out/lib
'';
}