mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 22:20:51 +00:00
cockroachdb: install bash completion into .bin
This commit is contained in:
parent
cf84d2ff78
commit
4432eb0de5
|
@ -2,37 +2,36 @@
|
|||
|
||||
buildGoPackage rec {
|
||||
name = "cockroach-${version}";
|
||||
version = "v1.1.1";
|
||||
version = "1.1.1";
|
||||
|
||||
goPackagePath = "github.com/cockroachdb/cockroach";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://binaries.cockroachdb.com/cockroach-${version}.src.tgz";
|
||||
url = "https://binaries.cockroachdb.com/cockroach-v${version}.src.tgz";
|
||||
sha256 = "0d2nlm291k4x7hqi0kh76j6pj8b1dwbdww5f95brf0a9bl1n7qxr";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake xz which autoconf ];
|
||||
|
||||
buildPhase =
|
||||
''
|
||||
cd $NIX_BUILD_TOP/go/src/${goPackagePath}
|
||||
patchShebangs ./
|
||||
make buildoss
|
||||
cd src/${goPackagePath}
|
||||
for asset in man autocomplete; do
|
||||
./cockroach gen $asset
|
||||
done
|
||||
'';
|
||||
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 =
|
||||
''
|
||||
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
|
||||
'';
|
||||
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
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://www.cockroachlabs.com;
|
||||
|
|
Loading…
Reference in a new issue