diff --git a/pkgs/os-specific/windows/default.nix b/pkgs/os-specific/windows/default.nix index e0f7e5b5f79e..086f05147f0d 100644 --- a/pkgs/os-specific/windows/default.nix +++ b/pkgs/os-specific/windows/default.nix @@ -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; + }; +}