Skip to content

Commit

Permalink
fix macos-nix build where refc support files don't build under defaul…
Browse files Browse the repository at this point in the history
…t environment anymore (#3246)
  • Loading branch information
mattpolzin committed Apr 2, 2024
1 parent 1977dbd commit aa3f67c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 8 additions & 1 deletion nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ]
Expand Down
9 changes: 6 additions & 3 deletions nix/support.nix
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -10,7 +13,7 @@ stdenv.mkDerivation rec {

makeFlags = [
"PREFIX=$(out)"
] ++ lib.optional stdenv.isDarwin "OS=";
] ++ lib.optional stdenv'.isDarwin "OS=";

buildFlags = [ "support" ];

Expand Down

0 comments on commit aa3f67c

Please sign in to comment.