2014-03-17 21:03:06 +00:00
|
|
|
{ stdenv, fetchurl, gyp, readline, python, which, icu }:
|
2012-01-18 20:32:23 +00:00
|
|
|
|
|
|
|
assert readline != null;
|
2010-11-22 14:23:06 +00:00
|
|
|
|
|
|
|
let
|
2014-03-17 21:03:06 +00:00
|
|
|
arch = if stdenv.is64bit then "x64" else "ia32";
|
2010-11-22 14:23:06 +00:00
|
|
|
in
|
2012-07-25 15:42:15 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "v8-${version}";
|
2015-04-08 20:43:25 +00:00
|
|
|
version = "3.30.33.16";
|
2012-07-25 15:42:15 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://commondatastorage.googleapis.com/chromium-browser-official/"
|
|
|
|
+ "${name}.tar.bz2";
|
2015-04-08 20:43:25 +00:00
|
|
|
sha256 = "1azf1b36gqj4z5x0k9wq2dkp99zfyhwb0d6i2cl5fjm3k6js7l45";
|
2014-03-17 21:03:06 +00:00
|
|
|
};
|
2013-05-23 20:04:32 +00:00
|
|
|
|
2014-09-14 05:42:21 +00:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,' build/gyp_v8
|
|
|
|
'';
|
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
configurePhase = ''
|
|
|
|
PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \
|
2014-09-14 05:42:21 +00:00
|
|
|
PYTHONPATH="$(toPythonPath ${gyp}):$PYTHONPATH" \
|
|
|
|
build/gyp_v8 \
|
2014-03-17 21:03:06 +00:00
|
|
|
-f make \
|
|
|
|
--generator-output="out" \
|
|
|
|
-Dflock_index=0 \
|
|
|
|
-Dv8_enable_i18n_support=1 \
|
|
|
|
-Duse_system_icu=1 \
|
|
|
|
-Dconsole=readline \
|
|
|
|
-Dcomponent=shared_library \
|
2014-09-14 05:42:21 +00:00
|
|
|
-Dv8_target_arch=${arch}
|
2014-03-17 21:03:06 +00:00
|
|
|
'';
|
2012-01-18 20:32:23 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
nativeBuildInputs = [ which ];
|
|
|
|
buildInputs = [ readline python icu ];
|
2013-05-23 20:04:32 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
buildFlags = [
|
|
|
|
"LINK=g++"
|
|
|
|
"-C out"
|
|
|
|
"builddir=$(CURDIR)/Release"
|
|
|
|
"BUILDTYPE=Release"
|
|
|
|
];
|
2012-01-18 20:32:23 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
enableParallelBuilding = true;
|
2012-07-25 15:42:15 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -vD out/Release/d8 "$out/bin/d8"
|
|
|
|
${if stdenv.system == "x86_64-darwin" then ''
|
|
|
|
install -vD out/Release/lib.target/libv8.dylib "$out/lib/libv8.dylib"
|
|
|
|
'' else ''
|
|
|
|
install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so"
|
|
|
|
''}
|
|
|
|
cp -vr include "$out/"
|
|
|
|
'';
|
2012-07-25 15:42:15 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
postFixup = if stdenv.isDarwin then ''
|
2015-01-15 04:25:26 +00:00
|
|
|
install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.cc.cc}/lib/libgcc_s.1.dylib $out/bin/d8
|
|
|
|
install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.cc.cc}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib
|
2014-03-17 21:03:06 +00:00
|
|
|
'' else null;
|
2013-08-27 14:16:11 +00:00
|
|
|
|
2014-03-17 21:03:06 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Google's open source JavaScript engine";
|
2014-09-29 22:51:00 +00:00
|
|
|
platforms = with platforms; linux;
|
2014-03-17 21:03:06 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
2010-11-22 14:23:06 +00:00
|
|
|
}
|