Skip to content

Commit

Permalink
Merge pull request NixOS#208750 from wegank/ats2-darwin
Browse files Browse the repository at this point in the history
ats2: add darwin support
  • Loading branch information
thiagokokada authored Jan 8, 2023
2 parents 0aefade + cbee9d7 commit 5dd1eee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkgs/development/compilers/ats2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,21 @@ 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:
# *** 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 =
Expand All @@ -55,7 +64,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 ];
};
}
5 changes: 5 additions & 0 deletions pkgs/development/tools/ats-acc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; {
Expand Down

0 comments on commit 5dd1eee

Please sign in to comment.