summary refs log tree commit diff
path: root/pkgs/applications/misc/ape/default.nix
blob: e78ba2df9993d0a6914e917ad6bbacc8adfb4cf6 (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
{ stdenv, swiProlog, makeWrapper,
  fetchFromGitHub,
  lexicon ? "lexicon/clex_lexicon.pl",
  pname ? "ape",
  description ? "Parser for Attempto Controlled English (ACE)",
  license ? with stdenv.lib; licenses.lgpl3
  }:

stdenv.mkDerivation rec {
  name = "${pname}-${version}";
  version = "6.7-131003";

  buildInputs = [ swiProlog makeWrapper ];

  src = fetchFromGitHub {
     owner = "Attempto";
     repo = "APE";
     rev = version;
     sha256 = "0cw47qjg4896kw3vps6rfs02asvscsqvcfdiwgfmqb3hvykb1sdx";
  };

  patchPhase = ''
    # We move the file first to avoid "same file" error in the default case
    cp ${lexicon} new_lexicon.pl
    rm lexicon/clex_lexicon.pl
    cp new_lexicon.pl lexicon/clex_lexicon.pl
  '';

  buildPhase = ''
    make build
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp ape.exe $out
    makeWrapper $out/ape.exe $out/bin/ape --add-flags ace
  '';

  meta = with stdenv.lib; {
    description = description;
    license = license;
    platforms = platforms.unix;
    maintainers = with maintainers; [ yrashk ];
  };
}