Add EventStore package

This turns the V8 expression into a generic build, so that we can
build with the required version.

authored by Brian McKenna and committed by Domen Kožar a6f1db46 4081886d

+145 -67
+6
pkgs/development/libraries/v8/3.24.10.nix
···
··· 1 + { callPackage, ... } @ args: 2 + 3 + callPackage ./generic.nix (args // { 4 + version = "3.24.10"; 5 + sha256 = "1blz5h9syk93bb4x3shcai3s2jhh6ai4bpymr9rz0f1ysvg60x75"; 6 + })
+4 -67
pkgs/development/libraries/v8/default.nix
··· 1 - { stdenv, fetchurl, gyp, readline, python, which, icu }: 2 3 - assert readline != null; 4 - 5 - let 6 - arch = if stdenv.is64bit then "x64" else "ia32"; 7 - in 8 - 9 - stdenv.mkDerivation rec { 10 - name = "v8-${version}"; 11 version = "3.30.33.16"; 12 - 13 - src = fetchurl { 14 - url = "https://commondatastorage.googleapis.com/chromium-browser-official/" 15 - + "${name}.tar.bz2"; 16 - sha256 = "1azf1b36gqj4z5x0k9wq2dkp99zfyhwb0d6i2cl5fjm3k6js7l45"; 17 - }; 18 - 19 - patchPhase = '' 20 - sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,' build/gyp_v8 21 - ''; 22 - 23 - configurePhase = '' 24 - PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \ 25 - PYTHONPATH="$(toPythonPath ${gyp}):$PYTHONPATH" \ 26 - build/gyp_v8 \ 27 - -f make \ 28 - --generator-output="out" \ 29 - -Dflock_index=0 \ 30 - -Dv8_enable_i18n_support=1 \ 31 - -Duse_system_icu=1 \ 32 - -Dconsole=readline \ 33 - -Dcomponent=shared_library \ 34 - -Dv8_target_arch=${arch} 35 - ''; 36 - 37 - nativeBuildInputs = [ which ]; 38 - buildInputs = [ readline python icu ]; 39 - 40 - buildFlags = [ 41 - "LINK=g++" 42 - "-C out" 43 - "builddir=$(CURDIR)/Release" 44 - "BUILDTYPE=Release" 45 - ]; 46 - 47 - enableParallelBuilding = true; 48 - 49 - installPhase = '' 50 - install -vD out/Release/d8 "$out/bin/d8" 51 - ${if stdenv.system == "x86_64-darwin" then '' 52 - install -vD out/Release/lib.target/libv8.dylib "$out/lib/libv8.dylib" 53 - '' else '' 54 - install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so" 55 - ''} 56 - cp -vr include "$out/" 57 - ''; 58 - 59 - postFixup = if stdenv.isDarwin then '' 60 - 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 61 - 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 62 - '' else null; 63 - 64 - meta = with stdenv.lib; { 65 - description = "Google's open source JavaScript engine"; 66 - platforms = with platforms; linux; 67 - license = licenses.bsd3; 68 - }; 69 - }
··· 1 + { callPackage, ... } @ args: 2 3 + callPackage ./generic.nix (args // { 4 version = "3.30.33.16"; 5 + sha256 = "1azf1b36gqj4z5x0k9wq2dkp99zfyhwb0d6i2cl5fjm3k6js7l45"; 6 + })
+73
pkgs/development/libraries/v8/generic.nix
···
··· 1 + { stdenv, fetchurl, gyp, readline, python, which, icu 2 + , version 3 + , sha256 4 + , ... 5 + }: 6 + 7 + assert readline != null; 8 + 9 + let 10 + arch = if stdenv.is64bit then "x64" else "ia32"; 11 + in 12 + 13 + stdenv.mkDerivation rec { 14 + name = "v8-${version}"; 15 + inherit version; 16 + 17 + src = fetchurl { 18 + url = "https://commondatastorage.googleapis.com/chromium-browser-official/" 19 + + "${name}.tar.bz2"; 20 + inherit sha256; 21 + }; 22 + 23 + patchPhase = '' 24 + sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,' build/gyp_v8 25 + ''; 26 + 27 + configurePhase = '' 28 + PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \ 29 + PYTHONPATH="$(toPythonPath ${gyp}):$PYTHONPATH" \ 30 + build/gyp_v8 \ 31 + -f make \ 32 + --generator-output="out" \ 33 + -Dflock_index=0 \ 34 + -Dv8_enable_i18n_support=1 \ 35 + -Duse_system_icu=1 \ 36 + -Dconsole=readline \ 37 + -Dcomponent=shared_library \ 38 + -Dv8_target_arch=${arch} 39 + ''; 40 + 41 + nativeBuildInputs = [ which ]; 42 + buildInputs = [ readline python icu ]; 43 + 44 + buildFlags = [ 45 + "LINK=g++" 46 + "-C out" 47 + "builddir=$(CURDIR)/Release" 48 + "BUILDTYPE=Release" 49 + ]; 50 + 51 + enableParallelBuilding = true; 52 + 53 + installPhase = '' 54 + install -vD out/Release/d8 "$out/bin/d8" 55 + ${if stdenv.system == "x86_64-darwin" then '' 56 + install -vD out/Release/lib.target/libv8.dylib "$out/lib/libv8.dylib" 57 + '' else '' 58 + install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so" 59 + ''} 60 + cp -vr include "$out/" 61 + ''; 62 + 63 + postFixup = if stdenv.isDarwin then '' 64 + 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 65 + 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 66 + '' else null; 67 + 68 + meta = with stdenv.lib; { 69 + description = "Google's open source JavaScript engine"; 70 + platforms = with platforms; linux; 71 + license = licenses.bsd3; 72 + }; 73 + }
+54
pkgs/servers/nosql/eventstore/default.nix
···
··· 1 + { stdenv, fetchgit, fetchpatch, git, mono, v8, icu }: 2 + 3 + # There are some similarities with the pinta derivation. We should 4 + # have a helper to make it easy to package these Mono apps. 5 + 6 + stdenv.mkDerivation rec { 7 + name = "EventStore-${version}"; 8 + version = "3.0.3"; 9 + src = fetchgit { 10 + url = "https://github.com/EventStore/EventStore.git"; 11 + rev = "a1382252dd1ed0554ddb04015cdb2cbc1b0a65c1"; 12 + sha256 = "07ir6jlli2q1yvsnyw8r8dfril6h1wmfj98yf7a6k81585v2mc6g"; 13 + leaveDotGit = true; 14 + }; 15 + 16 + patches = [ 17 + # see: https://github.com/EventStore/EventStore/issues/461 18 + (fetchpatch { 19 + url = https://github.com/EventStore/EventStore/commit/9a0987f19935178df143a3cf876becaa1b11ffae.patch; 20 + sha256 = "04qw0rb1pypa8dqvj94j2mwkc1y6b40zrpkn1d3zfci3k8cam79y"; 21 + }) 22 + ]; 23 + 24 + buildPhase = '' 25 + ln -s ${v8}/lib/libv8.so src/libs/libv8.so 26 + ln -s ${icu}/lib/libicui18n.so src/libs/libicui18n.so 27 + ln -s ${icu}/lib/libicuuc.so src/libs/libicuuc.so 28 + 29 + ./build.sh js1 30 + ./build.sh quick ${version} 31 + ''; 32 + 33 + installPhase = '' 34 + mkdir -p $out/{bin,lib/eventstore/clusternode} 35 + cp -r bin/clusternode/* $out/lib/eventstore/clusternode/ 36 + cat > $out/bin/clusternode << EOF 37 + #!/bin/sh 38 + exec ${mono}/bin/mono $out/lib/eventstore/clusternode/EventStore.ClusterNode.exe "\$@" 39 + EOF 40 + chmod +x $out/bin/clusternode 41 + ''; 42 + 43 + buildInputs = [ git v8 mono ]; 44 + 45 + dontStrip = true; 46 + 47 + meta = { 48 + homepage = https://geteventstore.com/; 49 + description = "Event sourcing database with processing logic in JavaScript."; 50 + license = stdenv.lib.licenses.bsd3; 51 + maintainers = with stdenv.lib.maintainers; [ puffnfresh ]; 52 + platforms = with stdenv.lib.platforms; linux; 53 + }; 54 + }
+8
pkgs/top-level/all-packages.nix
··· 7879 inherit (pythonPackages) gyp; 7880 }; 7881 7882 v8 = callPackage ../development/libraries/v8 { 7883 inherit (pythonPackages) gyp; 7884 }; ··· 8470 }; 8471 8472 elasticmq = callPackage ../servers/elasticmq { }; 8473 8474 etcdctl = callPackage ../development/tools/etcdctl { }; 8475
··· 7879 inherit (pythonPackages) gyp; 7880 }; 7881 7882 + v8_3_24_10 = callPackage ../development/libraries/v8/3.24.10.nix { 7883 + inherit (pythonPackages) gyp; 7884 + }; 7885 + 7886 v8 = callPackage ../development/libraries/v8 { 7887 inherit (pythonPackages) gyp; 7888 }; ··· 8474 }; 8475 8476 elasticmq = callPackage ../servers/elasticmq { }; 8477 + 8478 + eventstore = callPackage ../servers/nosql/eventstore { 8479 + v8 = v8_3_24_10; 8480 + }; 8481 8482 etcdctl = callPackage ../development/tools/etcdctl { }; 8483