summary refs log tree commit diff
path: root/pkgs/applications/science/logic/twelf/default.nix
blob: c6c7e4d9c1a719230740636234fca4f2e9bd9223 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ stdenv, fetchurl, pkgconfig, smlnj, rsync }:

stdenv.mkDerivation rec {
  name = "twelf-${version}";
  version = "1.7.1";

  src = fetchurl {
    url = "http://twelf.plparty.org/releases/twelf-src-${version}.tar.gz";
    sha256 = "0fi1kbs9hrdrm1x4k13angpjasxlyd1gc3ys8ah54i75qbcd9c4i";
  };

  buildInputs = [ pkgconfig smlnj rsync ];

  buildPhase = ''
    export SMLNJ_HOME=${smlnj}
    make smlnj
  '';

  installPhase = ''
    mkdir -p $out/bin
    rsync -av bin/* $out/bin/

    mkdir -p $out/share/emacs/site-lisp/twelf/
    rsync -av emacs/ $out/share/emacs/site-lisp/twelf/

    mkdir -p $out/share/twelf/examples
    rsync -av examples/ $out/share/twelf/examples/
    mkdir -p $out/share/twelf/vim
    rsync -av vim/ $out/share/twelf/vim/
  '';

  meta = {
    description = "Twelf logic proof assistant";
    longDescription = ''
      Twelf is a language used to specify, implement, and prove properties of
      deductive systems such as programming languages and logics. Large
      research projects using Twelf include the TALT typed assembly language,
      a foundational proof-carrying-code system, and a type safety proof for
      Standard ML.
    '';
    homepage = http://twelf.org/wiki/Main_Page;
    license = "MIT";
    maintainers = with stdenv.lib.maintainers; [ jwiegley ];
    platforms = stdenv.lib.platforms.unix;
  };
}