diff --git a/pkgs/applications/version-management/darcs/bash-completion.patch b/pkgs/applications/version-management/darcs/bash-completion.patch new file mode 100644 index 000000000000..8944ebeb9cbf --- /dev/null +++ b/pkgs/applications/version-management/darcs/bash-completion.patch @@ -0,0 +1,19 @@ +diff --git a/darcs-2.0.0/tools/darcs_completion b/darcs-2.0.0/tools/darcs_completion +index 10628db..e36476e 100644 +--- a/tools/darcs_completion ++++ b/tools/darcs_completion +@@ -3,7 +3,6 @@ + # darcs command line completion. + # Copyright 2002 "David Roundy" + # +-have darcs && + _darcs() + { + local cur +@@ -48,5 +47,5 @@ _darcs() + return 0 + + } +-[ "$have" ] && complete -F _darcs -o default darcs ++complete -F _darcs -o default darcs + diff --git a/pkgs/applications/version-management/darcs/darcs-2.nix b/pkgs/applications/version-management/darcs/darcs-2.nix index ed21e0231cbb..5aa354ccb37d 100644 --- a/pkgs/applications/version-management/darcs/darcs-2.nix +++ b/pkgs/applications/version-management/darcs/darcs-2.nix @@ -13,4 +13,6 @@ stdenv.mkDerivation { meta = { description = "Patch-based version management system"; }; + + patches = ./bash-completion.patch; # I didn't have "have" } diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index bddb25c30573..c0d6b514a0c1 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -76,7 +76,12 @@ stdenv.mkDerivation rec { + ''# Wrap `git-clone' wrapProgram $out/bin/git-clone \ - --prefix PATH : "${cpio}/bin" ''; + --prefix PATH : "${cpio}/bin" '' + + + ''# install bash completion script + d="$out/etc/bash_completion.d" + ensureDir $d; cp contrib/completion/git-completion.bash "$d" + ''; meta = { license = "GPLv2"; diff --git a/pkgs/applications/version-management/git/git-git.nix b/pkgs/applications/version-management/git/git-git.nix index a6481a2031f2..cb885280b5a3 100644 --- a/pkgs/applications/version-management/git/git-git.nix +++ b/pkgs/applications/version-management/git/git-git.nix @@ -74,6 +74,11 @@ stdenv.mkDerivation rec { for b in $out/bin/{git,gitk}; do [ -f "$b" ] && eval "wrapProgram $b $wrapArgs" done + '' + + + ''# install bash completion script + d="$out/etc/bash_completion.d" + ensureDir $d; cp contrib/completion/git-completion.bash "$d" ''; meta = { diff --git a/pkgs/applications/version-management/stgit/default.nix b/pkgs/applications/version-management/stgit/default.nix index e39e1d42e462..f31e6ec16b03 100644 --- a/pkgs/applications/version-management/stgit/default.nix +++ b/pkgs/applications/version-management/stgit/default.nix @@ -11,9 +11,11 @@ args.stdenv.mkDerivation { buildPhase = "true"; - installPhase = " + installPhase = '' python ./setup.py install --prefix=$out - "; + d="$out/etc/bash_completion.d" + ensureDir $d; ln -s "$out/share/stgit/contrib/stgit-completion.bash" "$d" + ''; meta = { description = "quilt for git (stacking patches)";