cygwin-dll-link: move from make-derivation to cross stdenv

This commit is contained in:
David McFarland
2025-12-29 14:53:21 -04:00
parent 208e7dd03b
commit a61e4dbb18
5 changed files with 20 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ addOutputDLLPaths() {
postInstallHooks+=(addOutputDLLPaths)
_dllDeps() {
"$OBJDUMP" -p "$1" \
@objdump@ -p "$1" \
| sed -n 's/.*DLL Name: \(.*\)/\1/p' \
| sort -u
}

View File

@@ -0,0 +1,13 @@
{
lib,
makeSetupHook,
binutils-unwrapped,
stdenv,
callPackage,
}:
makeSetupHook {
name = "cygwin-dll-link-hook";
substitutions = {
objdump = "${lib.getBin binutils-unwrapped}/${stdenv.targetPlatform.config}/bin/objdump";
};
} ./cygwin-dll-link.sh

View File

@@ -21,5 +21,7 @@ makeScopeWithSplicing' {
# this is here to avoid symlinks being made to cygwin1.dll in /nix/store
newlib-cygwin-nobin = callPackage ./newlib-cygwin/nobin.nix { };
newlib-cygwin-headers = callPackage ./newlib-cygwin { headersOnly = true; };
cygwinDllLinkHook = callPackage ./cygwin-dll-link-hook { };
};
}

View File

@@ -83,7 +83,10 @@ lib.init bootStages
|| p.isGenode;
in
f hostPlatform && !(f buildPlatform)
) buildPackages.updateAutotoolsGnuConfigScriptsHook;
) buildPackages.updateAutotoolsGnuConfigScriptsHook
++ lib.optional (
hostPlatform.isCygwin && !buildPlatform.isCygwin
) buildPackages.cygwin.cygwinDllLinkHook;
})
);
in

View File

@@ -475,7 +475,6 @@ let
nativeBuildInputs
++ optional separateDebugInfo' ../../build-support/setup-hooks/separate-debug-info.sh
++ optional isWindows ../../build-support/setup-hooks/win-dll-link.sh
++ optional isCygwin ../../build-support/setup-hooks/cygwin-dll-link.sh
++ optionals doCheck nativeCheckInputs
++ optionals doInstallCheck nativeInstallCheckInputs;