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

58 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, gmp
, withEmacsSupport ? true
, withContrib ? true }:
let
2020-10-11 02:26:59 +01:00
versionPkg = "0.4.1" ;
contrib = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz";
2020-10-11 02:26:59 +01:00
sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d";
};
2016-10-24 12:44:21 +01:00
postInstallContrib = lib.optionalString withContrib
2016-10-24 12:44:21 +01:00
''
local contribDir=$out/lib/ats2-postiats-*/ ;
mkdir -p $contribDir ;
tar -xzf "${contrib}" --strip-components 1 -C $contribDir ;
'';
postInstallEmacs = lib.optionalString withEmacsSupport
2016-10-24 12:44:21 +01:00
''
local siteLispDir=$out/share/emacs/site-lisp/ats2 ;
mkdir -p $siteLispDir ;
install -m 0644 -v ./utils/emacs/*.el $siteLispDir ;
'';
in
stdenv.mkDerivation rec {
pname = "ats2";
version = versionPkg;
2016-10-24 12:44:21 +01:00
src = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-gmp-${version}.tgz";
2020-10-11 02:26:59 +01:00
sha256 = "0c4nqp6yzmpj0mcpg7ibmwyqi8hjw3sza8myvy4nzq3fa6wldy5l";
};
buildInputs = [ gmp ];
setupHook = with lib;
2016-10-24 12:44:21 +01:00
let
hookFiles =
[ ./setup-hook.sh ]
++ optional withContrib ./setup-contrib-hook.sh;
in
2016-10-24 12:44:21 +01:00
builtins.toFile "setupHook.sh"
(concatMapStringsSep "\n" builtins.readFile hookFiles);
postInstall = postInstallContrib + postInstallEmacs;
2015-04-30 23:54:40 +01:00
meta = with lib; {
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 ];
};
}