treewide: fix some core package structuredAttrs

Artturin adc8900d 734d7df2

Changed files
+62 -50
pkgs
build-support
bintools-wrapper
cc-wrapper
nuke-references
pkg-config-wrapper
development
compilers
interpreters
python
libraries
gettext
glibc
perl-modules
+6 -8
pkgs/build-support/bintools-wrapper/default.nix
···
bintoolsVersion = lib.getVersion bintools;
bintoolsName = lib.removePrefix targetPrefix (lib.getName bintools);
-
libc_bin = if libc == null then null else getBin libc;
-
libc_dev = if libc == null then null else getDev libc;
-
libc_lib = if libc == null then null else getLib libc;
+
libc_bin = if libc == null then "" else getBin libc;
+
libc_dev = if libc == null then "" else getDev libc;
+
libc_lib = if libc == null then "" else getLib libc;
bintools_bin = if nativeTools then "" else getBin bintools;
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
coreutils_bin = if nativeTools then "" else getBin coreutils;
···
version = if bintools == null then null else bintoolsVersion;
preferLocalBuild = true;
-
-
inherit bintools_bin libc_bin libc_dev libc_lib;
outputs = [ "out" ] ++ optionals propagateDoc ([ "man" ] ++ optional (bintools ? info) "info");
···
strictDeps = true;
depsTargetTargetPropagated = extraPackages;
-
-
wrapperName = "BINTOOLS_WRAPPER";
setupHooks = [
../setup-hooks/role.bash
···
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
shell = getBin shell + shell.shellPath or "";
gnugrep_bin = if nativeTools then "" else gnugrep;
-
inherit dynamicLinker suffixSalt coreutils_bin;
+
wrapperName = "BINTOOLS_WRAPPER";
+
inherit dynamicLinker targetPrefix suffixSalt coreutils_bin;
+
inherit bintools_bin libc_bin libc_dev libc_lib;
};
meta =
+8 -11
pkgs/build-support/cc-wrapper/default.nix
···
ccVersion = lib.getVersion cc;
ccName = lib.removePrefix targetPrefix (lib.getName cc);
-
libc_bin = if libc == null then null else getBin libc;
-
libc_dev = if libc == null then null else getDev libc;
-
libc_lib = if libc == null then null else getLib libc;
+
libc_bin = if libc == null then "" else getBin libc;
+
libc_dev = if libc == null then "" else getDev libc;
+
libc_lib = if libc == null then "" else getLib libc;
cc_solib = getLib cc
+ optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}";
···
preferLocalBuild = true;
-
inherit cc libc_bin libc_dev libc_lib;
-
-
inherit darwinPlatformForCC darwinMinVersion darwinMinVersionVariable;
-
outputs = [ "out" ] ++ optionals propagateDoc [ "man" "info" ];
passthru = {
···
# Binutils, and Apple's "cctools"; "bintools" as an attempt to find an
# unused middle-ground name that evokes both.
inherit bintools;
-
inherit libc nativeTools nativeLibc nativePrefix isGNU isClang;
+
inherit cc libc nativeTools nativeLibc nativePrefix isGNU isClang;
emacsBufferSetup = pkgs: ''
; We should handle propagation here too
···
strictDeps = true;
propagatedBuildInputs = [ bintools ] ++ extraTools ++ optionals cc.langD or false [ zlib ];
depsTargetTargetPropagated = optional (libcxx != null) libcxx ++ extraPackages;
-
-
wrapperName = "CC_WRAPPER";
setupHooks = [
../setup-hooks/role.bash
···
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
shell = getBin shell + shell.shellPath or "";
gnugrep_bin = if nativeTools then "" else gnugrep;
-
inherit suffixSalt coreutils_bin bintools;
+
wrapperName = "CC_WRAPPER";
+
inherit suffixSalt coreutils_bin bintools cc;
+
inherit libc_bin libc_dev libc_lib;
+
inherit darwinPlatformForCC darwinMinVersion darwinMinVersionVariable;
};
meta =
+6 -4
pkgs/build-support/nuke-references/default.nix
···
'';
# FIXME: get rid of perl dependency.
-
inherit perl;
-
inherit (builtins) storeDir;
-
shell = lib.getBin shell + (shell.shellPath or "");
-
signingUtils = if darwinCodeSign then signingUtils else null;
+
env = {
+
inherit perl;
+
inherit (builtins) storeDir;
+
shell = lib.getBin shell + (shell.shellPath or "");
+
signingUtils = if darwinCodeSign then signingUtils else "";
+
};
}
+7 -6
pkgs/build-support/pkg-config-wrapper/default.nix
···
preferLocalBuild = true;
-
shell = getBin stdenvNoCC.shell + stdenvNoCC.shell.shellPath or "";
-
-
inherit targetPrefix suffixSalt baseBinName;
-
outputs = [ "out" ] ++ optionals propagateDoc ([ "man" ] ++ optional (pkg-config ? doc) "doc");
passthru = {
+
inherit targetPrefix suffixSalt;
inherit pkg-config;
};
···
+ ''
ln -s ${pkg-config}/share $out/share
'';
-
-
wrapperName = "PKG_CONFIG_WRAPPER";
setupHooks = [
../setup-hooks/role.bash
···
## Extra custom steps
##
+ extraBuildCommands;
+
+
env = {
+
shell = getBin stdenvNoCC.shell + stdenvNoCC.shell.shellPath or "";
+
wrapperName = "PKG_CONFIG_WRAPPER";
+
inherit targetPrefix suffixSalt baseBinName;
+
};
meta =
let pkg-config_ = if pkg-config != null then pkg-config else {}; in
+1
pkgs/development/compilers/gcc/builder.sh
···
+
if [ -e .attrs.sh ]; then source .attrs.sh; fi
source $stdenv/setup
+11 -9
pkgs/development/interpreters/python/cpython/default.nix
···
substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'"
'';
-
CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs);
-
LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs);
-
LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"}";
-
NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) ({
-
"glibc" = "-lgcc_s";
-
"musl" = "-lgcc_eh";
-
}."${stdenv.hostPlatform.libc}" or "");
-
# Determinism: We fix the hashes of str, bytes and datetime objects.
-
PYTHONHASHSEED=0;
+
env = {
+
CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs);
+
LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs);
+
LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"}";
+
NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) ({
+
"glibc" = "-lgcc_s";
+
"musl" = "-lgcc_eh";
+
}."${stdenv.hostPlatform.libc}" or "");
+
# Determinism: We fix the hashes of str, bytes and datetime objects.
+
PYTHONHASHSEED=0;
+
};
configureFlags = [
"--without-ensurepip"
+3 -1
pkgs/development/interpreters/python/setup-hook.nix
···
hook = ./setup-hook.sh;
in runCommand "python-setup-hook.sh" {
strictDeps = true;
-
inherit sitePackages;
+
env = {
+
inherit sitePackages;
+
};
} ''
cp ${hook} hook.sh
substituteAllInPlace hook.sh
+3 -1
pkgs/development/libraries/gettext/default.nix
···
../../../build-support/setup-hooks/role.bash
./gettext-setup-hook.sh
];
-
gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl;
+
env = {
+
gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl;
+
};
enableParallelBuilding = true;
enableParallelChecking = false; # fails sometimes
+8 -7
pkgs/development/libraries/glibc/common.nix
···
stdenv.mkDerivation ({
version = version + patchSuffix;
-
linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
-
-
inherit (stdenv) is64bit;
enableParallelBuilding = true;
···
nativeBuildInputs = [ bison python3Minimal ] ++ extraNativeBuildInputs;
buildInputs = [ linuxHeaders ] ++ lib.optionals withGd [ gd libpng ] ++ extraBuildInputs;
-
# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to
-
# prevent a retained dependency on the bootstrap tools in the stdenv-linux
-
# bootstrap.
-
BASH_SHELL = "/bin/sh";
+
env = {
+
linuxHeaders = if withLinuxHeaders then linuxHeaders else "";
+
inherit (stdenv) is64bit;
+
# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to
+
# prevent a retained dependency on the bootstrap tools in the stdenv-linux
+
# bootstrap.
+
BASH_SHELL = "/bin/sh";
+
};
# Used by libgcc, elf-header, and others to determine ABI
passthru = { inherit version; minorRelease = version; };
+3
pkgs/development/perl-modules/generic/builder.sh
···
+
if [ -f .attrs.sh ]; then
+
. .attrs.sh
+
fi
source $stdenv/setup
PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/perl5/site_perl"
+6 -3
pkgs/development/perl-modules/generic/default.nix
···
# https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-%28%22.%22%29-from-@INC
, PERL_USE_UNSAFE_INC ? "1"
+
, env ? {}
+
, ...
}@attrs:
···
buildInputs = buildInputs ++ [ perl ];
nativeBuildInputs = nativeBuildInputs ++ [ (perl.mini or perl) ];
-
fullperl = buildPerl;
-
inherit outputs src doCheck checkTarget enableParallelBuilding;
-
inherit PERL_AUTOINSTALL AUTOMATED_TESTING PERL_USE_UNSAFE_INC;
+
env = {
+
inherit PERL_AUTOINSTALL AUTOMATED_TESTING PERL_USE_UNSAFE_INC;
+
fullperl = buildPerl;
+
} // env;
meta = defaultMeta // (attrs.meta or { });
});