2014-05-26 23:00:04 +00:00
|
|
|
{ stdenv }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "libredirect-0";
|
|
|
|
|
|
|
|
unpackPhase = "cp ${./libredirect.c} libredirect.c";
|
|
|
|
|
|
|
|
buildPhase =
|
|
|
|
''
|
|
|
|
gcc -Wall -std=c99 -O3 -shared libredirect.c -o libredirect.so -fPIC -ldl
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = "mkdir -p $out/lib; cp libredirect.so $out/lib";
|
2016-08-02 16:06:29 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2017-12-14 19:03:35 +00:00
|
|
|
description = "An LD_PRELOAD library to intercept and rewrite the paths in glibc calls";
|
|
|
|
longDescription = ''
|
|
|
|
libredirect is an LD_PRELOAD library to intercept and rewrite the paths in
|
|
|
|
glibc calls based on the value of $NIX_REDIRECTS, a colon-separated list
|
|
|
|
of path prefixes to be rewritten, e.g. "/src=/dst:/usr/=/nix/store/".
|
|
|
|
'';
|
2016-08-02 16:06:29 +00:00
|
|
|
};
|
2014-05-26 23:00:04 +00:00
|
|
|
}
|