diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-02-10 21:18:34 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-04-23 10:52:00 +0200 |
commit | 6e7787e666c50558b5aa10ffcca8e6c0c9bc1ba3 (patch) | |
tree | 0112b955ff093ab55a30f65c9017d6810876ab13 /pkgs/stdenv | |
parent | 13df963c7eef2f2a6f469a881084bc5473d4cd88 (diff) |
stdenv for windows: auto-link dependency DLLs
For every *.{exe,dll} in $output/bin/ we try to find all (potential) transitive dependencies and symlink those DLLs into $output/bin so they are found on invocation. (DLLs are first searched in the directory of the running exe file.) The links are relative, so relocating whole /nix/store won't break them. The hook is activated on cygwin and when cross-compiling to mingw.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 547541d28246e..e01be369f423a 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -196,7 +196,13 @@ let buildInputs = if crossConfig != null then buildInputs' else []; propagatedBuildInputs = if crossConfig != null then propagatedBuildInputs else []; # Inputs built by the usual native compiler. - nativeBuildInputs = nativeBuildInputs ++ (if crossConfig == null then buildInputs' else []); + nativeBuildInputs = nativeBuildInputs + ++ lib.optionals (crossConfig == null) buildInputs' + ++ lib.optional + (result.isCygwin + || (crossConfig != null && lib.hasSuffix "mingw32" crossConfig)) + ../../build-support/setup-hooks/win-dll-link.sh + ; propagatedNativeBuildInputs = propagatedNativeBuildInputs ++ (if crossConfig == null then propagatedBuildInputs else []); } // ifDarwin { |