git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit17577f6b54d71875b6c14edb31dbd474282d663e authorDmitry Bogatov <kaction@disroot.org> dateSat 8 Jan 2022, 09:14 (5 years ago) parent9a7742d
1 file changed+18−2
pkgs/build-support/libredirect/default.nix+18−2
pkgs/build-support/libredirect/default.nix+18−2
@@ -1,6 +1,22 @@
1−{ stdenv, lib, coreutils }:
1+{ stdenv, runCommand, lib, coreutils }:
22
3−stdenv.mkDerivation rec {
3+if stdenv.hostPlatform.isStatic
4+then throw ''
5+ libredirect is not available on static builds.
6+
7+ Please fix your derivation to not depend on libredirect on static
8+ builds, using something like following:
9+
10+ nativeBuildInputs =
11+ lib.optional (!stdenv.buildPlatform.isStatic) libredirect;
12+
13+ and disable tests as necessary, although fixing tests to work without
14+ libredirect is even better.
15+
16+ libredirect uses LD_PRELOAD feature of dynamic loader and does not
17+ work on static builds where dynamic loader is not used.
18+ ''
19+else stdenv.mkDerivation rec {
420 pname = "libredirect";
521 version = "0";
622