diff --git a/pkgs/tools/security/gnupg/1compat.nix b/pkgs/tools/security/gnupg/1compat.nix index 040ce178c3b8..c6556533ea49 100644 --- a/pkgs/tools/security/gnupg/1compat.nix +++ b/pkgs/tools/security/gnupg/1compat.nix @@ -1,4 +1,5 @@ { + lib, stdenv, gnupg, coreutils, @@ -7,26 +8,32 @@ stdenv.mkDerivation { pname = "gnupg1compat"; - version = gnupg.version; + inherit (gnupg) version outputs; - builder = writeScript "gnupg1compat-builder" '' - PATH=${coreutils}/bin - # First symlink all top-level dirs - mkdir -p $out - ln -s "${gnupg}/"* $out + builder = writeScript "gnupg1compat-builder" ( + '' + PATH=${coreutils}/bin + '' + # First symlink all top-level dirs, output per output + + lib.concatMapStringsSep "\n" (o: '' + mkdir -p ''$${o} + ln -s "${gnupg.${o}}/"* ''$${o} + '') gnupg.outputs + + '' - # Replace bin with directory and symlink it contents - rm $out/bin - mkdir -p $out/bin - ln -s "${gnupg}/bin/"* $out/bin + # Replace bin with directory and symlink it contents + rm ''${!outputBin}/bin + mkdir -p ''${!outputBin}/bin + ln -s "${lib.getBin gnupg}/bin/"* ''${!outputBin}/bin - # Add symlinks for any executables that end in 2 and lack any non-*2 version - for f in $out/bin/*2; do - [[ -x $f ]] || continue # ignore failed globs and non-executable files - [[ -e ''${f%2} ]] && continue # ignore commands that already have non-*2 versions - ln -s -- "''${f##*/}" "''${f%2}" - done - ''; + # Add symlinks for any executables that end in 2 and lack any non-*2 version + for f in ''${!outputBin}/bin/*2; do + [[ -x $f ]] || continue # ignore failed globs and non-executable files + [[ -e ''${f%2} ]] && continue # ignore commands that already have non-*2 versions + ln -s -- "''${f##*/}" "''${f%2}" + done + '' + ); meta = gnupg.meta // { description = gnupg.meta.description + " with symbolic links for gpg and gpgv"; diff --git a/pkgs/tools/security/gnupg/24.nix b/pkgs/tools/security/gnupg/24.nix index e2ffda108211..7c54fe082ac3 100644 --- a/pkgs/tools/security/gnupg/24.nix +++ b/pkgs/tools/security/gnupg/24.nix @@ -167,6 +167,13 @@ stdenv.mkDerivation rec { ++ lib.optional withTpm2Tss "--with-tss=intel" ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-ccid-driver"; + outputs = [ + "out" + "info" + "man" + "doc" + ]; + postInstall = if enableMinimal then ''