nixpkgs/pkgs/development/compilers/ats2/default.nix
Thales Macedo Garitezi 8a3ae55970 ats2: 0.3.13 -> 0.4.1
2020-10-10 22:26:59 -03:00

58 lines
1.6 KiB
Nix

{ stdenv, fetchurl, gmp
, withEmacsSupport ? true
, withContrib ? true }:
let
versionPkg = "0.4.1" ;
contrib = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz";
sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d";
};
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 {
pname = "ats2";
version = versionPkg;
src = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-gmp-${version}.tgz";
sha256 = "0c4nqp6yzmpj0mcpg7ibmwyqi8hjw3sza8myvy4nzq3fa6wldy5l";
};
buildInputs = [ gmp ];
setupHook = with stdenv.lib;
let
hookFiles =
[ ./setup-hook.sh ]
++ optional withContrib ./setup-contrib-hook.sh;
in
builtins.toFile "setupHook.sh"
(concatMapStringsSep "\n" builtins.readFile hookFiles);
postInstall = postInstallContrib + postInstallEmacs;
meta = with stdenv.lib; {
description = "Functional programming language with dependent types";
homepage = "http://www.ats-lang.org";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ thoughtpolice ttuegel bbarker ];
};
}