aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/shells/bash
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-01-10 20:09:37 +0000
committerKatharina Fey <kookie@spacekookie.de>2020-01-10 20:09:37 +0000
commit45431c078bf8f54aef7c9fae2e5913395ec82c31 (patch)
treefd8ff1346a963ddd72e782421f05b623f9759e2a /nixpkgs/pkgs/shells/bash
parentc86fea6086c212ea489cfb023a5f5c9c8f188810 (diff)
parent3ccbc8d89153ecf13f3eae7d9c106d91cd4ab9e5 (diff)
Merge commit '3ccbc8d89153ecf13f3eae7d9c106d91cd4ab9e5' into fuckthisshit
Diffstat (limited to 'nixpkgs/pkgs/shells/bash')
-rw-r--r--nixpkgs/pkgs/shells/bash/bash-completion/0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch86
-rw-r--r--nixpkgs/pkgs/shells/bash/bash-completion/default.nix37
2 files changed, 117 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/shells/bash/bash-completion/0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch b/nixpkgs/pkgs/shells/bash/bash-completion/0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch
new file mode 100644
index 00000000000..c0d94a1a76d
--- /dev/null
+++ b/nixpkgs/pkgs/shells/bash/bash-completion/0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch
@@ -0,0 +1,86 @@
+From 398f44b4ed545fc1b6c13a057bf0900001f7958b Mon Sep 17 00:00:00 2001
+From: Frederik Rietdijk <fridh@fridh.nl>
+Date: Tue, 22 Oct 2019 15:07:05 +0200
+Subject: [PATCH] Revert "build: Do cmake, pc, and profile variable
+ replacements in Makefile"
+
+This reverts commit 81ba2c7e7dfbaefbafa1e8615727c9612e5fb314.
+---
+ Makefile.am | 12 ++++++++----
+ bash-completion-config.cmake.in | 4 ++--
+ bash-completion.pc.in | 4 ++--
+ configure.ac | 3 +++
+ 4 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 8f441185..53979529 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -23,8 +23,7 @@ cmakeconfig_DATA = bash-completion-config.cmake \
+ -e 's|@VERSION[@]|$(VERSION)|' \
+ <$(srcdir)/$@.in >$@
+
+-CLEANFILES = bash_completion.sh bash-completion.pc \
+- bash-completion-config.cmake bash-completion-config-version.cmake
++CLEANFILES = bash_completion.sh bash-completion.pc
+
+ EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \
+ .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc \
+@@ -34,6 +33,11 @@ EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \
+ install-data-hook:
+ tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \
+ $(SED) -e 's|-/etc/bash_completion\.d|-$(compatdir)|' \
+- $(DESTDIR)$(pkgdatadir)/bash_completion >$$tmpfile && \
+- cat $$tmpfile >$(DESTDIR)$(pkgdatadir)/bash_completion && \
++ $(DESTDIR)$(pkgdatadir)/bash_completion > $$tmpfile && \
++ cat $$tmpfile > $(DESTDIR)$(pkgdatadir)/bash_completion && \
++ $(SED) -e 's|\$${prefix}|$(prefix)|' \
++ $(DESTDIR)$(datadir)/cmake/$(PACKAGE)/bash-completion-config.cmake \
++ > $$tmpfile && \
++ cat $$tmpfile > \
++ $(DESTDIR)$(datadir)/cmake/$(PACKAGE)/bash-completion-config.cmake && \
+ rm $$tmpfile
+diff --git a/bash-completion-config.cmake.in b/bash-completion-config.cmake.in
+index d907b76c..ccc6e052 100644
+--- a/bash-completion-config.cmake.in
++++ b/bash-completion-config.cmake.in
+@@ -5,7 +5,7 @@ set (BASH_COMPLETION_VERSION "@VERSION@")
+
+ set (BASH_COMPLETION_PREFIX "@prefix@")
+ set (BASH_COMPLETION_COMPATDIR "@compatdir@")
+-set (BASH_COMPLETION_COMPLETIONSDIR "@pkgdatadir@/completions")
+-set (BASH_COMPLETION_HELPERSDIR "@pkgdatadir@/helpers")
++set (BASH_COMPLETION_COMPLETIONSDIR "@datarootdir@/@PACKAGE@/completions")
++set (BASH_COMPLETION_HELPERSDIR "@datarootdir@/@PACKAGE@/helpers")
+
+ set (BASH_COMPLETION_FOUND "TRUE")
+diff --git a/bash-completion.pc.in b/bash-completion.pc.in
+index ea03fd75..bde217db 100644
+--- a/bash-completion.pc.in
++++ b/bash-completion.pc.in
+@@ -1,7 +1,7 @@
+ prefix=@prefix@
+ compatdir=@compatdir@
+-completionsdir=@pkgdatadir@/completions
+-helpersdir=@pkgdatadir@/helpers
++completionsdir=@datarootdir@/@PACKAGE@/completions
++helpersdir=@datarootdir@/@PACKAGE@/helpers
+
+ Name: bash-completion
+ Description: programmable completion for the bash shell
+diff --git a/configure.ac b/configure.ac
+index 1f3b37e8..a216d9b7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -13,5 +13,8 @@ helpers/Makefile
+ test/Makefile
+ test/t/Makefile
+ test/t/unit/Makefile
++bash-completion.pc
++bash-completion-config.cmake
++bash-completion-config-version.cmake
+ ])
+ AC_OUTPUT
+--
+2.21.0
+
diff --git a/nixpkgs/pkgs/shells/bash/bash-completion/default.nix b/nixpkgs/pkgs/shells/bash/bash-completion/default.nix
index 0476cbd1f3f..fbc07c86494 100644
--- a/nixpkgs/pkgs/shells/bash/bash-completion/default.nix
+++ b/nixpkgs/pkgs/shells/bash/bash-completion/default.nix
@@ -1,15 +1,40 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchFromGitHub
+, autoreconfHook
+, python3Packages
+, bashInteractive
+}:
stdenv.mkDerivation rec {
pname = "bash-completion";
- version = "2.8";
+ version = "2.9";
- src = fetchurl {
- url = "https://github.com/scop/bash-completion/releases/download/${version}/${pname}-${version}.tar.xz";
- sha256 = "0kgmflrr1ga9wfk770vmakna3nj46ylb5ky9ipd0v2k9ymq5a7y0";
+ src = fetchFromGitHub {
+ owner = "scop";
+ repo = "bash-completion";
+ rev = version;
+ sha256 = "1813r4jxfa2zgzm2ppjhrq62flfmxai8433pklxcrl4fp5wwx9yv";
};
- doCheck = true;
+ nativeBuildInputs = [ autoreconfHook ];
+
+ doCheck = !stdenv.isDarwin;
+ checkInputs = [
+ python3Packages.pexpect
+ python3Packages.pytest
+ bashInteractive
+ ];
+
+ patches = [
+ ./0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch
+ ];
+
+ # ignore ip_addresses because it tries to touch network
+ # ignore test_ls because impure logic
+ checkPhase = ''
+ pytest . \
+ --ignore=test/t/unit/test_unit_ip_addresses.py \
+ --ignore=test/t/test_ls.py
+ '';
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*