lol

tsm-client: fix absolute symlinks, drop openssl dependency

`tsm-client` is delivered with its
own `lib{crypto,ssl}.so` implementation.
Beginning with version 8.1.9.1, those `.so`-files came with
absolute symlinks to `/opt/...` causing `autoPatchelf`
to abort with error messages of the form

> error: auto-patchelf could not satisfy dependency libssl.so.1.1

I was under the impression that a new dependency
got introduced and added `openssl` to `builtInputs`
in commit 5ad0ecb9019e964d2abfe034e184f8b846e42dfa.
This fixed the build, but `tsm-client` no longer
linked against its own ssl implementation.

The commit at hand corrects that mistake:
It adds a small `preFixup` script that finds
and adapts absolute symlinks to `/opt/`,
so that `autoPatchelfHook` finds those
`so`-files again and sets RPATH properly.
This permits to drop `openssl` from the dependency list again.

Yarny0 fca76c58 941b891e

+8 -10
+6 -3
pkgs/tools/backup/tsm-client/default.nix
··· 6 6 , autoPatchelfHook 7 7 , rpmextract 8 8 , libxcrypt-legacy 9 - , openssl 10 9 , zlib 11 10 , lvm2 # LVM image backup and restore functions (optional) 12 11 , acl # EXT2/EXT3/XFS ACL support (optional) ··· 118 117 ]; 119 118 buildInputs = [ 120 119 libxcrypt-legacy 121 - openssl 122 120 stdenv.cc.cc 123 121 zlib 124 122 ]; ··· 146 144 runHook postInstall 147 145 ''; 148 146 149 - # Fix relative symlinks after `/usr` was moved up one level 147 + # fix relative symlinks after `/usr` was moved up one level, 148 + # fix absolute symlinks pointing to `/opt` 150 149 preFixup = '' 151 150 for link in $out/lib{,64}/* $out/bin/* 152 151 do ··· 157 156 exit 1 158 157 fi 159 158 ln --symbolic --force --no-target-directory "$out/$(cut -b 7- <<< "$target")" "$link" 159 + done 160 + for link in $(find $out -type l -lname '/opt/*') 161 + do 162 + ln --symbolic --force --no-target-directory "$out$(readlink "$link")" "$link" 160 163 done 161 164 ''; 162 165 };
+2 -7
pkgs/top-level/all-packages.nix
··· 7027 7027 7028 7028 timeline = callPackage ../applications/office/timeline { }; 7029 7029 7030 - tsm-client = callPackage ../tools/backup/tsm-client { 7031 - openssl = openssl_1_1; 7032 - }; 7033 - tsm-client-withGui = callPackage ../tools/backup/tsm-client { 7034 - openssl = openssl_1_1; 7035 - enableGui = true; 7036 - }; 7030 + tsm-client = callPackage ../tools/backup/tsm-client { }; 7031 + tsm-client-withGui = callPackage ../tools/backup/tsm-client { enableGui = true; }; 7037 7032 7038 7033 tracker = callPackage ../development/libraries/tracker { }; 7039 7034