Merge pull request #30746 from andir/update-cockroach

Update cockroachdb to v1.1.1 and enable build on darwin
This commit is contained in:
Jörg Thalheim 2017-10-25 09:13:02 +01:00 committed by GitHub
commit 4244ca78ed

View File

@ -1,44 +1,43 @@
{ stdenv, buildGoPackage, fetchurl, cmake, xz, which }: { stdenv, buildGoPackage, fetchurl, cmake, xz, which, autoconf }:
buildGoPackage rec { buildGoPackage rec {
name = "cockroach-${version}"; name = "cockroach-${version}";
version = "v1.0.5"; version = "1.1.1";
goPackagePath = "github.com/cockroachdb/cockroach"; goPackagePath = "github.com/cockroachdb/cockroach";
src = fetchurl { src = fetchurl {
url = "https://binaries.cockroachdb.com/cockroach-${version}.src.tgz"; url = "https://binaries.cockroachdb.com/cockroach-v${version}.src.tgz";
sha256 = "0jjl6zb8pyxws3i020h98vdr217railca8h6n3xijkvcqy9dj8wa"; sha256 = "0d2nlm291k4x7hqi0kh76j6pj8b1dwbdww5f95brf0a9bl1n7qxr";
}; };
buildInputs = [ cmake xz which ]; nativeBuildInputs = [ cmake xz which autoconf ];
buildPhase = buildPhase = ''
'' runHook preBuild
cd $NIX_BUILD_TOP/go/src/${goPackagePath} cd $NIX_BUILD_TOP/go/src/${goPackagePath}
patchShebangs ./ patchShebangs .
make buildoss make buildoss
cd src/${goPackagePath} cd src/${goPackagePath}
for asset in man autocomplete; do for asset in man autocomplete; do
./cockroach gen $asset ./cockroach gen $asset
done done
''; runHook postBuild
'';
installPhase = installPhase = ''
'' runHook preInstall
mkdir -p $bin/{bin,share} install -D cockroach $bin/bin/cockroach
mv cockroach $bin/bin/ install -D cockroach.bash $bin/share/bash-completion/completions/cockroach.bash
mv man $bin/share/ cp -r man $bin/share/man
runHook postInstall
mkdir -p $out/share/bash-completion/completions '';
mv cockroach.bash $out/share/bash-completion/completions
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = https://www.cockroachlabs.com; homepage = https://www.cockroachlabs.com;
description = "A scalable, survivable, strongly-consistent SQL database"; description = "A scalable, survivable, strongly-consistent SQL database";
license = licenses.asl20; license = licenses.asl20;
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = [ maintainers.rushmorem ]; maintainers = [ maintainers.rushmorem ];
}; };
} }