6 withEmacsSupport ? true,
14 url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz";
15 hash = "sha256-m0hfBLsaNiLaIktcioK+ZtWUsWht3IDSJ6CzgJmS06c=";
18 postInstallContrib = lib.optionalString withContrib ''
19 local contribDir=$out/lib/ats2-postiats-*/ ;
20 mkdir -p $contribDir ;
21 tar -xzf "${contrib}" --strip-components 1 -C $contribDir ;
24 postInstallEmacs = lib.optionalString withEmacsSupport ''
25 local siteLispDir=$out/share/emacs/site-lisp/ats2 ;
26 mkdir -p $siteLispDir ;
27 install -m 0644 -v ./utils/emacs/*.el $siteLispDir ;
31 stdenv.mkDerivation rec {
36 url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-gmp-${version}.tgz";
37 hash = "sha256-UWgDjFojPBYgykrCrJyYvVWY+Gc5d4aRGjTWjc528AM=";
40 postPatch = lib.optionalString stdenv.cc.isClang ''
41 sed -i 's/gcc/clang/g' utils/*/DATS/atscc_util.dats
44 buildInputs = [ gmp ];
46 # Disable parallel build, errors:
47 # *** No rule to make target 'patscc.dats', needed by 'patscc_dats.c'. Stop.
48 enableParallelBuilding = false;
51 "CC=${stdenv.cc.targetPrefix}cc"
52 "CCOMP=${stdenv.cc.targetPrefix}cc"
55 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration";
59 hookFiles = [ ./setup-hook.sh ] ++ lib.optional withContrib ./setup-contrib-hook.sh;
61 builtins.toFile "setupHook.sh" (lib.concatMapStringsSep "\n" builtins.readFile hookFiles);
63 postInstall = postInstallContrib + postInstallEmacs;
66 description = "Functional programming language with dependent types";
67 homepage = "http://www.ats-lang.org";
68 license = licenses.gpl3Plus;
69 platforms = platforms.unix;
70 maintainers = with maintainers; [