1{
2 lib,
3 git,
4 dotnetCorePackages,
5 glibcLocales,
6 buildDotnetModule,
7 fetchFromGitHub,
8 bintools,
9 stdenv,
10 mono,
11}:
12let
13 mainProgram = "EventStore.ClusterNode";
14in
15
16buildDotnetModule rec {
17 pname = "EventStore";
18 version = "23.6.0";
19
20 src = fetchFromGitHub {
21 owner = "EventStore";
22 repo = "EventStore";
23 rev = "oss-v${version}";
24 hash = "sha256-+Wxm6yusaCoqXIbsi0ZoALAviKUyNMQwbzsQtBK/PCo=";
25 leaveDotGit = true;
26 };
27
28 # Fixes application reporting 0.0.0.0 as its version.
29 MINVERVERSIONOVERRIDE = version;
30
31 dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
32 dotnet-runtime = dotnetCorePackages.aspnetcore_6_0-bin;
33
34 nativeBuildInputs = [
35 git
36 glibcLocales
37 bintools
38 ];
39
40 runtimeDeps = [ mono ];
41
42 executables = [ mainProgram ];
43
44 # This test has a problem running on macOS
45 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
46 "EventStore.Projections.Core.Tests.Services.grpc_service.ServerFeaturesTests<LogFormat+V2,String>.should_receive_expected_endpoints"
47 "EventStore.Projections.Core.Tests.Services.grpc_service.ServerFeaturesTests<LogFormat+V3,UInt32>.should_receive_expected_endpoints"
48 ];
49
50 nugetDeps = ./deps.json;
51
52 projectFile = "src/EventStore.ClusterNode/EventStore.ClusterNode.csproj";
53
54 doCheck = true;
55 testProjectFile = "src/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj";
56
57 doInstallCheck = true;
58 installCheckPhase = ''
59 $out/bin/EventStore.ClusterNode --insecure \
60 --db "$HOME/data" \
61 --index "$HOME/index" \
62 --log "$HOME/log" \
63 -runprojections all --startstandardprojections \
64 --EnableAtomPubOverHttp &
65
66 PID=$!
67
68 sleep 30s;
69 kill "$PID";
70 '';
71
72 passthru.updateScript = ./updater.sh;
73
74 meta = with lib; {
75 homepage = "https://geteventstore.com/";
76 description = "Event sourcing database with processing logic in JavaScript";
77 license = licenses.bsd3;
78 maintainers = with maintainers; [
79 puffnfresh
80 mdarocha
81 ];
82 platforms = [
83 "x86_64-linux"
84 "x86_64-darwin"
85 ];
86 inherit mainProgram;
87 };
88}