diff options
author | aszlig <aszlig@redmoonstudios.org> | 2014-03-17 22:03:06 +0100 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2014-04-19 03:58:38 +0200 |
commit | 8ddc86d6e486e577afb746c55cbec181f372f6b5 (patch) | |
tree | 8c81b73cd6563187938b324b852794932726c3d2 /pkgs/development/libraries/v8/default.nix | |
parent | 9f45c2cbbab6ac763860c1b5d58c36a2208685a5 (diff) | |
download | nixpkgs-8ddc86d6e486e577afb746c55cbec181f372f6b5.tar nixpkgs-8ddc86d6e486e577afb746c55cbec181f372f6b5.tar.gz nixpkgs-8ddc86d6e486e577afb746c55cbec181f372f6b5.tar.bz2 nixpkgs-8ddc86d6e486e577afb746c55cbec181f372f6b5.tar.lz nixpkgs-8ddc86d6e486e577afb746c55cbec181f372f6b5.tar.xz nixpkgs-8ddc86d6e486e577afb746c55cbec181f372f6b5.tar.zst nixpkgs-8ddc86d6e486e577afb746c55cbec181f372f6b5.zip |
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>
Diffstat (limited to 'pkgs/development/libraries/v8/default.nix')
-rw-r--r-- | pkgs/development/libraries/v8/default.nix | 101 |
1 files changed, 51 insertions, 50 deletions
diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix index 0564e688795..db8e491caae 100644 --- a/pkgs/development/libraries/v8/default.nix +++ b/pkgs/development/libraries/v8/default.nix @@ -1,65 +1,66 @@ -{ stdenv, fetchsvn, gyp, readline, python, which }: +{ stdenv, fetchurl, gyp, readline, python, which, icu }: 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.14.5.9"; + arch = if stdenv.is64bit then "x64" else "ia32"; in -assert arch != ""; +stdenv.mkDerivation rec { + name = "v8-${version}"; + version = "3.25.9"; -stdenv.mkDerivation { - name = "v8-${version}"; + src = fetchurl { + url = "https://commondatastorage.googleapis.com/chromium-browser-official/" + + "${name}.tar.bz2"; + sha256 = "0x6czv99dr701vljyb4ghyhhc5rmv7vfkpvigcnrqz2an9q1pc28"; + }; - src = fetchsvn { - url = "http://v8.googlecode.com/svn/tags/${version}"; - sha256 = "18qp5qp5xrb6f00w01cklz358yrl54pks963f5rwvwz82d8sfyqr"; - name = "v8-${version}-src"; - }; + configurePhase = '' + PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \ + ${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 + ''; - patches = [ ./fix-GetLocalizedMessage-usage.patch ]; + nativeBuildInputs = [ which ]; + buildInputs = [ readline python icu ]; - configurePhase = '' - mkdir build/gyp - ln -sv ${gyp}/bin/gyp build/gyp/gyp - ''; + buildFlags = [ + "LINK=g++" + "-C out" + "builddir=$(CURDIR)/Release" + "BUILDTYPE=Release" + ]; - nativeBuildInputs = [ which ]; - buildInputs = [ readline python ]; + enableParallelBuilding = true; - buildFlags = [ - "library=shared" - "console=readline" - "${arch}.release" - ]; + 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/" + ''; - # http://code.google.com/p/v8/issues/detail?id=2149 - NIX_CFLAGS_COMPILE = "-Wno-unused-local-typedefs -Wno-aggressive-loop-optimizations"; + postFixup = if stdenv.isDarwin then '' + install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/bin/d8 + install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib + '' else null; - 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/ - ''; - - postFixup = if stdenv.isDarwin then '' - install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/bin/d8 - install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib - '' else null; - - meta = with stdenv.lib; { - description = "V8 is Google's open source JavaScript engine"; - platforms = platforms.linux ++ platforms.darwin; - license = licenses.bsd3; - }; + meta = with stdenv.lib; { + description = "V8 is Google's open source JavaScript engine"; + platforms = platforms.linux ++ platforms.darwin; + license = licenses.bsd3; + }; } |