summary refs log tree commit diff
path: root/pkgs/servers/nosql/eventstore/default.nix
blob: 9cb5dd41c1c3f06ad0aac2cd15be8e4c0ce6b2fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ 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

    patchShebangs build.sh
    ./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;
  };
}