2022-07-18 16:21:45 +00:00
|
|
|
{ lib
|
|
|
|
, git
|
2021-10-17 09:34:42 +00:00
|
|
|
, dotnetCorePackages
|
2022-07-18 16:21:45 +00:00
|
|
|
, glibcLocales
|
|
|
|
, buildDotnetModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bintools
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, mono
|
|
|
|
}:
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
buildDotnetModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "EventStore";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "22.6.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "EventStore";
|
|
|
|
repo = "EventStore";
|
|
|
|
rev = "oss-v${version}";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-+s/FjHKBpcpxFecuPrc26fA6WW20Uurxx1RunRY3JWI=";
|
2022-07-18 16:21:45 +00:00
|
|
|
leaveDotGit = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
# Fixes application reporting 0.0.0.0 as its version.
|
|
|
|
MINVERVERSIONOVERRIDE = version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_5_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.aspnetcore_5_0;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ git glibcLocales bintools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
runtimeDeps = [ mono ];
|
|
|
|
|
|
|
|
nugetBinariesToPatch = lib.optionals stdenv.isLinux [
|
2022-09-22 12:36:57 +00:00
|
|
|
"grpc.tools/2.41.0/tools/linux_x64/protoc"
|
|
|
|
"grpc.tools/2.41.0/tools/linux_x64/grpc_csharp_plugin"
|
2022-07-18 16:21:45 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
postConfigure = ''
|
|
|
|
# Fixes execution of native protoc binaries during build
|
|
|
|
for binary in $nugetBinariesToPatch; do
|
|
|
|
path="$HOME/.nuget/packages/$binary"
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_BINTOOLS/nix-support/dynamic-linker)" $path
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
# Fixes git execution by GitInfo on mac os
|
|
|
|
substituteInPlace "$HOME/.nuget/packages/gitinfo/2.0.26/build/GitInfo.targets" \
|
|
|
|
--replace "<GitExe Condition=\"Exists('/usr/bin/git')\">/usr/bin/git</GitExe>" " " \
|
|
|
|
--replace "<GitExe Condition=\"Exists('/usr/local/bin/git')\">/usr/local/bin/git</GitExe>" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
nugetDeps = ./deps.nix;
|
|
|
|
|
|
|
|
projectFile = "src/EventStore.ClusterNode/EventStore.ClusterNode.csproj";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2022-07-18 16:21:45 +00:00
|
|
|
testProjectFile = "src/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj";
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/EventStore.ClusterNode --insecure \
|
|
|
|
--db "$HOME/data" \
|
|
|
|
--index "$HOME/index" \
|
|
|
|
--log "$HOME/log" \
|
|
|
|
-runprojections all --startstandardprojections \
|
|
|
|
--EnableAtomPubOverHttp &
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
PID=$!
|
|
|
|
|
|
|
|
sleep 30s;
|
|
|
|
kill "$PID";
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
passthru.updateScript = ./updater.sh;
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://geteventstore.com/";
|
|
|
|
description = "Event sourcing database with processing logic in JavaScript";
|
2022-07-18 16:21:45 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ puffnfresh mdarocha ];
|
2021-03-23 19:22:30 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|