summary refs log tree commit diff
path: root/pkgs/development/libraries/v8
diff options
context:
space:
mode:
authorHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>2017-10-21 14:22:52 +1300
committerDomen Kožar <domen@enlambda.com>2017-10-21 11:29:21 +0100
commit8870d1a67da3c70dd37448d2e3190696f560a3bf (patch)
tree9783503476ff3c367e476bd471ce4d5aa06602ee /pkgs/development/libraries/v8
parent43f94ff5a9bba9608b078e3ff9c74d66d3ab01f1 (diff)
downloadnixpkgs-8870d1a67da3c70dd37448d2e3190696f560a3bf.tar
nixpkgs-8870d1a67da3c70dd37448d2e3190696f560a3bf.tar.gz
nixpkgs-8870d1a67da3c70dd37448d2e3190696f560a3bf.tar.bz2
nixpkgs-8870d1a67da3c70dd37448d2e3190696f560a3bf.tar.lz
nixpkgs-8870d1a67da3c70dd37448d2e3190696f560a3bf.tar.xz
nixpkgs-8870d1a67da3c70dd37448d2e3190696f560a3bf.tar.zst
nixpkgs-8870d1a67da3c70dd37448d2e3190696f560a3bf.zip
r-modules: Fix a number of popular R packages
The R V8 package still depends on V8 3.14 so this is also included.
Diffstat (limited to 'pkgs/development/libraries/v8')
-rw-r--r--pkgs/development/libraries/v8/3.14.nix86
1 files changed, 86 insertions, 0 deletions
diff --git a/pkgs/development/libraries/v8/3.14.nix b/pkgs/development/libraries/v8/3.14.nix
new file mode 100644
index 00000000000..9112079a90e
--- /dev/null
+++ b/pkgs/development/libraries/v8/3.14.nix
@@ -0,0 +1,86 @@
+# This old version of V8 is still needed for the R V8 module
+{ stdenv, callPackage, fetchFromGitHub, gyp, readline, python, which, icu, ... }:
+
+assert readline != null;
+
+with stdenv.lib;
+let
+  version = "3.14.5.10";
+  sha256 = "08vhl84166x13b3cbx8y0g99yqx772zd33gawsa1nxqkyrykql6k";
+
+  arch = if stdenv.is64bit then "x64" else "ia32";
+
+in
+stdenv.mkDerivation rec {
+  name = "v8-${version}";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "v8";
+    repo = "v8";
+    rev = "${version}";
+    inherit sha256;
+  };
+  patchPhase = ''
+    sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,' build/gyp_v8
+    sed -i 's,#!/usr/bin/python,#!${python}/bin/python,' build/gyp_v8
+  '';
+
+  configurePhase = ''
+    PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \
+    PYTHONPATH="$(toPythonPath ${gyp}):$PYTHONPATH" \
+      build/gyp_v8 \
+        -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}
+  '';
+
+  nativeBuildInputs = [ which ];
+  buildInputs = [ readline python icu ];
+
+  # http://code.google.com/p/v8/issues/detail?id=2149
+  NIX_CFLAGS_COMPILE = concatStringsSep " " [
+    "-Wno-error=strict-overflow"
+    "-Wno-unused-local-typedefs"
+    "-Wno-aggressive-loop-optimizations"
+  ];
+
+  buildFlags = [
+    "LINK=g++"
+    "-C out"
+    "builddir=$(CURDIR)/Release"
+    "BUILDTYPE=Release"
+  ];
+
+  postPatch = stdenv.lib.optionalString (!stdenv.cc.isClang) ''
+    sed -i build/standalone.gyp -e 's,-Wno-format-pedantic,,g'
+  '';
+
+  enableParallelBuilding = true;
+
+  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/"
+  '';
+
+  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.cc.cc.lib}/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}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib
+  '' else null;
+
+  meta = with stdenv.lib; {
+    description = "Google's open source JavaScript engine";
+    platforms = platforms.linux;
+    license = licenses.bsd3;
+  };
+}