2010-05-19 20:59:20 +00:00
|
|
|
{ stdenv, gnupg, coreutils, writeScript }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2021-11-29 18:24:13 +00:00
|
|
|
pname = "gnupg1compat";
|
|
|
|
version = gnupg.version;
|
2010-05-19 20:59:20 +00:00
|
|
|
|
|
|
|
builder = writeScript "gnupg1compat-builder" ''
|
2018-10-06 18:26:35 +00:00
|
|
|
PATH=${coreutils}/bin
|
2010-05-19 20:59:20 +00:00
|
|
|
# First symlink all top-level dirs
|
2018-10-06 18:26:35 +00:00
|
|
|
mkdir -p $out
|
|
|
|
ln -s "${gnupg}/"* $out
|
2010-05-19 20:59:20 +00:00
|
|
|
|
|
|
|
# Replace bin with directory and symlink it contents
|
2018-10-06 18:26:35 +00:00
|
|
|
rm $out/bin
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s "${gnupg}/bin/"* $out/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
|
2010-05-19 20:59:20 +00:00
|
|
|
'';
|
2016-08-02 16:06:29 +00:00
|
|
|
|
2017-03-27 19:47:38 +00:00
|
|
|
meta = gnupg.meta // {
|
|
|
|
description = gnupg.meta.description +
|
|
|
|
" with symbolic links for gpg and gpgv";
|
2017-04-04 13:48:55 +00:00
|
|
|
priority = -1;
|
2016-08-02 16:06:29 +00:00
|
|
|
};
|
2010-05-19 20:59:20 +00:00
|
|
|
}
|