nixpkgs/pkgs/development/libraries/v8/default.nix
Sander van der Burg 5b0ca88d97 - Added xcodeenv: experimental support to build iOS apps through Nix
- Moved mobile development tools into a separate folder
2013-01-07 16:52:42 +01:00

49 lines
1.3 KiB
Nix

{ stdenv, fetchsvn, gyp, readline, python, which }:
assert readline != null;
let
system = stdenv.system;
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
version = "3.11.10.22";
in
assert arch != "";
stdenv.mkDerivation rec {
name = "v8-${version}";
src = fetchsvn {
url = "http://v8.googlecode.com/svn/tags/${version}";
sha256 = "1bm3hg4pa17xvs8s895bwklxpaihl3f3vzghdg55s1wd0y4dj96j";
};
configurePhase = ''
${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") "export PATH=/usr/bin:$PATH"}
mkdir build/gyp
ln -sv ${gyp}/bin/gyp build/gyp/gyp
'';
buildNativeInputs = stdenv.lib.optional (system == "i686-linux") which;
buildInputs = [ readline python ];
buildFlags = [
"library=shared"
"console=readline"
"${arch}.release"
];
enableParallelBuilding = true;
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
mv -v out/${arch}.release/d8 $out/bin
${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"}
mv -v include $out/
'';
}