tree-wide: unify Bash completions outputs (#103421)
Use $out/share/bash-completion/completions to store the Bash completions
This commit is contained in:
parent
3fceafce1e
commit
a7cb88c3de
@ -5,7 +5,7 @@
|
|||||||
macro_optional_find_package (BashCompletion)
|
macro_optional_find_package (BashCompletion)
|
||||||
if (NOT BASH_COMPLETION_FOUND)
|
if (NOT BASH_COMPLETION_FOUND)
|
||||||
- set (BASH_COMPLETION_COMPLETIONSDIR "/etc/bash_completion.d" CACHE PATH "Location of bash_completion.d")
|
- set (BASH_COMPLETION_COMPLETIONSDIR "/etc/bash_completion.d" CACHE PATH "Location of bash_completion.d")
|
||||||
+ set (BASH_COMPLETION_COMPLETIONSDIR "${CMAKE_INSTALL_PREFIX}/etc/bash_completion.d" CACHE PATH "Location of bash_completion.d")
|
+ set (BASH_COMPLETION_COMPLETIONSDIR "${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions" CACHE PATH "Location of bash_completion.d")
|
||||||
endif (NOT BASH_COMPLETION_FOUND)
|
endif (NOT BASH_COMPLETION_FOUND)
|
||||||
install (
|
install (
|
||||||
FILES bash-completion/gammu
|
FILES bash-completion/gammu
|
||||||
|
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
|||||||
buildInputs = [ glib expat ];
|
buildInputs = [ glib expat ];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
installShellCompletion --bash $out/etc/bash_completion.d/prevo-completion
|
installShellCompletion --bash src/prevo-completion
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -13,8 +13,8 @@ in stdenv.mkDerivation {
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -vd $out/bin
|
install -vd $out/bin
|
||||||
install -vm 755 todo.sh $out/bin
|
install -vm 755 todo.sh $out/bin
|
||||||
install -vd $out/etc/bash_completion.d
|
install -vd $out/share/bash-completion/completions
|
||||||
install -vm 644 todo_completion $out/etc/bash_completion.d/todo
|
install -vm 644 todo_completion $out/share/bash-completion/completions/todo
|
||||||
install -vd $out/etc/todo
|
install -vd $out/etc/todo
|
||||||
install -vm 644 todo.cfg $out/etc/todo/config
|
install -vm 644 todo.cfg $out/etc/todo/config
|
||||||
'';
|
'';
|
||||||
|
@ -24,7 +24,7 @@ buildGoModule rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
install -D -m 0644 misc/bash_completion/git-bug "$out/etc/bash_completion.d/git-bug"
|
install -D -m 0644 misc/bash_completion/git-bug "$out/share/bash-completion/completions/git-bug"
|
||||||
install -D -m 0644 misc/zsh_completion/git-bug "$out/share/zsh/site-functions/git-bug"
|
install -D -m 0644 misc/zsh_completion/git-bug "$out/share/zsh/site-functions/git-bug"
|
||||||
install -D -m 0644 -t "$out/share/man/man1" doc/man/*
|
install -D -m 0644 -t "$out/share/man/man1" doc/man/*
|
||||||
'';
|
'';
|
||||||
|
@ -12,9 +12,9 @@ stdenv.mkDerivation {
|
|||||||
};
|
};
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin $out/etc/bash_completion.d
|
mkdir -p $out/bin $out/share/bash-completion/completions
|
||||||
install -m 0755 git-stree $out/bin/
|
install -m 0755 git-stree $out/bin/
|
||||||
install -m 0644 git-stree-completion.bash $out/etc/bash_completion.d/
|
install -m 0644 git-stree-completion.bash $out/share/bash-completion/completions/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -153,8 +153,8 @@ stdenv.mkDerivation {
|
|||||||
cp -a contrib $out/share/git/
|
cp -a contrib $out/share/git/
|
||||||
mkdir -p $out/share/bash-completion/completions
|
mkdir -p $out/share/bash-completion/completions
|
||||||
ln -s $out/share/git/contrib/completion/git-completion.bash $out/share/bash-completion/completions/git
|
ln -s $out/share/git/contrib/completion/git-completion.bash $out/share/bash-completion/completions/git
|
||||||
mkdir -p $out/etc/bash_completion.d
|
mkdir -p $out/share/bash-completion/completions
|
||||||
ln -s $out/share/git/contrib/completion/git-prompt.sh $out/etc/bash_completion.d/
|
ln -s $out/share/git/contrib/completion/git-prompt.sh $out/share/bash-completion/completions/
|
||||||
|
|
||||||
# grep is a runtime dependency, need to patch so that it's found
|
# grep is a runtime dependency, need to patch so that it's found
|
||||||
substituteInPlace $out/libexec/git-core/git-sh-setup \
|
substituteInPlace $out/libexec/git-core/git-sh-setup \
|
||||||
|
@ -16,8 +16,8 @@ stdenv.mkDerivation rec {
|
|||||||
nativeBuildInputs = [ perl git ];
|
nativeBuildInputs = [ perl git ];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
install -Dm644 README -t"$out/share/doc/${pname}-${version}/"
|
install -Dm644 README -t "$out/share/doc/${pname}-${version}/"
|
||||||
install -Dm755 contrib/tg-completion.bash -t "$out/etc/bash_completion.d/"
|
install -Dm755 contrib/tg-completion.bash -t "$out/share/bash-completion/completions/"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -47,8 +47,8 @@ in stdenv.mkDerivation rec {
|
|||||||
install -D -m555 -T purs $PURS
|
install -D -m555 -T purs $PURS
|
||||||
${patchelf libPath}
|
${patchelf libPath}
|
||||||
|
|
||||||
mkdir -p $out/etc/bash_completion.d/
|
mkdir -p $out/share/bash-completion/completions
|
||||||
$PURS --bash-completion-script $PURS > $out/etc/bash_completion.d/purs-completion.bash
|
$PURS --bash-completion-script $PURS > $out/share/bash-completion/completions/purs-completion.bash
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
|
@ -35,8 +35,8 @@ python3Packages.buildPythonApplication rec {
|
|||||||
|
|
||||||
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
|
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
|
||||||
|
|
||||||
mkdir -p "$out/etc/bash_completion.d"
|
mkdir -p "$out/share/bash-completion/completions"
|
||||||
cp contrib/bash_completion/b2 "$out/etc/bash_completion.d/backblaze-b2"
|
cp contrib/bash_completion/b2 "$out/share/bash-completion/completions/backblaze-b2"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -23,7 +23,7 @@ stdenv.mkDerivation {
|
|||||||
"man_dir=${placeholder "man"}/share/man"
|
"man_dir=${placeholder "man"}/share/man"
|
||||||
"libdir=${placeholder "lib"}/lib"
|
"libdir=${placeholder "lib"}/lib"
|
||||||
"includedir=${placeholder "dev"}/include"
|
"includedir=${placeholder "dev"}/include"
|
||||||
"BASH_COMPLETE_DIR=${placeholder "out"}/etc/bash_completion.d"
|
"BASH_COMPLETE_DIR=${placeholder "out"}/share/bash-completion/completions"
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -47,10 +47,12 @@ in with py.pkgs; buildPythonApplication rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/etc/bash_completion.d
|
mkdir -p $out/share/bash-completion/completions
|
||||||
echo "complete -C $out/bin/aws_completer aws" > $out/etc/bash_completion.d/awscli
|
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli
|
||||||
|
|
||||||
mkdir -p $out/share/zsh/site-functions
|
mkdir -p $out/share/zsh/site-functions
|
||||||
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
|
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
|
||||||
|
|
||||||
rm $out/bin/aws.cmd
|
rm $out/bin/aws.cmd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -67,10 +67,12 @@ with py.pkgs; buildPythonApplication rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/etc/bash_completion.d
|
mkdir -p $out/share/bash-completion/completions
|
||||||
echo "complete -C $out/bin/aws_completer aws" > $out/etc/bash_completion.d/awscli
|
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli
|
||||||
|
|
||||||
mkdir -p $out/share/zsh/site-functions
|
mkdir -p $out/share/zsh/site-functions
|
||||||
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
|
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
|
||||||
|
|
||||||
rm $out/bin/aws.cmd
|
rm $out/bin/aws.cmd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
|
|||||||
install -m755 -D -t $out/bin/cfcli bin/cfcli/cf
|
install -m755 -D -t $out/bin/cfcli bin/cfcli/cf
|
||||||
ln -sv $out/bin/ibmcloud $out/bin/bx
|
ln -sv $out/bin/ibmcloud $out/bin/bx
|
||||||
ln -sv $out/bin/ibmcloud $out/bin/bluemix
|
ln -sv $out/bin/ibmcloud $out/bin/bluemix
|
||||||
install -D -t "$out/etc/bash_completion.d" bx/bash_autocomplete
|
install -D -t "$out/share/bash-completion/completions" bx/bash_autocomplete
|
||||||
install -D -t "$out/share/zsh/site-functions" bx/zsh_autocomplete
|
install -D -t "$out/share/zsh/site-functions" bx/zsh_autocomplete
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ in stdenv.mkDerivation rec {
|
|||||||
disable_update_check = true" >> $out/google-cloud-sdk/properties
|
disable_update_check = true" >> $out/google-cloud-sdk/properties
|
||||||
|
|
||||||
# setup bash completion
|
# setup bash completion
|
||||||
mkdir -p $out/etc/bash_completion.d
|
mkdir -p $out/share/bash-completion/completions
|
||||||
mv $out/google-cloud-sdk/completion.bash.inc $out/etc/bash_completion.d/gcloud.inc
|
mv $out/google-cloud-sdk/completion.bash.inc $out/share/bash-completion/completions/gcloud.inc
|
||||||
|
|
||||||
# This directory contains compiled mac binaries. We used crcmod from
|
# This directory contains compiled mac binaries. We used crcmod from
|
||||||
# nixpkgs instead.
|
# nixpkgs instead.
|
||||||
|
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
configureFlags="--with-bash-completion-dir=$out/etc/bash_completion.d"
|
configureFlags="--with-bash-completion-dir=$out/share/bash-completion/completions"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
|
@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
|
|||||||
postPatch = "sed -i s/-O1/-O2/ configure";
|
postPatch = "sed -i s/-O1/-O2/ configure";
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
install -v -m 444 -D btrfs-completion $out/etc/bash_completion.d/btrfs
|
install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-backtrace";
|
configureFlags = stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-backtrace";
|
||||||
|
@ -208,12 +208,12 @@ in rec {
|
|||||||
ceph-client = runCommand "ceph-client-${version}" {
|
ceph-client = runCommand "ceph-client-${version}" {
|
||||||
meta = getMeta "Tools needed to mount Ceph's RADOS Block Devices";
|
meta = getMeta "Tools needed to mount Ceph's RADOS Block Devices";
|
||||||
} ''
|
} ''
|
||||||
mkdir -p $out/{bin,etc,${sitePackages}}
|
mkdir -p $out/{bin,etc,${sitePackages},share/bash-completion/completions}
|
||||||
cp -r ${ceph}/bin/{ceph,.ceph-wrapped,rados,rbd,rbdmap} $out/bin
|
cp -r ${ceph}/bin/{ceph,.ceph-wrapped,rados,rbd,rbdmap} $out/bin
|
||||||
cp -r ${ceph}/bin/ceph-{authtool,conf,dencoder,rbdnamer,syn} $out/bin
|
cp -r ${ceph}/bin/ceph-{authtool,conf,dencoder,rbdnamer,syn} $out/bin
|
||||||
cp -r ${ceph}/bin/rbd-replay* $out/bin
|
cp -r ${ceph}/bin/rbd-replay* $out/bin
|
||||||
cp -r ${ceph}/${sitePackages} $out/${sitePackages}
|
cp -r ${ceph}/${sitePackages} $out/${sitePackages}
|
||||||
cp -r ${ceph}/etc/bash_completion.d $out/etc
|
cp -r ${ceph}/etc/bash_completion.d $out/share/bash-completion/completions
|
||||||
# wrapPythonPrograms modifies .ceph-wrapped, so lets just update its paths
|
# wrapPythonPrograms modifies .ceph-wrapped, so lets just update its paths
|
||||||
substituteInPlace $out/bin/ceph --replace ${ceph} $out
|
substituteInPlace $out/bin/ceph --replace ${ceph} $out
|
||||||
substituteInPlace $out/bin/.ceph-wrapped --replace ${ceph} $out
|
substituteInPlace $out/bin/.ceph-wrapped --replace ${ceph} $out
|
||||||
|
@ -32,12 +32,13 @@ stdenv.mkDerivation rec {
|
|||||||
cd unpacked
|
cd unpacked
|
||||||
${rpmextract}/bin/rpmextract $src
|
${rpmextract}/bin/rpmextract $src
|
||||||
|
|
||||||
|
mkdir -p $out/share/bash-completion/completions
|
||||||
cp -r -t $out/bin usr/bin/*
|
cp -r -t $out/bin usr/bin/*
|
||||||
cp -r -t $out/share usr/share/*
|
cp -r -t $out/share usr/share/*
|
||||||
cp -r -t $out/etc etc/*
|
cp -r -t $out/share/bash-completion/completions etc/bash_completion.d/*
|
||||||
|
|
||||||
sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \
|
sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \
|
||||||
$out/etc/bash_completion.d/yandex-disk-completion.bash
|
$out/share/bash-completion/completions/yandex-disk-completion.bash
|
||||||
|
|
||||||
${patchelf}/bin/patchelf \
|
${patchelf}/bin/patchelf \
|
||||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
|
@ -14,15 +14,15 @@ stdenv.mkDerivation rec {
|
|||||||
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin $out/etc/bash_completion.d
|
mkdir -p $out/bin $out/share/bash-completion/completions
|
||||||
cp gibo $out/bin
|
cp gibo $out/bin
|
||||||
cp gibo-completion.bash $out/etc/bash_completion.d
|
cp gibo-completion.bash $out/share/bash-completion/completions
|
||||||
|
|
||||||
sed -e 's|\<git |${git}/bin/git |g' \
|
sed -e 's|\<git |${git}/bin/git |g' \
|
||||||
-e 's|\<basename |${coreutils}/bin/basename |g' \
|
-e 's|\<basename |${coreutils}/bin/basename |g' \
|
||||||
-i "$out/bin/gibo"
|
-i "$out/bin/gibo"
|
||||||
sed -e 's|\<find |${findutils}/bin/find |g' \
|
sed -e 's|\<find |${findutils}/bin/find |g' \
|
||||||
-i "$out/etc/bash_completion.d/gibo-completion.bash"
|
-i "$out/share/bash-completion/completions/gibo-completion.bash"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
COMPLETION_OUT = "out";
|
COMPLETION_OUT = "out";
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
install -Dm 755 "${COMPLETION_OUT}/${pname}.bash" "$out/etc/bash_completion.d/${pname}"
|
install -Dm 755 "${COMPLETION_OUT}/${pname}.bash" "$out/share/bash-completion/completions/${pname}"
|
||||||
install -Dm 755 "${COMPLETION_OUT}/${pname}.fish" "$out/share/fish/vendor_completions.d/${pname}"
|
install -Dm 755 "${COMPLETION_OUT}/${pname}.fish" "$out/share/fish/vendor_completions.d/${pname}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
"PREFIX=$(out)"
|
"PREFIX=$(out)"
|
||||||
"BASHCOMPDIR=$(out)/etc/bash_completion.d"
|
"BASHCOMPDIR=$(out)/share/bash-completion/completions"
|
||||||
];
|
];
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
|
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace Makefile \
|
substituteInPlace Makefile \
|
||||||
--replace "BASHCOMPDIR ?= /etc/bash_completion.d" "BASHCOMPDIR ?= $out/etc/bash_completion.d"
|
--replace "BASHCOMPDIR ?= /etc/bash_completion.d" "BASHCOMPDIR ?= $out/share/bash-completion/completions"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
@ -83,8 +83,8 @@ in with localPython.pkgs; buildPythonApplication rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/etc/bash_completion.d
|
mkdir -p $out/share/bash-completion/completions
|
||||||
mv $out/bin/eb_completion.bash $out/etc/bash_completion.d
|
mv $out/bin/eb_completion.bash $out/share/bash-completion/completions/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -10,7 +10,7 @@ substituteAll {
|
|||||||
inherit utillinux;
|
inherit utillinux;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
t=$out/etc/bash_completion.d
|
t=$out/share/bash-completion/completions
|
||||||
mkdir -p $t
|
mkdir -p $t
|
||||||
cp ${./nixos-container-completion.sh} $t/nixos-container
|
cp ${./nixos-container-completion.sh} $t/nixos-container
|
||||||
'';
|
'';
|
||||||
|
@ -511,10 +511,10 @@ let
|
|||||||
buildInputs = [ DataDump FileWhich Readonly TestDifferences TestTrap ];
|
buildInputs = [ DataDump FileWhich Readonly TestDifferences TestTrap ];
|
||||||
preCheck = "rm t/30cluster.t"; # do not run failing tests
|
preCheck = "rm t/30cluster.t"; # do not run failing tests
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/etc/bash_completion.d
|
mkdir -p $out/share/bash-completion/completions
|
||||||
mv $out/bin/clusterssh_bash_completion.dist \
|
mv $out/bin/clusterssh_bash_completion.dist \
|
||||||
$out/etc/bash_completion.d/clusterssh_bash_completion
|
$out/share/bash-completion/completions/clusterssh_bash_completion
|
||||||
substituteInPlace $out/etc/bash_completion.d/clusterssh_bash_completion \
|
substituteInPlace $out/share/bash-completion/completions/clusterssh_bash_completion \
|
||||||
--replace '/bin/true' '${pkgs.coreutils}/bin/true' \
|
--replace '/bin/true' '${pkgs.coreutils}/bin/true' \
|
||||||
--replace 'grep' '${pkgs.gnugrep}/bin/grep' \
|
--replace 'grep' '${pkgs.gnugrep}/bin/grep' \
|
||||||
--replace 'sed' '${pkgs.gnused}/bin/sed'
|
--replace 'sed' '${pkgs.gnused}/bin/sed'
|
||||||
|
Loading…
Reference in New Issue
Block a user