mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 08:33:54 +00:00
58 lines
1.6 KiB
Nix
58 lines
1.6 KiB
Nix
{ stdenv, fetchurl, gmp
|
|
, withEmacsSupport ? true
|
|
, withContrib ? true }:
|
|
|
|
let
|
|
versionPkg = "0.3.11" ;
|
|
|
|
contrib = fetchurl {
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz" ;
|
|
sha256 = "300884eca8a54cb9b0daa19bd04a86252160cc8ad6ef494198babd56d5a579bc";
|
|
};
|
|
|
|
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;
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-${version}.tgz";
|
|
sha256 = "feba71f37e9688b8ff0a72c4eb21914ce59f19421350d9dc3f15ad6f8c28428a";
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|