diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/misc/rmlint/default.nix | 9 | ||||
-rw-r--r-- | pkgs/tools/misc/rmlint/scons-nix-env.patch | 19 |
2 files changed, 25 insertions, 3 deletions
diff --git a/pkgs/tools/misc/rmlint/default.nix b/pkgs/tools/misc/rmlint/default.nix index 850bdb83c8987..e3969d01eec3e 100644 --- a/pkgs/tools/misc/rmlint/default.nix +++ b/pkgs/tools/misc/rmlint/default.nix @@ -31,6 +31,11 @@ stdenv.mkDerivation rec { sha256 = "15xfkcw1bkfyf3z8kl23k3rlv702m0h7ghqxvhniynvlwbgh6j2x"; }; + patches = [ + # pass through NIX_* environment variables to scons. + ./scons-nix-env.patch + ]; + nativeBuildInputs = [ pkg-config sphinx @@ -56,9 +61,6 @@ stdenv.mkDerivation rec { ]; prePatch = '' - export CFLAGS="$NIX_CFLAGS_COMPILE" - export LDFLAGS="''${NIX_LDFLAGS//-rpath /-Wl,-rpath=}" - # remove sources of nondeterminism substituteInPlace lib/cmdline.c \ --replace "__DATE__" "\"Jan 1 1970\"" \ @@ -67,6 +69,7 @@ stdenv.mkDerivation rec { --replace "gzip -c " "gzip -cn " ''; + # Otherwise tries to access /usr. prefixKey = "--prefix="; sconsFlags = lib.optionals (!withGui) [ "--without-gui" ]; diff --git a/pkgs/tools/misc/rmlint/scons-nix-env.patch b/pkgs/tools/misc/rmlint/scons-nix-env.patch new file mode 100644 index 0000000000000..10ed5698be3a7 --- /dev/null +++ b/pkgs/tools/misc/rmlint/scons-nix-env.patch @@ -0,0 +1,19 @@ +scons does not use os environment by default: + https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html + +nixpkgs' cc-wrapper on the other hand relies on various NIX_* variables +to be passed through like NIX_CFLAGS_COMPILE_BEFORE. +--- a/SConstruct ++++ b/SConstruct +@@ -559,10 +559,7 @@ options = dict( + SHLINKCOMSTR=link_shared_library_message, + LINKCOMSTR=link_program_message, + PREFIX=GetOption('prefix'), +- ENV = dict([ (key, os.environ[key]) +- for key in os.environ +- if key in ['PATH', 'TERM', 'HOME', 'PKG_CONFIG_PATH'] +- ]) ++ ENV = os.environ, + ) + + if ARGUMENTS.get('VERBOSE') == "1": |