libredirect: Add support for Darwin
The library can be used also on Darwin using it like this: NIX_REDIRECTS='foo=bar' \ DYLD_INSERT_LIBRARIES=${libredirect}/lib/libredirect.so \ DYLD_FORCE_FLAT_NAMESPACE=1 \ some_program So let's actually not hardcade gcc and add Darwin to meta.platforms. No other changes seem to be required. Signed-off-by: aszlig <aszlig@nix.build>
This commit is contained in:
parent
c2464df58f
commit
753743c37b
@ -5,15 +5,14 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
unpackPhase = "cp ${./libredirect.c} libredirect.c";
|
unpackPhase = "cp ${./libredirect.c} libredirect.c";
|
||||||
|
|
||||||
buildPhase =
|
buildPhase = ''
|
||||||
''
|
cc -Wall -std=c99 -O3 -shared libredirect.c -o libredirect.so -fPIC -ldl
|
||||||
gcc -Wall -std=c99 -O3 -shared libredirect.c -o libredirect.so -fPIC -ldl
|
'';
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = "mkdir -p $out/lib; cp libredirect.so $out/lib";
|
installPhase = "mkdir -p $out/lib; cp libredirect.so $out/lib";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
||||||
description = "An LD_PRELOAD library to intercept and rewrite the paths in glibc calls";
|
description = "An LD_PRELOAD library to intercept and rewrite the paths in glibc calls";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
libredirect is an LD_PRELOAD library to intercept and rewrite the paths in
|
libredirect is an LD_PRELOAD library to intercept and rewrite the paths in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user