From 8b5a5c29f7ed0ab739b8581518ba9aabd2b74ffd Mon Sep 17 00:00:00 2001 From: Charles Duffy Date: Mon, 27 Mar 2023 12:56:51 -0500 Subject: [PATCH] pcsc-safenet: add comments documenting library symlink munging --- pkgs/tools/security/pcsc-safenet/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/security/pcsc-safenet/default.nix b/pkgs/tools/security/pcsc-safenet/default.nix index c424dfb32667..2fcbd302e8cc 100644 --- a/pkgs/tools/security/pcsc-safenet/default.nix +++ b/pkgs/tools/security/pcsc-safenet/default.nix @@ -57,15 +57,17 @@ stdenv.mkDerivation rec { mkdir "$out" cp -r ./* "$out/" + # for each library like libfoo.so.1.2.3, create symlinks to it from libfoo.so, libfoo.so.1, libfoo.so.1.2 ( cd "$out/lib/" || exit - for f in *.so.*.*.*; do - ln -sf "$f" "''${f%.*}" || exit - ln -sf "$f" "''${f%.*.*}" || exit - ln -sf "$f" "''${f%.*.*.*}" || exit + for f in *.so.*.*.*; do # find library names with three-layer suffixes + ln -sf "$f" "''${f%.*}" || exit # strip only one suffix layer + ln -sf "$f" "''${f%.*.*}" || exit # strip two suffix layers + ln -sf "$f" "''${f%.*.*.*}" || exit # strip all three suffix layers done ) || exit + # when library links are missing in pcsc/drivers, create them ( cd "$out/pcsc/drivers" || exit for f in *; do