Skip to content

Commit

Permalink
The compiled code will need to run on hostPlatform (#551)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andreabedini authored Aug 8, 2023
1 parent 0ca907c commit 2f3760f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions overlays/crypto/libblst.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 2f3760f

Please sign in to comment.