Merge pull request #86035 from zowoq/go-fixes

This commit is contained in:
Jörg Thalheim 2020-04-27 10:03:52 +01:00 committed by GitHub
commit a90356e08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 65 additions and 60 deletions

View File

@ -1,5 +1,5 @@
# This file was generated by go2nix.
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles }:
buildGoPackage rec {
pname = "machine";
@ -14,13 +14,13 @@ buildGoPackage rec {
sha256 = "0xxzxi5v7ji9j2k7kxhi0ah91lfa7b9rg3nywgx0lkv8dlgp8kmy";
};
postInstall = ''
mkdir -p \
$bin/share/bash-completion/completions/ \
$bin/share/zsh/site-functions/
nativeBuildInputs = [ installShellFiles ];
cp go/src/github.com/docker/machine/contrib/completion/bash/* $bin/share/bash-completion/completions/
cp go/src/github.com/docker/machine/contrib/completion/zsh/* $bin/share/zsh/site-functions/
postInstall = ''
pushd go/src/${goPackagePath}/contrib/completion
installShellCompletion --bash bash/*
installShellCompletion --zsh zsh/*
popd
'';
meta = with stdenv.lib; {

View File

@ -15,9 +15,10 @@ buildGoPackage rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$bin/bin/kompose completion bash > kompose.bash
$bin/bin/kompose completion zsh > kompose.zsh
installShellCompletion kompose.{bash,zsh}
for shell in bash zsh; do
$bin/bin/kompose completion $shell > kompose.$shell
installShellCompletion kompose.$shell
done
'';
meta = with lib; {

View File

@ -1,4 +1,4 @@
{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata }:
{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }:
let
goPackagePath = "k8s.io/kops";
@ -18,7 +18,7 @@ let
inherit sha256;
};
nativeBuildInputs = [ go-bindata ];
nativeBuildInputs = [ go-bindata installShellFiles ];
subPackages = [ "cmd/kops" ];
buildFlagsArray = ''
@ -33,10 +33,10 @@ let
'';
postInstall = ''
mkdir -p $bin/share/bash-completion/completions
mkdir -p $bin/share/zsh/site-functions
$bin/bin/kops completion bash > $bin/share/bash-completion/completions/kops
$bin/bin/kops completion zsh > $bin/share/zsh/site-functions/_kops
for shell in bash zsh; do
$bin/bin/kops completion $shell > kops.$shell
installShellCompletion kops.$shell
done
'';
meta = with stdenv.lib; {

View File

@ -1,4 +1,4 @@
{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub }:
{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub, installShellFiles }:
let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform; in
@ -17,13 +17,15 @@ buildGoPackage rec {
goDeps = ./deps.nix;
nativeBuildInputs = [ installShellFiles ];
postInstall =
let stern = if isCrossBuild then buildPackages.stern else "$bin"; in
''
mkdir -p $bin/share/bash-completion/completions
${stern}/bin/stern --completion bash > $bin/share/bash-completion/completions/stern
mkdir -p $bin/share/zsh/site-functions
${stern}/bin/stern --completion zsh > $bin/share/zsh/site-functions/_stern
for shell in bash zsh; do
${stern}/bin/stern --completion $shell > stern.$shell
installShellCompletion stern.$shell
done
'';
meta = with lib; {

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages }:
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages, installShellFiles }:
buildGoPackage rec {
pname = "rclone";
@ -17,6 +17,8 @@ buildGoPackage rec {
outputs = [ "bin" "out" "man" ];
nativeBuildInputs = [ installShellFiles ];
postInstall =
let
rcloneBin =
@ -25,10 +27,11 @@ buildGoPackage rec {
else stdenv.lib.getBin buildPackages.rclone;
in
''
install -D -m644 $src/rclone.1 $man/share/man/man1/rclone.1
mkdir -p $bin/share/zsh/site-functions $bin/share/bash-completion/completions/
${rcloneBin}/bin/rclone genautocomplete zsh $bin/share/zsh/site-functions/_rclone
${rcloneBin}/bin/rclone genautocomplete bash $bin/share/bash-completion/completions/rclone.bash
installManPage $src/rclone.1
for shell in bash zsh; do
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
installShellCompletion rclone.$shell
done
'';
meta = with stdenv.lib; {

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, groff, utillinux }:
{ stdenv, buildGoPackage, fetchFromGitHub, groff, installShellFiles, utillinux }:
buildGoPackage rec {
pname = "hub";
@ -16,7 +16,7 @@ buildGoPackage rec {
sha256 = "1qjab3dpia1jdlszz3xxix76lqrm4zbmqzd9ymld7h06awzsg2vh";
};
nativeBuildInputs = [ groff utillinux ];
nativeBuildInputs = [ groff installShellFiles utillinux ];
postPatch = ''
patchShebangs .
@ -24,13 +24,13 @@ buildGoPackage rec {
postInstall = ''
cd go/src/${goPackagePath}
install -D etc/hub.zsh_completion "$bin/share/zsh/site-functions/_hub"
install -D etc/hub.bash_completion.sh "$bin/share/bash-completion/completions/hub"
install -D etc/hub.fish_completion "$bin/share/fish/vendor_completions.d/hub.fish"
installShellCompletion --zsh --name _hub etc/hub.zsh_completion
installShellCompletion --bash --name hub etc/hub.bash_completion.sh
installShellCompletion --fish --name hub.fish etc/hub.fish_completion
LC_ALL=C.UTF8 \
make man-pages
cp -vr --parents share/man/man[1-9]/*.[1-9] $bin/
installManPage share/man/man[1-9]/*.[1-9]
'';
meta = with stdenv.lib; {

View File

@ -242,11 +242,7 @@ let
# Add default meta information
homepage = "https://${goPackagePath}";
platforms = go.meta.platforms or lib.platforms.all;
} // meta // {
# add an extra maintainer to every package
maintainers = (meta.maintainers or []) ++
[ lib.maintainers.lethalman ];
};
} // meta;
});
in if disabled then
throw "${package.name} not supported for go ${go.meta.branch}"

View File

@ -19,9 +19,10 @@ buildGoPackage rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$bin/bin/kind completion bash > kind.bash
$bin/bin/kind completion zsh > kind.zsh
installShellCompletion kind.{bash,zsh}
for shell in bash zsh; do
$bin/bin/kind completion $shell > kind.$shell
installShellCompletion kind.$shell
done
'';
meta = {

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles }:
buildGoPackage {
pname = "mailexporter";
@ -15,9 +15,11 @@ buildGoPackage {
goDeps = ./mail-exporter_deps.nix;
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
install -D -m 0444 -t $bin/share/man/man1 $src/man/mailexporter.1
install -D -m 0444 -t $bin/share/man/man5 $src/man/mailexporter.conf.5
installManPage $src/man/mailexporter.1
installManPage $src/man/mailexporter.conf.5
'';
meta = with stdenv.lib; {

View File

@ -1,6 +1,7 @@
{ stdenv, buildGoPackage, fetchurl
, cmake, xz, which, autoconf
, ncurses6, libedit, libunwind
, installShellFiles
}:
let
@ -8,7 +9,7 @@ let
linuxDeps = [ ncurses6 ];
buildInputs = if stdenv.isDarwin then darwinDeps else linuxDeps;
nativeBuildInputs = [ cmake xz which autoconf ];
nativeBuildInputs = [ installShellFiles cmake xz which autoconf ];
in
buildGoPackage rec {
@ -42,7 +43,7 @@ buildGoPackage rec {
runHook preInstall
install -D cockroachoss $bin/bin/cockroach
install -D cockroach.bash $bin/share/bash-completion/completions/cockroach.bash
installShellCompletion cockroach.bash
mkdir -p $man/share/man
cp -r man $man/share/man

View File

@ -5,6 +5,7 @@
, writeShellScriptBin, apparmor-profiles, apparmor-parser
, criu
, bash
, installShellFiles
}:
buildGoPackage rec {
@ -39,11 +40,10 @@ buildGoPackage rec {
'')
]}
mkdir -p "$bin/share/bash-completion/completions/"
cp -av go/src/github.com/lxc/lxd/scripts/bash/lxd-client "$bin/share/bash-completion/completions/lxc"
installShellCompletion --bash go/src/github.com/lxc/lxd/scripts/bash/lxd-client
'';
nativeBuildInputs = [ pkgconfig makeWrapper ];
nativeBuildInputs = [ installShellFiles pkgconfig makeWrapper ];
buildInputs = [ lxc acl libcap libco-canonical.dev dqlite.dev
raft-canonical.dev sqlite-replication udev.dev ];

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, git, gnupg, xclip, wl-clipboard, makeWrapper }:
{ stdenv, buildGoPackage, fetchFromGitHub, git, gnupg, xclip, wl-clipboard, installShellFiles, makeWrapper }:
buildGoPackage rec {
pname = "gopass";
@ -6,7 +6,7 @@ buildGoPackage rec {
goPackagePath = "github.com/gopasspw/gopass";
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ installShellFiles makeWrapper ];
src = fetchFromGitHub {
owner = "gopasspw";
@ -22,13 +22,10 @@ buildGoPackage rec {
] ++ stdenv.lib.optional stdenv.isLinux wl-clipboard);
postInstall = ''
mkdir -p \
$bin/share/bash-completion/completions \
$bin/share/zsh/site-functions \
$bin/share/fish/vendor_completions.d
$bin/bin/gopass completion bash > $bin/share/bash-completion/completions/_gopass
$bin/bin/gopass completion zsh > $bin/share/zsh/site-functions/_gopass
$bin/bin/gopass completion fish > $bin/share/fish/vendor_completions.d/gopass.fish
for shell in bash fish zsh; do
$bin/bin/gopass completion $shell > gopass.$shell
installShellCompletion gopass.$shell
done
'';
postFixup = ''

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, buildGoPackage }:
{ stdenv, fetchFromGitHub, buildGoPackage, installShellFiles }:
buildGoPackage rec {
pname = "vault";
@ -15,14 +15,16 @@ buildGoPackage rec {
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles ];
buildFlagsArray = [
"-tags='vault'"
"-ldflags=\"-X github.com/hashicorp/vault/sdk/version.GitCommit='v${version}'\""
];
postInstall = ''
mkdir -p $bin/share/bash-completion/completions
echo "complete -C $bin/bin/vault vault" > $bin/share/bash-completion/completions/vault
echo "complete -C $bin/bin/vault vault" > vault.bash
installShellCompletion vault.bash
'';
meta = with stdenv.lib; {