2017-10-24 00:52:27 +02:00
|
|
|
{ stdenv, buildGoPackage, fetchurl, cmake, xz, which, autoconf }:
|
2016-09-20 13:31:54 +02:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
name = "cockroach-${version}";
|
2017-10-24 00:52:27 +02:00
|
|
|
version = "v1.1.1";
|
2016-09-20 13:31:54 +02:00
|
|
|
|
|
|
|
goPackagePath = "github.com/cockroachdb/cockroach";
|
|
|
|
|
2016-09-30 22:46:42 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://binaries.cockroachdb.com/cockroach-${version}.src.tgz";
|
2017-10-24 00:52:27 +02:00
|
|
|
sha256 = "0d2nlm291k4x7hqi0kh76j6pj8b1dwbdww5f95brf0a9bl1n7qxr";
|
2016-09-20 13:31:54 +02:00
|
|
|
};
|
|
|
|
|
2017-10-24 00:52:27 +02:00
|
|
|
nativeBuildInputs = [ cmake xz which autoconf ];
|
2016-09-20 19:02:26 +02:00
|
|
|
|
2016-09-30 22:46:42 +02: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 13:31:54 +02:00
|
|
|
|
2016-09-30 22:46:42 +02:00
|
|
|
installPhase =
|
|
|
|
''
|
2017-08-29 18:54:15 +02: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 22:46:42 +02:00
|
|
|
'';
|
2016-09-20 13:31:54 +02:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://www.cockroachlabs.com;
|
|
|
|
description = "A scalable, survivable, strongly-consistent SQL database";
|
|
|
|
license = licenses.asl20;
|
2017-10-24 01:45:57 +02:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2016-09-20 13:31:54 +02:00
|
|
|
maintainers = [ maintainers.rushmorem ];
|
|
|
|
};
|
|
|
|
}
|