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