diff --git a/pkgs/development/libraries/v8/3.24.10.nix b/pkgs/development/libraries/v8/3.24.10.nix deleted file mode 100644 index e7b10f23ac8..00000000000 --- a/pkgs/development/libraries/v8/3.24.10.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ callPackage, ... } @ args: - -callPackage ./generic.nix (args // { - version = "3.24.10"; - sha256 = "1blz5h9syk93bb4x3shcai3s2jhh6ai4bpymr9rz0f1ysvg60x75"; -}) diff --git a/pkgs/development/libraries/v8/6_x.nix b/pkgs/development/libraries/v8/6_x.nix new file mode 100644 index 00000000000..4095ff20c2b --- /dev/null +++ b/pkgs/development/libraries/v8/6_x.nix @@ -0,0 +1,171 @@ +{ stdenv, lib, fetchgit, fetchFromGitHub, gn, ninja, python, glib, pkgconfig +, doCheck ? false +, snapshot ? true +}: + +let + arch = if stdenv.isArm + then if stdenv.is64bit + then"arm64" + else "arm" + else if stdenv.is64bit + then"x64" + else "ia32"; + git_url = "https://chromium.googlesource.com"; + + deps = { + "base/trace_event/common" = fetchgit { + url = "${git_url}/chromium/src/base/trace_event/common.git"; + rev = "65d1d42a5df6c0a563a6fdfa58a135679185e5d9"; + sha256 = "0ikk0dj12adzr0138jrmwzhx8n9sl5qzs86a3mc3gva08a8wc84p"; + }; + "build" = fetchgit { + url = "${git_url}/chromium/src/build.git"; + rev = "48a2b7b39debc7c77c868c9ddb0a360af1ebc367"; + sha256 = "0aj554dfdbwnikwaapznfq55wkwbvg4114h7qamixy8ryjkaiy0k"; + }; + "buildtools" = fetchgit { + url = "${git_url}/chromium/buildtools.git"; + rev = "5af0a3a8b89827a8634132080a39ab4b63dee489"; + sha256 = "1841803m40w1hmnmm7qzdpk4b6q1m8cb7q4hsflqfpddpf4lp3v1"; + }; + "test/benchmarks/data" = fetchgit { + url = "${git_url}/v8/deps/third_party/benchmarks.git"; + rev = "05d7188267b4560491ff9155c5ee13e207ecd65f"; + sha256 = "0ad2ay14bn67d61ks4dmzadfnhkj9bw28r4yjdjjyzck7qbnzchl"; + }; + "test/mozilla/data" = fetchgit { + url = "${git_url}/v8/deps/third_party/mozilla-tests.git"; + rev = "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be"; + sha256 = "0rfdan76yfawqxbwwb35aa57b723j3z9fx5a2w16nls02yk2kqyn"; + }; + "test/test262/data" = fetchgit { + url = "${git_url}/external/github.com/tc39/test262.git"; + rev = "1b911a8f8abf4cb63882cfbe72dcd4c82bb8ad91"; + sha256 = "1hbp7vv41k7jka8azc78hhw4qng7gckr6dz1van7cyd067znwvr4"; + }; + "test/test262/harness" = fetchgit { + url = "${git_url}/external/github.com/test262-utils/test262-harness-py.git"; + rev = "0f2acdd882c84cff43b9d60df7574a1901e2cdcd"; + sha256 = "00brj5avp43yamc92kinba2mg3a2x1rcd7wnm7z093l73idprvkp"; + }; + "test/wasm-js" = fetchgit { + url = "${git_url}/external/github.com/WebAssembly/spec.git"; + rev = "17b4a4d98c80b1ec736649d5a73496a0e6d12d4c"; + sha256 = "03nyrrqffzj6xrmqi1v7f9m9395bdk53x301fy5mcq4hhpq6rsjr"; + }; + "testing/gmock" = fetchgit { + url = "${git_url}/external/googlemock.git"; + rev = "0421b6f358139f02e102c9c332ce19a33faf75be"; + sha256 = "1xiky4v98maxs8fg1avcd56y0alv3hw8qyrlpd899zgzbq2k10pp"; + }; + "testing/gtest" = fetchgit { + url = "${git_url}/external/github.com/google/googletest.git"; + rev = "6f8a66431cb592dad629028a50b3dd418a408c87"; + sha256 = "0bdba2lr6pg15bla9600zg0r0vm4lnrx0wqz84p376wfdxra24vw"; + }; + "third_party/icu" = fetchgit { + url = "${git_url}/chromium/deps/icu.git"; + rev = "08cb956852a5ccdba7f9c941728bb833529ba3c6"; + sha256 = "0vn2iv068kmcjqqx5cgyha80x9iraz11hpx3q4n3rkvrlvbb3d7b"; + }; + "third_party/instrumented_libraries" = fetchgit { + url = "${git_url}/chromium/src/third_party/instrumented_libraries.git"; + rev = "644afd349826cb68204226a16c38bde13abe9c3c"; + sha256 = "0d1vkwilgv1a4ghazn623gwmm7h51padpfi94qrmig1y748xfwfa"; + }; + # templates of code generator require jinja2 2.8 (while nixpkgs has 2.9.5, which breaks the template) + "third_party/jinja2" = fetchgit { + url = "${git_url}/chromium/src/third_party/jinja2.git"; + rev = "d34383206fa42d52faa10bb9931d6d538f3a57e0"; + sha256 = "0d9hyw0bvp3p0dbwy833cm9vdqxcam0qbm9jc561ynphddxlkmgd"; + }; + "third_party/markupsafe" = fetchgit { + url = "${git_url}/chromium/src/third_party/markupsafe.git"; + rev = "8f45f5cfa0009d2a70589bcda0349b8cb2b72783"; + sha256 = "168ppjmicfdh4i1l0l25s86mdbrz9fgxmiq1rx33x79mph41scfz"; + }; + "tools/clang" = fetchgit { + url = "${git_url}/chromium/src/tools/clang.git"; + rev = "40f69660bf3cd407e72b8ae240fdd6c513dddbfe"; + sha256 = "1plkb9dcn34yd6lad7w59s9vqwmcc592dasgdk232spkafpg8qcf"; + }; + }; + +in + +stdenv.mkDerivation rec { + name = "v8-${version}"; + version = "6.2.414.27"; + + inherit doCheck; + + src = fetchFromGitHub { + owner = "v8"; + repo = "v8"; + rev = version; + sha256 = "15zrb9bcpnhljhrilqnjaak3a4xnhj8li6ra12g3gkrw3fzir9a2"; + }; + + postUnpack = '' + ${lib.concatStringsSep "\n" ( + lib.mapAttrsToList (n: v: '' + mkdir -p $sourceRoot/${n} + cp -r ${v}/* $sourceRoot/${n} + '') deps)} + ''; + + prePatch = '' + # use our gn, not the bundled one + sed -i -e 's#gn_path = .*#gn_path = "${gn}/bin/gn"#' tools/mb/mb.py + + # disable tests + if [ "$doCheck" = "" ]; then sed -i -e '/"test:gn_all",/d' BUILD.gn; fi + + # disable sysroot usage + chmod u+w build/config build/config/sysroot.gni + sed -i build/config/sysroot.gni \ + -e '/use_sysroot =/ { s#\(use_sysroot =\).*#\1 false#; :a n; /current_cpu/ { s/^/#/; ba }; }' + + # patch shebangs (/usr/bin/env) + patchShebangs tools/dev/v8gen.py + ''; + + configurePhase = '' + tools/dev/v8gen.py -vv ${arch}.release -- \ + is_component_build=true \ + ${if snapshot then "v8_use_external_startup_data=false" else "v8_use_snapshot=false" } \ + is_clang=false \ + linux_use_bundled_binutils=false \ + treat_warnings_as_errors=false + ''; + + nativeBuildInputs = [ gn ninja pkgconfig ]; + buildInputs = [ python glib ]; + + buildPhase = '' + ninja -C out.gn/${arch}.release/ + ''; + + enableParallelBuilding = true; + + installPhase = '' + install -vD out.gn/${arch}.release/d8 "$out/bin/d8" + install -vD out.gn/${arch}.release/mksnapshot "$out/bin/mksnapshot" + mkdir -p "$out/lib" + for f in libicui18n.so libicuuc.so libv8_libbase.so libv8_libplatform.so libv8.so; do + install -vD out.gn/${arch}.release/$f "$out/lib/$f" + done + install -vD out.gn/${arch}.release/icudtl.dat "$out/lib/icudtl.dat" + mkdir -p "$out/include" + cp -vr include/*.h "$out/include" + cp -vr include/libplatform "$out/include" + ''; + + meta = with lib; { + description = "Google's open source JavaScript engine"; + maintainers = with maintainers; [ cstrahan proglodyte ]; + platforms = platforms.linux; + license = licenses.bsd3; + }; +} diff --git a/pkgs/development/libraries/v8/generic.nix b/pkgs/development/libraries/v8/generic.nix deleted file mode 100644 index d603fda3225..00000000000 --- a/pkgs/development/libraries/v8/generic.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ stdenv, fetchurl, gyp, readline, python, which, icu -, version -, sha256 -, ... -}: - -assert readline != null; - -let - arch = if stdenv.is64bit then "x64" else "ia32"; -in - -stdenv.mkDerivation rec { - name = "v8-${version}"; - inherit version; - - src = fetchurl { - url = "https://commondatastorage.googleapis.com/chromium-browser-official/" - + "${name}.tar.bz2"; - inherit sha256; - }; - - patchPhase = '' - sed -i 's,#!/usr/bin/env 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 ]; - - NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow"; - - 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; - }; -} diff --git a/pkgs/development/libraries/v8/update.sh b/pkgs/development/libraries/v8/update.sh new file mode 100755 index 00000000000..f046bb8e688 --- /dev/null +++ b/pkgs/development/libraries/v8/update.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p curl -p nix-prefetch-git +VERSION_OVERVIEW=https://omahaproxy.appspot.com/all?os=linux +TARGET_CHANNEL=beta +FILE_PATH=6_x.nix + +set -eo pipefail + +v8_version=$(curl -s "$VERSION_OVERVIEW" | awk -F "," "\$2 ~ /${TARGET_CHANNEL}/ { print \$11 }") + +echo "Using V8 version --> $v8_version" +sed -e "s#\\(version = \\)\"[0-9\.]*\"#\1\"$v8_version\"#" -i ${FILE_PATH} + +sha256=$(nix-prefetch-git --no-deepClone https://github.com/v8/v8.git "refs/tags/${v8_version}" \ + | sed -ne '/sha256/ { s#.*: "\(.*\)".*#\1#; p }') +sed -e "/repo = \"v8\"/ { n;n; s#\".*\"#\"${sha256}\"# }" -i ${FILE_PATH} + +deps="$(mktemp)" + +curl -s -o "$deps" "https://raw.githubusercontent.com/v8/v8/${v8_version}/DEPS" +echo $deps + +sed -ne '/= fetchgit {/ { s/.*"\(.*\)".*/\1/; p }' < ${FILE_PATH} | while read dep; do + echo "Processing dependency --> $dep" + escaped_dep=$(echo "$dep" | sed -e 's#/#\\/#g') + dep_rev=$(sed -ne "/\"v8\/${escaped_dep}\":/ { n; s#.*+ \"##; s#\".*##; p }" "$deps") + + if [ "$dep_rev" = "" ]; then + echo "Failed to resolve dependency $dep, not listed in DEPS file" + rm -f "$deps" + exit 2 + fi + + repo_url=$(sed -ne "/\"${escaped_dep}\" = fetchgit/ { n; s/.*\"\(.*\)\".*/\1/; s#\${git_url}#https://chromium.googlesource.com#; p }" ${FILE_PATH}) + sha256=$(nix-prefetch-git --no-deepClone "$repo_url" "$dep_rev" 2>/dev/null | sed -ne '/sha256/ { s#.*: "\(.*\)".*#\1#; p }') + + if [ "$sha256" = "" ]; then + echo "Failed to get sha256 via nix-prefetch-git $repo_url $dep_rev" + rm -f "$deps" + exit 2 + fi + + sed -e "/\"${escaped_dep}\" = fetchgit/ { n; n; s/\".*\"/\"${dep_rev}\"/; n; s/\".*\"/\"${sha256}\"/ }" -i ${FILE_PATH} +done + +rm -f "$deps" +echo done. diff --git a/pkgs/development/tools/build-managers/gn/default.nix b/pkgs/development/tools/build-managers/gn/default.nix new file mode 100644 index 00000000000..5e7dd5214a0 --- /dev/null +++ b/pkgs/development/tools/build-managers/gn/default.nix @@ -0,0 +1,77 @@ +{ stdenv, lib, fetchgit, fetchurl, libevent, ninja, python }: + +let + depsGit = { + "tools/gn" = fetchgit { + url = "https://chromium.googlesource.com/chromium/src/tools/gn"; + rev = "d0c518db129975ce88ff1de26c857873b0619c4b"; + sha256 = "0l15vzmjyx6bwlz1qhn3fy7yx3qzzxr3drnkj3l0p0fmyxza52vx"; + }; + "base" = fetchgit { + url = "https://chromium.googlesource.com/chromium/src/base"; + rev = "bc6e3ce8ca01b894751e1f7b22b561e3ae2e7f17"; + sha256 = "1yl49v6nxbrfms52xf7fiwh7d4301m2aj744pa3hzzh989c5j6g5"; + }; + "build" = fetchgit { + url = "https://chromium.googlesource.com/chromium/src/build"; + rev = "e934a19ae908081fba13769924e4ea45a7a451ce"; + sha256 = "0jhy418vaiin7djg9zvk83f8zhasigki4442x5j7gkmgmgmyc4am"; + }; + "config" = fetchgit { + url = "https://chromium.googlesource.com/chromium/src/build/config"; + rev = "df16c6a2c070704b0a25efe46ee9af16de1e65b3"; + sha256 = "1x18syzz1scwhd8lf448hy5lnfpq118l403x9qmwm0np318w09wg"; + }; + "testing/gtest" = fetchgit { + url = "https://chromium.googlesource.com/chromium/testing/gtest"; + rev = "585ec31ea716f08233a815e680fc0d4699843938"; + sha256 = "0csn1cza66851nmxxiw42smsm3422mx67vcyykwn0a71lcjng6rc"; + }; + }; + +in + stdenv.mkDerivation rec { + name = "gn"; + version = "0.0.0.20170629"; + sourceRoot = "."; + + unpackPhase = '' + ${lib.concatStringsSep "\n" ( + lib.mapAttrsToList (n: v: '' + mkdir -p $sourceRoot/${n} + cp -r ${v}/* $sourceRoot/${n} + '') depsGit)} + ''; + + postPatch = '' + # Patch shebands (for sandbox build) + chmod u+w -R build + patchShebangs build + + # Patch out Chromium-bundled libevent + chmod u+w tools/gn/bootstrap tools/gn/bootstrap/bootstrap.py + sed -i -e '/static_libraries.*libevent/,/^ *\]\?[})]$/d' \ + tools/gn/bootstrap/bootstrap.py + ''; + + NIX_LDFLAGS = "-levent"; + + nativeBuildInputs = [ ninja python ]; + buildInputs = [ libevent ]; + + buildPhase = '' + python tools/gn/bootstrap/bootstrap.py -s + ''; + + installPhase = '' + install -vD out/Release/gn "$out/bin/gn" + ''; + + meta = with stdenv.lib; { + description = "A meta-build system that generates NinjaBuild files"; + homepage = https://chromium.googlesource.com/chromium/src/tools/gn; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = [ maintainers.stesie ]; + }; + } diff --git a/pkgs/servers/nosql/eventstore/default.nix b/pkgs/servers/nosql/eventstore/default.nix index 572cfe1f17d..e6bf634b554 100644 --- a/pkgs/servers/nosql/eventstore/default.nix +++ b/pkgs/servers/nosql/eventstore/default.nix @@ -1,16 +1,16 @@ -{ stdenv, fetchFromGitHub, fetchpatch, mono, v8 }: +{ stdenv, fetchFromGitHub, fetchpatch, git, mono, v8 }: # There are some similarities with the pinta derivation. We should # have a helper to make it easy to package these Mono apps. stdenv.mkDerivation rec { name = "EventStore-${version}"; - version = "3.5.0"; + version = "4.0.3"; src = fetchFromGitHub { owner = "EventStore"; repo = "EventStore"; rev = "oss-v${version}"; - sha256 = "0dp5914hxwdzw62q49wavqfqkw3jy0dvml09y7gh8frnbiajcxq9"; + sha256 = "1905bnqyyiqprva67cp49rgib324iipw2l71jzj0ynzi7kxr4mgg"; }; buildPhase = '' @@ -33,6 +33,7 @@ stdenv.mkDerivation rec { chmod +x $out/bin/clusternode ''; + nativeBuildInputs = [ git ]; buildInputs = [ v8 mono ]; phases = [ "unpackPhase" "buildPhase" "installPhase" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 18bb248c33c..8d87a483bee 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7391,6 +7391,8 @@ with pkgs; ninja = callPackage ../development/tools/build-managers/ninja { }; + gn = callPackage ../development/tools/build-managers/gn { }; + nixbang = callPackage ../development/tools/misc/nixbang { pythonPackages = python3Packages; }; @@ -10840,9 +10842,8 @@ with pkgs; stdenv = overrideCC stdenv gcc5; }; - v8_3_24_10 = callPackage ../development/libraries/v8/3.24.10.nix { - inherit (python2Packages) python gyp; - stdenv = overrideCC stdenv gcc5; + v8_6_x = callPackage ../development/libraries/v8/6_x.nix { + inherit (python2Packages) python; }; v8 = callPackage ../development/libraries/v8 { @@ -11458,7 +11459,8 @@ with pkgs; elasticmq = callPackage ../servers/elasticmq { }; eventstore = callPackage ../servers/nosql/eventstore { - v8 = v8_3_24_10; + mono = mono46; + v8 = v8_6_x; }; etcdctl = etcd; diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 20b8c15f388..5e6192bf673 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -267,44 +267,23 @@ let }; v8 = assert isPhp7; buildPecl rec { - version = "0.1.0"; + version = "0.1.9"; name = "v8-${version}"; - src = pkgs.fetchurl { - url = "https://github.com/pinepain/php-v8/archive/v${version}.tar.gz"; - sha256 = "18smnxd34b486f5n8j0wk9z7r5x1w84v89mgf76z0bn7gxdxl0xj"; - }; + sha256 = "0bj77dfmld5wfwl4wgqnpa0i4f3mc1mpsp9dmrwqv050gs84m7h1"; - buildInputs = [ pkgs.v8 ]; - configureFlags = [ "--with-v8=${pkgs.v8}" ]; - - patches = [ - (builtins.toFile "link-libv8_libbase.patch" '' - Index: php-v8/config.m4 - =================================================================== - --- php-v8.orig/config.m4 - +++ php-v8/config.m4 - @@ -69,7 +69,7 @@ if test "$PHP_V8" != "no"; then - #static_link_extra="libv8_base.a libv8_libbase.a libv8_libplatform.a libv8_snapshot.a" - ;; - * ) - - static_link_extra="libv8_libplatform.a" - + static_link_extra="libv8_libplatform.a libv8_libbase.a" - #static_link_extra="libv8_base.a libv8_libbase.a libv8_libplatform.a libv8_snapshot.a" - ;; - esac - '' - )]; + buildInputs = [ pkgs.v8_6_x ]; + configureFlags = [ "--with-v8=${pkgs.v8_6_x}" ]; }; v8js = assert isPhp7; buildPecl rec { - version = "1.3.2"; + version = "1.4.1"; name = "v8js-${version}"; - sha256 = "1x7gxi70zgj3vaxs89nfbnwlqcxrps1inlyfzz66pbzdbfwvc8z8"; + sha256 = "0k5dc395gzva4l6n9mzvkhkjq914460cwk1grfandcqy73j6m89q"; - buildInputs = [ pkgs.v8 ]; - configureFlags = [ "--with-v8js=${pkgs.v8}" ]; + buildInputs = [ pkgs.v8_6_x ]; + configureFlags = [ "--with-v8js=${pkgs.v8_6_x}" ]; }; composer = pkgs.stdenv.mkDerivation rec {