1 { stdenv, gnupg, coreutils, writeScript }:
4 pname = "gnupg1compat";
5 version = gnupg.version;
7 builder = writeScript "gnupg1compat-builder" ''
9 # First symlink all top-level dirs
11 ln -s "${gnupg}/"* $out
13 # Replace bin with directory and symlink it contents
16 ln -s "${gnupg}/bin/"* $out/bin
18 # Add symlinks for any executables that end in 2 and lack any non-*2 version
19 for f in $out/bin/*2; do
20 [[ -x $f ]] || continue # ignore failed globs and non-executable files
21 [[ -e ''${f%2} ]] && continue # ignore commands that already have non-*2 versions
22 ln -s -- "''${f##*/}" "''${f%2}"
26 meta = gnupg.meta // {
27 description = gnupg.meta.description +
28 " with symbolic links for gpg and gpgv";