windows: makeScope -> makeScopeWithSplicing (#447492)

This commit is contained in:
John Ericson
2025-11-11 17:46:19 +00:00
committed by GitHub
+42 -36
View File
@@ -3,53 +3,59 @@
config,
stdenv,
buildPackages,
pkgs,
pkgsHostTarget,
newScope,
overrideCC,
stdenvNoLibc,
emptyDirectory,
libc,
makeScopeWithSplicing',
generateSplicesForMkScope,
}:
lib.makeScope newScope (
self:
with self;
{
dlfcn = callPackage ./dlfcn { };
makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope "windows";
f =
self:
let
inherit (self) callPackage;
in
{
dlfcn = callPackage ./dlfcn { };
mingw_w64 = callPackage ./mingw-w64 {
stdenv = stdenvNoLibc;
};
mingw_w64 = callPackage ./mingw-w64 {
stdenv = stdenvNoLibc;
};
# FIXME untested with llvmPackages_16 was using llvmPackages_8
crossThreadsStdenv = overrideCC stdenvNoLibc (
if stdenv.hostPlatform.useLLVM or false then
buildPackages.llvmPackages.clangNoLibcxx
else
buildPackages.gccWithoutTargetLibc.override (old: {
bintools = old.bintools.override {
libc = pkgs.pkgsHostTarget.libc;
noLibc = pkgs.libc == null;
# FIXME untested with llvmPackages_16 was using llvmPackages_8
crossThreadsStdenv = overrideCC stdenvNoLibc (
if stdenv.hostPlatform.useLLVM or false then
buildPackages.llvmPackages.clangNoLibcxx
else
buildPackages.gccWithoutTargetLibc.override (old: {
bintools = old.bintools.override {
libc = pkgsHostTarget.libc;
noLibc = libc == null;
nativeLibc = false;
};
libc = pkgsHostTarget.libc;
noLibc = libc == null;
nativeLibc = false;
};
libc = pkgs.pkgsHostTarget.libc;
noLibc = pkgs.libc == null;
nativeLibc = false;
})
);
})
);
mingw_w64_headers = callPackage ./mingw-w64/headers.nix { };
mingw_w64_headers = callPackage ./mingw-w64/headers.nix { };
mcfgthreads = callPackage ./mcfgthreads { stdenv = crossThreadsStdenv; };
mcfgthreads = callPackage ./mcfgthreads { stdenv = self.crossThreadsStdenv; };
npiperelay = callPackage ./npiperelay { };
npiperelay = callPackage ./npiperelay { };
pthreads = callPackage ./mingw-w64/pthreads.nix { stdenv = crossThreadsStdenv; };
pthreads = callPackage ./mingw-w64/pthreads.nix { stdenv = self.crossThreadsStdenv; };
libgnurx = callPackage ./libgnurx { };
libgnurx = callPackage ./libgnurx { };
sdk = callPackage ./msvcSdk { };
}
// lib.optionalAttrs config.allowAliases {
mingw_w64_pthreads = lib.warn "windows.mingw_w64_pthreads is deprecated, windows.pthreads should be preferred" self.pthreads;
}
)
sdk = callPackage ./msvcSdk { };
}
// lib.optionalAttrs config.allowAliases {
mingw_w64_pthreads = lib.warn "windows.mingw_w64_pthreads is deprecated, windows.pthreads should be preferred" self.pthreads;
};
}