bash: install extensive completion library in the interactive version
Add the command-line completion library to the "interactive" version of
bash. That code is *not* active by default. To enable it, run
| . ${bash}/etc/bash_completion
in your ~/.bashrc. If you prefer to build bashInteractive without that
feature, use the following override in ~/.nixpkgs/config.nix to disable it:
| {
| packageOverrides = pkgs:
| {
| bashInteractive = pkgs.bashInteractive.override {
| bashCompletion = null;
| };
| };
| }
svn path=/nixpkgs/trunk/; revision=29244
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{stdenv, fetchurl, readline ? null, interactive ? false, texinfo ? null, bison}:
|
{stdenv, fetchurl, readline ? null, interactive ? false, texinfo ? null, bison, bashCompletion ? null}:
|
||||||
|
|
||||||
assert interactive -> readline != null;
|
assert interactive -> readline != null;
|
||||||
|
|
||||||
@@ -47,18 +47,22 @@ stdenv.mkDerivation rec {
|
|||||||
buildNativeInputs = [bison]
|
buildNativeInputs = [bison]
|
||||||
++ stdenv.lib.optional (texinfo != null) texinfo
|
++ stdenv.lib.optional (texinfo != null) texinfo
|
||||||
++ stdenv.lib.optional interactive readline;
|
++ stdenv.lib.optional interactive readline;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# Add an `sh' -> `bash' symlink.
|
# Add an `sh' -> `bash' symlink.
|
||||||
ln -s bash "$out/bin/sh"
|
ln -s bash "$out/bin/sh"
|
||||||
|
|
||||||
|
'' + (if interactive && bashCompletion != null then ''
|
||||||
|
ensureDir "$out/etc"
|
||||||
|
echo >"$out/etc/bash_completion" '. "${bashCompletion}/etc/bash_completion"'
|
||||||
|
'' else ''
|
||||||
# Install the completion examples.
|
# Install the completion examples.
|
||||||
ensureDir "$out/etc"
|
ensureDir "$out/etc"
|
||||||
cp -v "examples/complete/bash_completion" "$out/etc"
|
cp -v "examples/complete/bash_completion" "$out/etc"
|
||||||
|
|
||||||
ensureDir "$out/etc/bash_completion.d"
|
ensureDir "$out/etc/bash_completion.d"
|
||||||
cp -v "examples/complete/complete.gnu-longopt" "$out/etc/bash_completion.d"
|
cp -v "examples/complete/complete.gnu-longopt" "$out/etc/bash_completion.d"
|
||||||
'';
|
'');
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://www.gnu.org/software/bash/;
|
homepage = http://www.gnu.org/software/bash/;
|
||||||
@@ -79,7 +83,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
license = "GPLv3+";
|
license = "GPLv3+";
|
||||||
|
|
||||||
maintainers = [ stdenv.lib.maintainers.ludo ];
|
maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
|||||||
Reference in New Issue
Block a user