2016-10-24 00:28:02 +00:00
|
|
|
{ stdenv, fetchurl, gmp
|
|
|
|
, withEmacsSupport ? true
|
|
|
|
, withContrib ? true }:
|
|
|
|
|
|
|
|
let
|
2018-03-08 19:15:54 +00:00
|
|
|
versionPkg = "0.3.9" ;
|
2016-10-24 00:28:02 +00:00
|
|
|
|
|
|
|
contrib = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz" ;
|
2018-03-08 19:15:54 +00:00
|
|
|
sha256 = "627bb99ecf2e3d5976f95f2faa13c7c330726601e8bb05a2113c9b69c98749b5";
|
2016-10-24 00:28:02 +00:00
|
|
|
};
|
2016-10-24 11:44:21 +00: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 00:28:02 +00:00
|
|
|
in
|
2013-10-25 17:33:32 +00:00
|
|
|
|
2014-04-27 16:24:09 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ats2-${version}";
|
2016-10-24 00:28:02 +00:00
|
|
|
version = versionPkg;
|
2013-10-25 17:33:32 +00:00
|
|
|
|
2016-10-24 11:44:21 +00:00
|
|
|
src = fetchurl {
|
2013-10-25 17:33:32 +00:00
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-${version}.tgz";
|
2018-03-08 19:15:54 +00:00
|
|
|
sha256 = "c69a7c58964df26227e77656659129ca4c05205d2ebcacc7084edba818fb6e81";
|
2013-10-25 17:33:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gmp ];
|
|
|
|
|
2016-10-24 11:44:21 +00:00
|
|
|
setupHook = with stdenv.lib;
|
|
|
|
let
|
|
|
|
hookFiles =
|
|
|
|
[ ./setup-hook.sh ]
|
|
|
|
++ optional withContrib ./setup-contrib-hook.sh;
|
2016-10-24 00:28:02 +00:00
|
|
|
in
|
2016-10-24 11:44:21 +00:00
|
|
|
builtins.toFile "setupHook.sh"
|
|
|
|
(concatMapStringsSep "\n" builtins.readFile hookFiles);
|
2016-10-24 00:28:02 +00:00
|
|
|
|
|
|
|
postInstall = postInstallContrib + postInstallEmacs;
|
2015-04-30 22:54:40 +00:00
|
|
|
|
2016-05-11 15:02:09 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-04-27 16:24:09 +00:00
|
|
|
description = "Functional programming language with dependent types";
|
|
|
|
homepage = "http://www.ats-lang.org";
|
2016-05-11 15:02:09 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ttuegel ];
|
2013-10-25 17:33:32 +00:00
|
|
|
};
|
|
|
|
}
|