2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, gmp
|
2020-04-24 23:36:52 +00:00
|
|
|
, withEmacsSupport ? true
|
|
|
|
, withContrib ? true }:
|
|
|
|
|
|
|
|
let
|
2020-10-16 20:44:37 +00:00
|
|
|
versionPkg = "0.4.1" ;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
contrib = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz";
|
2020-10-16 20:44:37 +00:00
|
|
|
sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postInstallContrib = lib.optionalString withContrib
|
2020-04-24 23:36:52 +00:00
|
|
|
''
|
|
|
|
local contribDir=$out/lib/ats2-postiats-*/ ;
|
|
|
|
mkdir -p $contribDir ;
|
|
|
|
tar -xzf "${contrib}" --strip-components 1 -C $contribDir ;
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postInstallEmacs = lib.optionalString withEmacsSupport
|
2020-04-24 23:36:52 +00:00
|
|
|
''
|
|
|
|
local siteLispDir=$out/share/emacs/site-lisp/ats2 ;
|
|
|
|
mkdir -p $siteLispDir ;
|
|
|
|
install -m 0644 -v ./utils/emacs/*.el $siteLispDir ;
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ats2";
|
|
|
|
version = versionPkg;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-gmp-${version}.tgz";
|
2020-10-16 20:44:37 +00:00
|
|
|
sha256 = "0c4nqp6yzmpj0mcpg7ibmwyqi8hjw3sza8myvy4nzq3fa6wldy5l";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gmp ];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# Disable parallel build, errors:
|
|
|
|
# *** No rule to make target 'patscc.dats', needed by 'patscc_dats.c'. Stop.
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
setupHook = with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
hookFiles =
|
|
|
|
[ ./setup-hook.sh ]
|
|
|
|
++ optional withContrib ./setup-contrib-hook.sh;
|
|
|
|
in
|
|
|
|
builtins.toFile "setupHook.sh"
|
|
|
|
(concatMapStringsSep "\n" builtins.readFile hookFiles);
|
|
|
|
|
|
|
|
postInstall = postInstallContrib + postInstallEmacs;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Functional programming language with dependent types";
|
|
|
|
homepage = "http://www.ats-lang.org";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ttuegel bbarker ];
|
|
|
|
};
|
|
|
|
}
|