nixpkgs/pkgs/development/compilers/ats2/default.nix

58 lines
1.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, gmp
, withEmacsSupport ? true
, withContrib ? true }:
let
versionPkg = "0.3.9" ;
contrib = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz" ;
sha256 = "627bb99ecf2e3d5976f95f2faa13c7c330726601e8bb05a2113c9b69c98749b5";
};
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 ;
'';
in
stdenv.mkDerivation rec {
name = "ats2-${version}";
version = versionPkg;
2016-10-24 11:44:21 +00:00
src = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-${version}.tgz";
sha256 = "c69a7c58964df26227e77656659129ca4c05205d2ebcacc7084edba818fb6e81";
};
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;
in
2016-10-24 11:44:21 +00:00
builtins.toFile "setupHook.sh"
(concatMapStringsSep "\n" builtins.readFile hookFiles);
postInstall = postInstallContrib + postInstallEmacs;
2015-04-30 22:54:40 +00:00
2016-05-11 15:02:09 +00:00
meta = with stdenv.lib; {
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 ];
};
}