From b5250a333bda26b02611911845cb43376e7bbf90 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 20 Jul 2022 10:26:48 +1200 Subject: [PATCH] libredirect: Fix cross compilation `buildPackages` Currently when cross compiling the `buildPackages.libredirect` has the wrong dynamic library extension. To reproduce the issue run something like: ``` file $(nix-build -A pkgsCross.mingwW64.buildPackages.libredirect)/lib/libredirect.dll /nix/store/80llmqa9lkabg3qnmglngzz22fwf739q-libredirect-0/lib/libredirect.dll: Mach-O 64-bit dynamically linked shared library x86_64 ``` or ``` nix-diff $(nix-instantiate -A libredirect) $(nix-instantiate -A pkgsCross.mingwW64.buildPackages.libredirect) ``` --- pkgs/build-support/libredirect/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/libredirect/default.nix b/pkgs/build-support/libredirect/default.nix index 8f7df3386d14..b5eb21e5ba4b 100644 --- a/pkgs/build-support/libredirect/default.nix +++ b/pkgs/build-support/libredirect/default.nix @@ -27,7 +27,7 @@ else stdenv.mkDerivation rec { outputs = ["out" "hook"]; - libName = "libredirect" + stdenv.targetPlatform.extensions.sharedLibrary; + libName = "libredirect" + stdenv.hostPlatform.extensions.sharedLibrary; buildPhase = '' runHook preBuild