fix macos-nix build where refc support files don't build under default environment anymore (#3246)

This commit is contained in:
Mathew Polzin 2024-04-01 20:09:38 -05:00 committed by GitHub
parent 1977dbd640
commit aa3f67cd11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -19,9 +19,16 @@ stdenv.mkDerivation rec {
++ lib.optional (!bootstrap) [ idris2Bootstrap ];
buildInputs = [ chez gmp support ];
# For bootstrap builds the Makefile will try to
# rebuild the support library if we don't patch
# bootstrap-install.
prePatch = ''
patchShebangs --build tests
sed 's/$(GIT_SHA1)/${srcRev}/' -i Makefile
substituteInPlace Makefile \
--replace-fail '$(GIT_SHA1)' '${srcRev}'
'' + lib.optionalString bootstrap ''
substituteInPlace Makefile \
--replace-fail 'bootstrap-install: install-idris2 install-support' 'bootstrap-install: install-idris2'
'';
makeFlags = [ "IDRIS2_SUPPORT_DIR=${supportLibrariesPath}" ]

View File

@ -1,5 +1,8 @@
{ stdenv, lib, gmp, idris2Version }:
stdenv.mkDerivation rec {
{ stdenv, lib, overrideSDK, gmp, idris2Version }:
let
stdenv' = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv;
in
stdenv'.mkDerivation rec {
pname = "libidris2_support";
version = idris2Version;
@ -10,7 +13,7 @@ stdenv.mkDerivation rec {
makeFlags = [
"PREFIX=$(out)"
] ++ lib.optional stdenv.isDarwin "OS=";
] ++ lib.optional stdenv'.isDarwin "OS=";
buildFlags = [ "support" ];