summary refs log tree commit diff
path: root/pkgs/development/coq-modules/HoTT/default.nix
blob: 7b52838505e2cb95233ca888600ac519c688d491 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ stdenv, fetchFromGitHub, autoconf, automake, coq }:

stdenv.mkDerivation rec {
  name = "coq${coq.coq-version}-HoTT-${version}";
  version = "20170921";

  src = fetchFromGitHub {
    owner = "HoTT";
    repo = "HoTT";
    rev = "e3557740a699167e6adb1a65855509d55a392fa1";
    sha256 = "0zwfp8g62b50vmmbb2kmskj3v6w7qx1pbf43yw0hr7asdz2zbx5v";
  };

  buildInputs = [ autoconf automake coq ];
  enableParallelBuilding = true;

  preConfigure = ''
    patchShebangs ./autogen.sh
    ./autogen.sh

    mkdir -p "$out/bin"
  '';

  configureFlags = [
    "--bindir=$(out)/bin"
  ];

  patchPhase = ''
    patchShebangs etc
    patchShebangs hoqc hoqchk hoqdep hoqide hoqtop
  '';

  postBuild = ''
    patchShebangs hoq-config
  '';

  # Currently, all the scripts like hoqc and hoqtop assume that the *.vo files are
  # either (1) in the same directory as the scripts, or (2) in /usr/share/hott.
  # We fulfill (1), which means that these files are only accessible via hoqtop,
  # hoqc, etc and not via coqtop, coqc, etc.
  postInstall = ''
    mv $out/share/hott/* "$out/bin"
    rmdir $out/share/hott
    rmdir $out/share
  '';

  installFlags = [
    "COQBIN=${coq}/bin"
  ];

  meta = with stdenv.lib; {
    homepage = "http://homotopytypetheory.org/";
    description = "Homotopy type theory";
    maintainers = with maintainers; [ siddharthist ];
    platforms = coq.meta.platforms;
  };

  passthru = {
    compatibleCoqVersions = v: v == "8.6";
  };
}