nixpkgs/pkgs/servers/sql/cockroachdb/default.nix

45 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, buildGoPackage, fetchurl, cmake, xz, which, autoconf, ncurses6, libedit }:
2016-09-20 12:31:54 +01:00
buildGoPackage rec {
name = "cockroach-${version}";
2018-04-10 00:28:13 +01:00
version = "2.0.0";
2016-09-20 12:31:54 +01:00
goPackagePath = "github.com/cockroachdb/cockroach";
2016-09-30 21:46:42 +01:00
src = fetchurl {
url = "https://binaries.cockroachdb.com/cockroach-v${version}.src.tgz";
2018-04-10 00:28:13 +01:00
sha256 = "0x8hf5qwvgb2w6dcnvy20v77nf19f0l1pb40jf31rm72xhk3bwvy";
2016-09-20 12:31:54 +01:00
};
buildInputs = [ (if stdenv.isDarwin then libedit else ncurses6) ];
2017-10-23 23:52:27 +01:00
nativeBuildInputs = [ cmake xz which autoconf ];
2016-09-20 18:02:26 +01:00
buildPhase = ''
runHook preBuild
cd $NIX_BUILD_TOP/go/src/${goPackagePath}
patchShebangs .
make buildoss
cd src/${goPackagePath}
for asset in man autocomplete; do
./cockroach gen $asset
done
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D cockroach $bin/bin/cockroach
install -D cockroach.bash $bin/share/bash-completion/completions/cockroach.bash
cp -r man $bin/share/man
runHook postInstall
'';
2016-09-20 12:31:54 +01:00
meta = with stdenv.lib; {
homepage = https://www.cockroachlabs.com;
description = "A scalable, survivable, strongly-consistent SQL database";
license = licenses.asl20;
2017-10-24 00:45:57 +01:00
platforms = [ "x86_64-linux" "x86_64-darwin" ];
2016-09-20 12:31:54 +01:00
maintainers = [ maintainers.rushmorem ];
};
}