about summary refs log tree commit diff
path: root/pkgs/applications/science/logic/cedille/default.nix
blob: e27173651913ee6b386a91a56f81ce10743c480f (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
62
63
64
65
66
67
68
69
70
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, texinfo
, alex
, happy
, Agda
, buildPlatform
, buildPackages
, ghcWithPackages
}:

stdenv.mkDerivation rec {
  version = "1.1.1";
  pname = "cedille";

  src = fetchFromGitHub {
    owner = "cedille";
    repo = "cedille";
    rev = "v${version}";
    sha256 = "17j7an5bharc8q1pj06615zmflipjdd0clf67cnfdhsmqwzf6l9r";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [ texinfo alex happy ];
  buildInputs = [ Agda (ghcWithPackages (ps: [ps.ieee])) ];

  LANG = "en_US.UTF-8";
  LOCALE_ARCHIVE =
    lib.optionalString (buildPlatform.libc == "glibc")
      "${buildPackages.glibcLocales}/lib/locale/locale-archive";

  patches = [
    # texinfo direntry fix. See: https://github.com/cedille/cedille/pull/86
    (fetchpatch {
      url = "https://github.com/cedille/cedille/commit/c058f42179a635c7b6179772c30f0eba4ac53724.patch";
      sha256 = "02qd86k5bdrygjzh2k0j0q5qk4nk2vwnsz7nvlssvysbvsmiba7x";
    })
  ];

  postPatch = ''
    patchShebangs create-libraries.sh
    patchShebangs docs/src/compile-docs.sh
  '';

  # We regenerate the info file in order to fix the direntry
  preBuild = ''
    rm -f docs/info/cedille-info-main.info
  '';

  buildFlags = [ "all" "cedille-docs" ];

  installPhase = ''
    install -Dm755 -t $out/bin/ cedille
    install -Dm755 -t $out/bin/ core/cedille-core
    install -Dm644 -t $out/share/info docs/info/cedille-info-main.info

    mkdir -p $out/lib/
    cp -r lib/ $out/lib/cedille/
  '';

  meta = with stdenv.lib; {
    description = "An interactive theorem-prover and dependently typed programming language, based on extrinsic (aka Curry-style) type theory";
    homepage = https://cedille.github.io/;
    license = licenses.mit;
    maintainers = with maintainers; [ marsam mpickering ];
    platforms = platforms.unix;
  };
}