2019-04-27 13:57:38 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, dotnet-sdk
|
|
|
|
, mono
|
|
|
|
, Nuget
|
|
|
|
}:
|
2015-05-07 20:00:01 +01:00
|
|
|
|
2019-04-27 13:57:38 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
deps = import ./deps.nix { inherit fetchurl; };
|
|
|
|
|
|
|
|
in
|
2015-05-07 20:00:01 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-04-27 13:57:38 +01:00
|
|
|
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "EventStore";
|
2019-11-25 17:49:15 +00:00
|
|
|
version = "5.0.5";
|
2019-04-27 13:57:38 +01:00
|
|
|
|
2015-12-15 05:53:18 +00:00
|
|
|
src = fetchFromGitHub {
|
2019-04-27 13:57:38 +01:00
|
|
|
owner = "EventStore";
|
|
|
|
repo = "EventStore";
|
|
|
|
rev = "oss-v${version}";
|
2019-11-25 17:49:15 +00:00
|
|
|
sha256 = "0cnpw24fvnj0q644p9jlijcqz6bxi61g0b59g52d3qxfydr0lgs0";
|
2015-05-07 20:00:01 +01:00
|
|
|
};
|
|
|
|
|
2019-04-27 13:57:38 +01:00
|
|
|
buildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
dotnet-sdk
|
|
|
|
mono
|
|
|
|
Nuget
|
|
|
|
];
|
|
|
|
|
|
|
|
# that dependency seems to not be required for building, but pulls in libcurl which fails to be located.
|
|
|
|
# see: https://github.com/EventStore/EventStore/issues/1897
|
|
|
|
patchPhase = ''
|
|
|
|
for f in $(find . -iname "*.csproj"); do
|
|
|
|
sed -i '/Include="Microsoft.SourceLink.GitHub"/d' $f
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2015-05-07 20:00:01 +01:00
|
|
|
buildPhase = ''
|
2019-04-27 13:57:38 +01:00
|
|
|
mkdir home
|
|
|
|
export HOME=$PWD/home
|
|
|
|
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
|
|
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
|
|
|
export FrameworkPathOverride=${mono}/lib/mono/4.7.1-api
|
|
|
|
|
|
|
|
# disable default-source so nuget does not try to download from online-repo
|
|
|
|
nuget sources Disable -Name "nuget.org"
|
|
|
|
# add all dependencies to a source called 'nixos'
|
|
|
|
for package in ${toString deps}; do
|
|
|
|
nuget add $package -Source nixos
|
|
|
|
done
|
2015-05-07 20:00:01 +01:00
|
|
|
|
2019-04-27 13:57:38 +01:00
|
|
|
dotnet restore --source nixos src/EventStore.sln
|
|
|
|
dotnet build --no-restore -c Release src/EventStore.sln
|
2015-05-07 20:00:01 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2019-04-27 13:57:38 +01:00
|
|
|
mkdir -p $out/{bin,lib/eventstore}
|
|
|
|
cp -r bin/Release/* $out/lib/eventstore
|
|
|
|
makeWrapper "${mono}/bin/mono" $out/bin/eventstored \
|
|
|
|
--add-flags "$out/lib/eventstore/EventStore.ClusterNode/net471/EventStore.ClusterNode.exe"
|
2015-05-07 20:00:01 +01:00
|
|
|
'';
|
|
|
|
|
2019-04-27 13:57:38 +01:00
|
|
|
doCheck = true;
|
2015-05-07 20:00:01 +01:00
|
|
|
|
2019-04-27 13:57:38 +01:00
|
|
|
checkPhase = ''
|
|
|
|
dotnet test src/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj -- RunConfiguration.TargetPlatform=x64
|
|
|
|
'';
|
2015-05-07 20:00:01 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://geteventstore.com/;
|
2015-06-29 15:20:58 +01:00
|
|
|
description = "Event sourcing database with processing logic in JavaScript";
|
2015-05-07 20:00:01 +01:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ puffnfresh ];
|
2016-03-09 12:42:21 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2015-05-07 20:00:01 +01:00
|
|
|
};
|
2019-04-27 13:57:38 +01:00
|
|
|
|
2015-05-07 20:00:01 +01:00
|
|
|
}
|