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 5ad0ecb901.
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.
This commit is contained in:
Yarny0 2023-04-05 19:30:17 +02:00
parent 941b891e26
commit fca76c5810
2 changed files with 8 additions and 10 deletions

View file

@ -6,7 +6,6 @@
, autoPatchelfHook
, rpmextract
, libxcrypt-legacy
, openssl
, zlib
, lvm2 # LVM image backup and restore functions (optional)
, acl # EXT2/EXT3/XFS ACL support (optional)
@ -118,7 +117,6 @@ let
];
buildInputs = [
libxcrypt-legacy
openssl
stdenv.cc.cc
zlib
];
@ -146,7 +144,8 @@ let
runHook postInstall
'';
# Fix relative symlinks after `/usr` was moved up one level
# fix relative symlinks after `/usr` was moved up one level,
# fix absolute symlinks pointing to `/opt`
preFixup = ''
for link in $out/lib{,64}/* $out/bin/*
do
@ -158,6 +157,10 @@ let
fi
ln --symbolic --force --no-target-directory "$out/$(cut -b 7- <<< "$target")" "$link"
done
for link in $(find $out -type l -lname '/opt/*')
do
ln --symbolic --force --no-target-directory "$out$(readlink "$link")" "$link"
done
'';
};

View file

@ -7027,13 +7027,8 @@ with pkgs;
timeline = callPackage ../applications/office/timeline { };
tsm-client = callPackage ../tools/backup/tsm-client {
openssl = openssl_1_1;
};
tsm-client-withGui = callPackage ../tools/backup/tsm-client {
openssl = openssl_1_1;
enableGui = true;
};
tsm-client = callPackage ../tools/backup/tsm-client { };
tsm-client-withGui = callPackage ../tools/backup/tsm-client { enableGui = true; };
tracker = callPackage ../development/libraries/tracker { };