v8: Refactor package and update to version 3.25.9.
This now uses fetchurl instead of fetchsvn and now invokes gyp directly instead of copying over the gyp command to the source tree. Also, we're now using stdenv.is64bit to properly determine the host architecture. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
9f45c2cbba
commit
8ddc86d6e4
@ -1,55 +1,56 @@
|
|||||||
{ stdenv, fetchsvn, gyp, readline, python, which }:
|
{ stdenv, fetchurl, gyp, readline, python, which, icu }:
|
||||||
|
|
||||||
assert readline != null;
|
assert readline != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
system = stdenv.system;
|
arch = if stdenv.is64bit then "x64" else "ia32";
|
||||||
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
|
|
||||||
version = "3.14.5.9";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
assert arch != "";
|
stdenv.mkDerivation rec {
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "v8-${version}";
|
name = "v8-${version}";
|
||||||
|
version = "3.25.9";
|
||||||
|
|
||||||
src = fetchsvn {
|
src = fetchurl {
|
||||||
url = "http://v8.googlecode.com/svn/tags/${version}";
|
url = "https://commondatastorage.googleapis.com/chromium-browser-official/"
|
||||||
sha256 = "18qp5qp5xrb6f00w01cklz358yrl54pks963f5rwvwz82d8sfyqr";
|
+ "${name}.tar.bz2";
|
||||||
name = "v8-${version}-src";
|
sha256 = "0x6czv99dr701vljyb4ghyhhc5rmv7vfkpvigcnrqz2an9q1pc28";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./fix-GetLocalizedMessage-usage.patch ];
|
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
mkdir build/gyp
|
PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \
|
||||||
ln -sv ${gyp}/bin/gyp build/gyp/gyp
|
${gyp}/bin/gyp \
|
||||||
|
-f make \
|
||||||
|
--generator-output="out" \
|
||||||
|
-Dflock_index=0 \
|
||||||
|
-Dv8_enable_i18n_support=1 \
|
||||||
|
-Duse_system_icu=1 \
|
||||||
|
-Dconsole=readline \
|
||||||
|
-Dcomponent=shared_library \
|
||||||
|
-Dv8_target_arch=${arch} \
|
||||||
|
--depth=. -Ibuild/standalone.gypi \
|
||||||
|
build/all.gyp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ which ];
|
nativeBuildInputs = [ which ];
|
||||||
buildInputs = [ readline python ];
|
buildInputs = [ readline python icu ];
|
||||||
|
|
||||||
buildFlags = [
|
buildFlags = [
|
||||||
"library=shared"
|
"LINK=g++"
|
||||||
"console=readline"
|
"-C out"
|
||||||
"${arch}.release"
|
"builddir=$(CURDIR)/Release"
|
||||||
|
"BUILDTYPE=Release"
|
||||||
];
|
];
|
||||||
|
|
||||||
# http://code.google.com/p/v8/issues/detail?id=2149
|
|
||||||
NIX_CFLAGS_COMPILE = "-Wno-unused-local-typedefs -Wno-aggressive-loop-optimizations";
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
install -vD out/Release/d8 "$out/bin/d8"
|
||||||
mkdir -p $out/lib
|
${if stdenv.system == "x86_64-darwin" then ''
|
||||||
mv -v out/${arch}.release/d8 $out/bin
|
install -vD out/Release/lib.target/libv8.dylib "$out/lib/libv8.dylib"
|
||||||
|
'' else ''
|
||||||
${if stdenv.system == "x86_64-darwin" then
|
install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so"
|
||||||
"mv -v out/${arch}.release/libv8.dylib $out/lib"
|
''}
|
||||||
else
|
cp -vr include "$out/"
|
||||||
"mv -v out/${arch}.release/lib.target/libv8.so $out/lib"}
|
|
||||||
mv -v include $out/
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = if stdenv.isDarwin then ''
|
postFixup = if stdenv.isDarwin then ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user