2016-10-24 02:28:02 +02:00
|
|
|
{ stdenv, fetchurl, gmp
|
|
|
|
, withEmacsSupport ? true
|
|
|
|
, withContrib ? true }:
|
|
|
|
|
|
|
|
let
|
2017-01-21 18:31:44 +01:00
|
|
|
versionPkg = "0.3.0" ;
|
2016-10-24 02:28:02 +02:00
|
|
|
|
|
|
|
contrib = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz" ;
|
2017-01-21 18:31:44 +01:00
|
|
|
sha256 = "1s4yscisn9gsr692jmh4y5mz03012pv84cm7l5n51v83wc08fks0" ;
|
2016-10-24 02:28:02 +02:00
|
|
|
};
|
2016-10-24 13:44:21 +02: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 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 {
|
|
|
|
name = "ats2-${version}";
|
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 {
|
2013-10-25 19:33:32 +02:00
|
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-${version}.tgz";
|
2017-01-21 18:31:44 +01:00
|
|
|
sha256 = "1knf03r8a5sis7n8rw54flf1lxfbr3prywxb1czcdp6hsbcd1v1d";
|
2013-10-25 19:33:32 +02:00
|
|
|
};
|
|
|
|
|
2017-01-21 18:31:44 +01:00
|
|
|
patches = [ ./install-postiats-contrib.patch ];
|
|
|
|
|
2013-10-25 19:33:32 +02:00
|
|
|
buildInputs = [ gmp ];
|
|
|
|
|
2016-10-24 13:44:21 +02:00
|
|
|
setupHook = with stdenv.lib;
|
|
|
|
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
|
|
|
|
2016-05-11 17:02:09 +02:00
|
|
|
meta = with stdenv.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;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ttuegel ];
|
2013-10-25 19:33:32 +02:00
|
|
|
};
|
|
|
|
}
|