From df931c41b42acc7bcd8436a59c693e4449ff752e Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 2 Jan 2023 13:41:43 +0100 Subject: [PATCH 1/2] ats2: add darwin support --- pkgs/development/compilers/ats2/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ats2/default.nix b/pkgs/development/compilers/ats2/default.nix index f8de9f57b5d3..a5c4f00f0f5e 100644 --- a/pkgs/development/compilers/ats2/default.nix +++ b/pkgs/development/compilers/ats2/default.nix @@ -40,6 +40,11 @@ stdenv.mkDerivation rec { # *** No rule to make target 'patscc.dats', needed by 'patscc_dats.c'. Stop. enableParallelBuilding = false; + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "CCOMP=${stdenv.cc.targetPrefix}cc" + ]; + setupHook = with lib; let hookFiles = @@ -55,7 +60,7 @@ stdenv.mkDerivation rec { description = "Functional programming language with dependent types"; homepage = "http://www.ats-lang.org"; license = licenses.gpl3Plus; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ thoughtpolice ttuegel bbarker ]; }; } From cbee9d7965197fc1452c70407253410316624c69 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 2 Jan 2023 14:44:38 +0100 Subject: [PATCH 2/2] ats-acc: fix build --- pkgs/development/compilers/ats2/default.nix | 4 ++++ pkgs/development/tools/ats-acc/default.nix | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pkgs/development/compilers/ats2/default.nix b/pkgs/development/compilers/ats2/default.nix index a5c4f00f0f5e..f9ba2e1ac417 100644 --- a/pkgs/development/compilers/ats2/default.nix +++ b/pkgs/development/compilers/ats2/default.nix @@ -34,6 +34,10 @@ stdenv.mkDerivation rec { hash = "sha256-UWgDjFojPBYgykrCrJyYvVWY+Gc5d4aRGjTWjc528AM="; }; + postPatch = lib.optionalString stdenv.cc.isClang '' + sed -i 's/gcc/clang/g' utils/*/DATS/atscc_util.dats + ''; + buildInputs = [ gmp ]; # Disable parallel build, errors: diff --git a/pkgs/development/tools/ats-acc/default.nix b/pkgs/development/tools/ats-acc/default.nix index 73e475da3942..5a3cd9c64010 100644 --- a/pkgs/development/tools/ats-acc/default.nix +++ b/pkgs/development/tools/ats-acc/default.nix @@ -11,6 +11,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-Wp39488YNL40GKp4KaJwhi75PsYP+gMtrZqAvs4Q/sw="; }; + postPatch = '' + substituteInPlace Makefile \ + --replace "mv acc \''$(PATSHOME)/bin/" "install -Dm755 acc ${placeholder "out"}/bin/" + ''; + nativeBuildInputs = [ ats2 ]; meta = with lib; {