2021-01-22 12:25:31 +01:00
|
|
|
{ lib, stdenv, fetchurl, gmp
|
2016-10-24 02:28:02 +02:00
|
|
|
, withEmacsSupport ? true
|
|
|
|
, withContrib ? true }:
|
|
|
|
|
|
|
|
let
|
2020-10-11 03:26:59 +02:00
|
|
|
versionPkg = "0.4.1" ;
|
2016-10-24 02:28:02 +02:00
|
|
|
|
|
|
|
contrib = fetchurl {
|
2019-02-16 14:40:15 +01:00
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz";
|
2020-10-11 03:26:59 +02:00
|
|
|
sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d";
|
2016-10-24 02:28:02 +02:00
|
|
|
};
|
2016-10-24 13:44:21 +02:00
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
postInstallContrib = lib.optionalString withContrib
|
2016-10-24 13:44:21 +02:00
|
|
|
''
|
|
|
|
local contribDir=$out/lib/ats2-postiats-*/ ;
|
|
|
|
mkdir -p $contribDir ;
|
|
|
|
tar -xzf "${contrib}" --strip-components 1 -C $contribDir ;
|
|
|
|
'';
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
postInstallEmacs = lib.optionalString withEmacsSupport
|
2016-10-24 13:44:21 +02:00
|
|
|
''
|
|
|
|
local siteLispDir=$out/share/emacs/site-lisp/ats2 ;
|
|
|
|
mkdir -p $siteLispDir ;
|
|
|
|
install -m 0644 -v ./utils/emacs/*.el $siteLispDir ;
|
|
|
|
'';
|
2016-10-24 02:28:02 +02:00
|
|
|
in
|
2013-10-25 19:33:32 +02:00
|
|
|
|
2014-04-27 18:24:09 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ats2";
|
2016-10-24 02:28:02 +02:00
|
|
|
version = versionPkg;
|
2013-10-25 19:33:32 +02:00
|
|
|
|
2016-10-24 13:44:21 +02:00
|
|
|
src = fetchurl {
|
2019-02-16 14:40:15 +01:00
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-gmp-${version}.tgz";
|
2020-10-11 03:26:59 +02:00
|
|
|
sha256 = "0c4nqp6yzmpj0mcpg7ibmwyqi8hjw3sza8myvy4nzq3fa6wldy5l";
|
2013-10-25 19:33:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gmp ];
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
setupHook = with lib;
|
2016-10-24 13:44:21 +02:00
|
|
|
let
|
|
|
|
hookFiles =
|
|
|
|
[ ./setup-hook.sh ]
|
|
|
|
++ optional withContrib ./setup-contrib-hook.sh;
|
2016-10-24 02:28:02 +02:00
|
|
|
in
|
2016-10-24 13:44:21 +02:00
|
|
|
builtins.toFile "setupHook.sh"
|
|
|
|
(concatMapStringsSep "\n" builtins.readFile hookFiles);
|
2016-10-24 02:28:02 +02:00
|
|
|
|
|
|
|
postInstall = postInstallContrib + postInstallEmacs;
|
2015-05-01 00:54:40 +02:00
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
meta = with lib; {
|
2014-04-27 18:24:09 +02:00
|
|
|
description = "Functional programming language with dependent types";
|
|
|
|
homepage = "http://www.ats-lang.org";
|
2016-05-11 17:02:09 +02:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2018-06-07 13:44:06 +02:00
|
|
|
maintainers = with maintainers; [ thoughtpolice ttuegel bbarker ];
|
2013-10-25 19:33:32 +02:00
|
|
|
};
|
|
|
|
}
|