nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

rmlint: fix NIX_* environment propagations to scons

scons build system does not work by default in nixpkgs envoironment as
it filters system environment and throws away NIX_* flags:

https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html

Fix build system to always propagate os.environment. Drop the
workarounds that pass subset of the variables through.

+25 -3
+6 -3
pkgs/tools/misc/rmlint/default.nix
··· 31 31 sha256 = "15xfkcw1bkfyf3z8kl23k3rlv702m0h7ghqxvhniynvlwbgh6j2x"; 32 32 }; 33 33 34 + patches = [ 35 + # pass through NIX_* environment variables to scons. 36 + ./scons-nix-env.patch 37 + ]; 38 + 34 39 nativeBuildInputs = [ 35 40 pkg-config 36 41 sphinx ··· 61 56 ]; 62 57 63 58 prePatch = '' 64 - export CFLAGS="$NIX_CFLAGS_COMPILE" 65 - export LDFLAGS="''${NIX_LDFLAGS//-rpath /-Wl,-rpath=}" 66 - 67 59 # remove sources of nondeterminism 68 60 substituteInPlace lib/cmdline.c \ 69 61 --replace "__DATE__" "\"Jan 1 1970\"" \ ··· 69 67 --replace "gzip -c " "gzip -cn " 70 68 ''; 71 69 70 + # Otherwise tries to access /usr. 72 71 prefixKey = "--prefix="; 73 72 74 73 sconsFlags = lib.optionals (!withGui) [ "--without-gui" ];
+19
pkgs/tools/misc/rmlint/scons-nix-env.patch
··· 1 + scons does not use os environment by default: 2 + https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html 3 + 4 + nixpkgs' cc-wrapper on the other hand relies on various NIX_* variables 5 + to be passed through like NIX_CFLAGS_COMPILE_BEFORE. 6 + --- a/SConstruct 7 + +++ b/SConstruct 8 + @@ -559,10 +559,7 @@ options = dict( 9 + SHLINKCOMSTR=link_shared_library_message, 10 + LINKCOMSTR=link_program_message, 11 + PREFIX=GetOption('prefix'), 12 + - ENV = dict([ (key, os.environ[key]) 13 + - for key in os.environ 14 + - if key in ['PATH', 'TERM', 'HOME', 'PKG_CONFIG_PATH'] 15 + - ]) 16 + + ENV = os.environ, 17 + ) 18 + 19 + if ARGUMENTS.get('VERBOSE') == "1":