Add EventStore package

This turns the V8 expression into a generic build, so that we can
build with the required version.
This commit is contained in:
Brian McKenna 2015-05-07 13:00:01 -06:00
parent 8f74b653d2
commit 1ad2fa452a
5 changed files with 145 additions and 67 deletions

View File

@ -0,0 +1,6 @@
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "3.24.10";
sha256 = "1blz5h9syk93bb4x3shcai3s2jhh6ai4bpymr9rz0f1ysvg60x75";
})

View File

@ -1,69 +1,6 @@
{ stdenv, fetchurl, gyp, readline, python, which, icu }:
{ callPackage, ... } @ args:
assert readline != null;
let
arch = if stdenv.is64bit then "x64" else "ia32";
in
stdenv.mkDerivation rec {
name = "v8-${version}";
callPackage ./generic.nix (args // {
version = "3.30.33.16";
src = fetchurl {
url = "https://commondatastorage.googleapis.com/chromium-browser-official/"
+ "${name}.tar.bz2";
sha256 = "1azf1b36gqj4z5x0k9wq2dkp99zfyhwb0d6i2cl5fjm3k6js7l45";
};
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 ];
buildFlags = [
"LINK=g++"
"-C out"
"builddir=$(CURDIR)/Release"
"BUILDTYPE=Release"
];
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/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/libgcc_s.1.dylib $out/lib/libv8.dylib
'' else null;
meta = with stdenv.lib; {
description = "Google's open source JavaScript engine";
platforms = with platforms; linux;
license = licenses.bsd3;
};
}
sha256 = "1azf1b36gqj4z5x0k9wq2dkp99zfyhwb0d6i2cl5fjm3k6js7l45";
})

View File

@ -0,0 +1,73 @@
{ 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 ];
buildFlags = [
"LINK=g++"
"-C out"
"builddir=$(CURDIR)/Release"
"BUILDTYPE=Release"
];
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/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/libgcc_s.1.dylib $out/lib/libv8.dylib
'' else null;
meta = with stdenv.lib; {
description = "Google's open source JavaScript engine";
platforms = with platforms; linux;
license = licenses.bsd3;
};
}

View File

@ -0,0 +1,54 @@
{ stdenv, fetchgit, fetchpatch, git, mono, v8, icu }:
# 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.0.3";
src = fetchgit {
url = "https://github.com/EventStore/EventStore.git";
rev = "a1382252dd1ed0554ddb04015cdb2cbc1b0a65c1";
sha256 = "07ir6jlli2q1yvsnyw8r8dfril6h1wmfj98yf7a6k81585v2mc6g";
leaveDotGit = true;
};
patches = [
# see: https://github.com/EventStore/EventStore/issues/461
(fetchpatch {
url = https://github.com/EventStore/EventStore/commit/9a0987f19935178df143a3cf876becaa1b11ffae.patch;
sha256 = "04qw0rb1pypa8dqvj94j2mwkc1y6b40zrpkn1d3zfci3k8cam79y";
})
];
buildPhase = ''
ln -s ${v8}/lib/libv8.so src/libs/libv8.so
ln -s ${icu}/lib/libicui18n.so src/libs/libicui18n.so
ln -s ${icu}/lib/libicuuc.so src/libs/libicuuc.so
./build.sh js1
./build.sh quick ${version}
'';
installPhase = ''
mkdir -p $out/{bin,lib/eventstore/clusternode}
cp -r bin/clusternode/* $out/lib/eventstore/clusternode/
cat > $out/bin/clusternode << EOF
#!/bin/sh
exec ${mono}/bin/mono $out/lib/eventstore/clusternode/EventStore.ClusterNode.exe "\$@"
EOF
chmod +x $out/bin/clusternode
'';
buildInputs = [ git v8 mono ];
dontStrip = true;
meta = {
homepage = https://geteventstore.com/;
description = "Event sourcing database with processing logic in JavaScript.";
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ puffnfresh ];
platforms = with stdenv.lib.platforms; linux;
};
}

View File

@ -7832,6 +7832,10 @@ let
inherit (pythonPackages) gyp;
};
v8_3_24_10 = callPackage ../development/libraries/v8/3.24.10.nix {
inherit (pythonPackages) gyp;
};
v8 = callPackage ../development/libraries/v8 {
inherit (pythonPackages) gyp;
};
@ -8425,6 +8429,10 @@ let
elasticmq = callPackage ../servers/elasticmq { };
eventstore = callPackage ../servers/nosql/eventstore {
v8 = v8_3_24_10;
};
etcdctl = callPackage ../development/tools/etcdctl { };
exim = callPackage ../servers/mail/exim { };