2022-04-16 19:50:05 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, jemalloc, nodejs }:
|
2017-07-21 16:45:03 +01:00
|
|
|
|
2020-06-06 12:38:45 +01:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "dgraph";
|
2022-04-16 19:50:05 +01:00
|
|
|
version = "21.12.0";
|
2017-07-21 16:45:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dgraph-io";
|
|
|
|
repo = "dgraph";
|
|
|
|
rev = "v${version}";
|
2022-04-16 19:50:05 +01:00
|
|
|
sha256 = "sha256-OYDWr+wJEIP7raIHsXSjvuFr2ENJOllufO5ff6lxoR4=";
|
2017-07-21 16:45:03 +01:00
|
|
|
};
|
|
|
|
|
2022-04-16 19:50:05 +01:00
|
|
|
vendorSha256 = "sha256-YtU3Yeq/lNeq7cOB+KvHbvlH9g40WuJk1ovHxCQMG60=";
|
2020-06-06 12:38:45 +01:00
|
|
|
|
2020-08-04 01:26:27 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-04-16 19:50:05 +01:00
|
|
|
ldflags = [
|
|
|
|
"-X github.com/dgraph-io/dgraph/x.dgraphVersion=${version}-oss"
|
|
|
|
];
|
|
|
|
|
|
|
|
tags = [
|
|
|
|
"oss"
|
|
|
|
];
|
|
|
|
|
2020-06-06 12:38:45 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-04-16 19:50:05 +01:00
|
|
|
# todo those dependencies are required in the makefile, but verify how they are used
|
|
|
|
# actually
|
|
|
|
buildInputs = [ jemalloc nodejs ];
|
2017-07-21 16:45:03 +01:00
|
|
|
|
2022-04-16 19:50:05 +01:00
|
|
|
subPackages = [ "dgraph" ];
|
2017-07-21 16:45:03 +01:00
|
|
|
|
2022-04-16 19:50:05 +01:00
|
|
|
postInstall = ''
|
2020-06-06 12:38:45 +01:00
|
|
|
for shell in bash zsh; do
|
|
|
|
$out/bin/dgraph completion $shell > dgraph.$shell
|
|
|
|
installShellCompletion dgraph.$shell
|
|
|
|
done
|
2017-07-21 16:45:03 +01:00
|
|
|
'';
|
|
|
|
|
2020-06-06 12:38:45 +01:00
|
|
|
meta = with lib; {
|
2017-07-21 16:45:03 +01:00
|
|
|
homepage = "https://dgraph.io/";
|
|
|
|
description = "Fast, Distributed Graph DB";
|
2020-06-06 12:38:45 +01:00
|
|
|
maintainers = with maintainers; [ sigma ];
|
|
|
|
# Apache 2.0 because we use only build "oss"
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
2017-07-21 16:45:03 +01:00
|
|
|
};
|
|
|
|
}
|