From 2f3760f135616ebc477d3ed74eba9b63c22f83a0 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 8 Aug 2023 12:45:05 +0800 Subject: [PATCH] The compiled code will need to run on hostPlatform (#551) I admit I am a dog at cross-compilation but the nixpkgs manual says > The "host platform" is the platform on which a package will be run. This is the simplest platform to understand, but also the one with the worst name. When we: - build blst - as part of a linux build tool - that is needed to compile something for mingw64 then blst gets configured with `./build.sh flavour=mingw64\n./build.sh -shared flavour=mingw64` while it's actually built on linux and for linux (where the build tool will run). Using hostPlatform seems to make this work ok. --- overlays/crypto/libblst.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overlays/crypto/libblst.nix b/overlays/crypto/libblst.nix index aa9c70b5..c00e6125 100644 --- a/overlays/crypto/libblst.nix +++ b/overlays/crypto/libblst.nix @@ -7,9 +7,9 @@ stdenv.mkDerivation rec { inherit src; buildPhase = '' - ./build.sh ${lib.optionalString stdenv.targetPlatform.isWindows "flavour=mingw64"} + ./build.sh ${lib.optionalString stdenv.hostPlatform.isWindows "flavour=mingw64"} '' + '' - ./build.sh -shared ${lib.optionalString stdenv.targetPlatform.isWindows "flavour=mingw64"} + ./build.sh -shared ${lib.optionalString stdenv.hostPlatform.isWindows "flavour=mingw64"} ''; installPhase = '' mkdir -p $out/{lib,include}