···2727 ccVersion = (builtins.parseDrvName cc.name).version;
2828 ccName = (builtins.parseDrvName cc.name).name;
29293030- libc_bin = if nativeLibc then null else libc.bin or libc;
3131- libc_dev = if nativeLibc then null else libc.dev or libc;
3232- libc_lib = if nativeLibc then null else libc.out or libc;
3333- cc_solib = cc.lib or cc;
3434- binutils_bin = if nativeTools then "" else binutils.bin or binutils;
3030+ libc_bin = if nativeLibc then null else getBin libc;
3131+ libc_dev = if nativeLibc then null else getDev libc;
3232+ libc_lib = if nativeLibc then null else getLib libc;
3333+ cc_solib = getLib cc;
3434+ binutils_bin = if nativeTools then "" else getBin binutils;
3535 # The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
3636- coreutils_bin = if nativeTools then "" else coreutils.bin or coreutils;
3636+ coreutils_bin = if nativeTools then "" else getBin coreutils;
3737in
38383939stdenv.mkDerivation {
+4-4
pkgs/build-support/gcc-wrapper-old/default.nix
···55# stdenv.mkDerivation provides a wrapper that sets up the right environment
66# variables so that the compiler and the linker just "work".
7788-{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
88+{ name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? ""
99, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
1010, zlib ? null
1111}:
···4141 addFlags = ./add-flags;
42424343 inherit nativeTools nativeLibc nativePrefix gcc;
4444- gcc_lib = gcc.lib or gcc;
4444+ gcc_lib = lib.getLib gcc;
4545 libc = if nativeLibc then null else libc;
4646- libc_dev = if nativeLibc then null else libc.dev or libc;
4747- libc_bin = if nativeLibc then null else libc.bin or libc;
4646+ libc_dev = if nativeLibc then null else lib.getDev libc;
4747+ libc_bin = if nativeLibc then null else lib.getBin libc;
4848 binutils = if nativeTools then null else binutils;
4949 # The wrapper scripts use 'cat', so we may need coreutils
5050 coreutils = if nativeTools then null else coreutils;
···3232 # them to the RPATH so that the user doesn't have to set them in
3333 # LD_LIBRARY_PATH.
3434 NIX_LDFLAGS = map (path: "-rpath " + path) (
3535- map (x: "${x}/lib") ([ stdenv.cc.cc ] ++ (map (x: x.lib or x.out) buildInputs))
3535+ map (x: "${lib.getLib x}/lib") ([ stdenv.cc.cc ] ++ buildInputs)
3636 # libpulsecommon.so is linked but not found otherwise
3737- ++ lib.optionals pulseaudioSupport (map (x: "${x}/lib/pulseaudio") (toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ])))
3737+ ++ lib.optionals pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio")
3838+ (toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ])))
3839 );
39404041 # Don't shrink the ELF RPATHs in order to keep the extra RPATH
···223223 # include it in the result, it *is* available to nix-env for queries.
224224 meta = { }
225225 # If the packager hasn't specified `outputsToInstall`, choose a default,
226226- # namely `p.bin or p.out or p`;
226226+ # namely `lib.getBin p`;
227227 # if he has specified it, it will be overridden below in `// meta`.
228228 # Note: This default probably shouldn't be globally configurable.
229229 # Services and users should specify outputs explicitly,