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

45 lines
1.1 KiB
Nix
Raw Normal View History

2016-09-30 13:46:42 -07:00
{ stdenv, buildGoPackage, fetchurl, cmake, xz, which }:
2016-09-20 04:31:54 -07:00
buildGoPackage rec {
name = "cockroach-${version}";
2017-08-29 09:54:15 -07:00
version = "v1.0.5";
2016-09-20 04:31:54 -07:00
goPackagePath = "github.com/cockroachdb/cockroach";
2016-09-30 13:46:42 -07:00
src = fetchurl {
url = "https://binaries.cockroachdb.com/cockroach-${version}.src.tgz";
2017-08-29 09:54:15 -07:00
sha256 = "0jjl6zb8pyxws3i020h98vdr217railca8h6n3xijkvcqy9dj8wa";
2016-09-20 04:31:54 -07:00
};
2016-09-30 13:46:42 -07:00
buildInputs = [ cmake xz which ];
2016-09-20 10:02:26 -07:00
2016-09-30 13:46:42 -07:00
buildPhase =
''
cd $NIX_BUILD_TOP/go/src/${goPackagePath}
patchShebangs ./
make buildoss
cd src/${goPackagePath}
for asset in man autocomplete; do
./cockroach gen $asset
done
'';
2016-09-20 04:31:54 -07:00
2016-09-30 13:46:42 -07:00
installPhase =
''
2017-08-29 09:54:15 -07:00
mkdir -p $bin/{bin,share}
mv cockroach $bin/bin/
mv man $bin/share/
mkdir -p $out/share/bash-completion/completions
mv cockroach.bash $out/share/bash-completion/completions
2016-09-30 13:46:42 -07:00
'';
2016-09-20 04:31:54 -07:00
meta = with stdenv.lib; {
homepage = https://www.cockroachlabs.com;
description = "A scalable, survivable, strongly-consistent SQL database";
license = licenses.asl20;
platforms = [ "x86_64-linux" ];
2016-09-20 04:31:54 -07:00
maintainers = [ maintainers.rushmorem ];
};
}