Skip to content

Commit

Permalink
Merge pull request #47977 from charles-dyfis-net/gnupg20-1compat-fix
Browse files Browse the repository at this point in the history
gnupg1compat: fix compatibility with gnupg20
  • Loading branch information
lsix committed Oct 10, 2018
2 parents cf47423 + 1e23714 commit 20249ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
18 changes: 13 additions & 5 deletions pkgs/tools/security/gnupg/1compat.nix
Expand Up @@ -4,14 +4,22 @@ stdenv.mkDerivation {
name = "gnupg1compat-${gnupg.version}";

builder = writeScript "gnupg1compat-builder" ''
PATH=${coreutils}/bin
# First symlink all top-level dirs
${coreutils}/bin/mkdir -p $out
${coreutils}/bin/ln -s "${gnupg}/"* $out
mkdir -p $out
ln -s "${gnupg}/"* $out
# Replace bin with directory and symlink it contents
${coreutils}/bin/rm $out/bin
${coreutils}/bin/mkdir -p $out/bin
${coreutils}/bin/ln -s "${gnupg}/bin/"* $out/bin
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
'';

meta = gnupg.meta // {
Expand Down
3 changes: 2 additions & 1 deletion pkgs/tools/security/gnupg/20.nix
Expand Up @@ -12,7 +12,8 @@ with stdenv.lib;
assert guiSupport -> pinentry != null;

stdenv.mkDerivation rec {
name = "gnupg-2.0.30";
name = "gnupg-${version}";
version = "2.0.30";

src = fetchurl {
url = "mirror://gnupg/gnupg/${name}.tar.bz2";
Expand Down

0 comments on commit 20249ca

Please sign in to comment.