From d34a4653279524056bcfbda2b58d36c4dd8fd604 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 8 Feb 2022 20:02:22 +0100 Subject: [PATCH] passExtensions.pass-audit: 1.1 -> 1.2 ChangeLog: https://github.com/roddhjav/pass-audit/blob/v1.2/CHANGELOG.md#12---2022-01-30 --- .../0001-Set-base-to-an-empty-value.patch | 43 +++++++++++++++++++ .../pass/extensions/audit/default.nix | 8 ++-- 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 pkgs/tools/security/pass/extensions/audit/0001-Set-base-to-an-empty-value.patch diff --git a/pkgs/tools/security/pass/extensions/audit/0001-Set-base-to-an-empty-value.patch b/pkgs/tools/security/pass/extensions/audit/0001-Set-base-to-an-empty-value.patch new file mode 100644 index 000000000000..ce6849d677f8 --- /dev/null +++ b/pkgs/tools/security/pass/extensions/audit/0001-Set-base-to-an-empty-value.patch @@ -0,0 +1,43 @@ +From a2d5d973f53efb11bdcaecbd0099df9714bc287f Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch +Date: Tue, 8 Feb 2022 19:35:35 +0100 +Subject: [PATCH] Set `base` to an empty value + +`DESTDIR` ensures that everything lands in the correct location (i.e. +the target store-path on Nix), within this path, everything should be +moved into `/lib` and `/share`. +--- + setup.py | 17 ++--------------- + 1 file changed, 2 insertions(+), 15 deletions(-) + +diff --git a/setup.py b/setup.py +index 1f0a58b..f7baa41 100644 +--- a/setup.py ++++ b/setup.py +@@ -8,21 +8,8 @@ from pathlib import Path + + from setuptools import setup + +-share = Path(sys.prefix, 'share') +-base = '/usr' +-if os.uname().sysname == 'Darwin': +- base = '/usr/local' +-lib = Path(base, 'lib', 'password-store', 'extensions') +- +-if '--user' in sys.argv: +- if 'PASSWORD_STORE_EXTENSIONS_DIR' in os.environ: +- lib = Path(os.environ['PASSWORD_STORE_EXTENSIONS_DIR']) +- else: +- lib = Path.home() / '.password-store' / '.extensions' +- if 'XDG_DATA_HOME' in os.environ: +- share = Path(os.environ['XDG_DATA_HOME']) +- else: +- share = Path.home() / '.local' / 'share' ++share = Path('share') ++lib = Path('lib', 'password-store', 'extensions') + + setup( + data_files=[ +-- +2.33.1 + diff --git a/pkgs/tools/security/pass/extensions/audit/default.nix b/pkgs/tools/security/pass/extensions/audit/default.nix index 415a4b9e79d1..c4c16b8ff848 100644 --- a/pkgs/tools/security/pass/extensions/audit/default.nix +++ b/pkgs/tools/security/pass/extensions/audit/default.nix @@ -5,16 +5,17 @@ let in stdenv.mkDerivation rec { pname = "pass-audit"; - version = "1.1"; + version = "1.2"; src = fetchFromGitHub { owner = "roddhjav"; repo = "pass-audit"; rev = "v${version}"; - sha256 = "1vapymgpab91kh798mirgs1nb7j9qln0gm2d3321cmsghhb7xs45"; + sha256 = "sha256-xigP8LxRXITLF3X21zhWx6ooFNSTKGv46yFSt1dd4vs="; }; patches = [ + ./0001-Set-base-to-an-empty-value.patch ./0002-Fix-audit.bash-setup.patch ]; @@ -40,7 +41,8 @@ in stdenv.mkDerivation rec { installFlags = [ "DESTDIR=${placeholder "out"}" "PREFIX=" ]; postInstall = '' wrapProgram $out/lib/password-store/extensions/audit.bash \ - --prefix PYTHONPATH : "$out/lib/${pythonEnv.libPrefix}/site-packages" + --prefix PYTHONPATH : "$out/lib/${pythonEnv.libPrefix}/site-packages" \ + --run "export COMMAND" ''; meta = with lib; {