pkgsStatic.libredirect: print error message why it won't work

The whole point of libredirect is manipulation with LD_PRELOAD, which is not
supposed to work on static builds.
This commit is contained in:
Dmitry Bogatov 2022-01-08 09:14:35 -05:00 committed by GitHub
parent 9a7742d548
commit 17577f6b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,22 @@
{ stdenv, lib, coreutils }:
{ stdenv, runCommand, lib, coreutils }:
stdenv.mkDerivation rec {
if stdenv.hostPlatform.isStatic
then throw ''
libredirect is not available on static builds.
Please fix your derivation to not depend on libredirect on static
builds, using something like following:
nativeBuildInputs =
lib.optional (!stdenv.buildPlatform.isStatic) libredirect;
and disable tests as necessary, although fixing tests to work without
libredirect is even better.
libredirect uses LD_PRELOAD feature of dynamic loader and does not
work on static builds where dynamic loader is not used.
''
else stdenv.mkDerivation rec {
pname = "libredirect";
version = "0";