1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-02 10:31:36 +00:00
nixpkgs/pkgs/development/compilers/ats2/default.nix
Yurii Rashkovskii a83067ea9e ats2: 0.3.0 -> 0.3.7
The patch is no longer needed as ats2 includes contribs in the
upstream Makefile_dist file
2017-11-30 13:09:50 +07:00

58 lines
1.6 KiB
Nix

{ stdenv, fetchurl, gmp
, withEmacsSupport ? true
, withContrib ? true }:
let
versionPkg = "0.3.7" ;
contrib = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz" ;
sha256 = "1w59ir9ij5bvvnxj6fb1rvzycfqa57i31wmpwawxbsb10bqwzyr6";
};
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 = "19nxyi39fn42sp38kl14a6pvbxq9wr8y405wx0zz7mqb77r0m0h5";
};
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 ];
};
}