nixpkgs-suyu/pkgs/servers/dgraph/default.nix

43 lines
992 B
Nix
Raw Normal View History

2020-06-06 13:38:45 +02:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2017-07-21 17:45:03 +02:00
2020-06-06 13:38:45 +02:00
buildGoModule rec {
pname = "dgraph";
2021-01-18 15:31:33 +01:00
version = "20.07.3";
2017-07-21 17:45:03 +02:00
src = fetchFromGitHub {
owner = "dgraph-io";
repo = "dgraph";
rev = "v${version}";
2021-01-18 15:31:33 +01:00
sha256 = "sha256-yuKXcxewt64T0ToDPid37WUEhwLu+yt4tjhDQobj/Ls=";
2017-07-21 17:45:03 +02:00
};
2021-01-18 15:31:33 +01:00
vendorSha256 = "sha256-2Ub0qdEaVSHHE5K0bNSXJFukGeSSXNpIBoUldF8jGpI=";
2020-06-06 13:38:45 +02:00
doCheck = false;
2020-06-06 13:38:45 +02:00
nativeBuildInputs = [ installShellFiles ];
2019-09-01 04:15:52 +02:00
# see licensing
2020-06-06 13:38:45 +02:00
buildPhase = ''
make oss BUILD_VERSION=${version}
'';
2017-07-21 17:45:03 +02:00
2020-06-06 13:38:45 +02:00
installPhase = ''
install dgraph/dgraph -Dt $out/bin
2017-07-21 17:45:03 +02:00
2020-06-06 13:38:45 +02:00
for shell in bash zsh; do
$out/bin/dgraph completion $shell > dgraph.$shell
installShellCompletion dgraph.$shell
done
2017-07-21 17:45:03 +02:00
'';
2020-06-06 13:38:45 +02:00
meta = with lib; {
2017-07-21 17:45:03 +02:00
homepage = "https://dgraph.io/";
description = "Fast, Distributed Graph DB";
2020-06-06 13:38:45 +02:00
maintainers = with maintainers; [ sigma ];
# Apache 2.0 because we use only build "oss"
license = licenses.asl20;
platforms = platforms.unix;
2017-07-21 17:45:03 +02:00
};
}