2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, swiProlog, makeWrapper,
|
2018-03-14 06:10:59 +00:00
|
|
|
fetchFromGitHub,
|
2020-10-04 16:00:16 +00:00
|
|
|
lexiconPath ? "prolog/lexicon/clex_lexicon.pl",
|
2018-03-14 06:10:59 +00:00
|
|
|
pname ? "ape",
|
|
|
|
description ? "Parser for Attempto Controlled English (ACE)",
|
2021-01-11 07:54:33 +00:00
|
|
|
license ? with lib; licenses.lgpl3
|
2020-10-04 16:00:16 +00:00
|
|
|
}:
|
2018-03-14 06:10:59 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-09-14 12:17:08 +00:00
|
|
|
inherit pname;
|
|
|
|
version = "2019-08-10";
|
2018-03-14 06:10:59 +00:00
|
|
|
|
|
|
|
buildInputs = [ swiProlog makeWrapper ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Attempto";
|
|
|
|
repo = "APE";
|
2019-09-14 12:17:08 +00:00
|
|
|
rev = "113b81621262d7a395779465cb09397183e6f74c";
|
|
|
|
sha256 = "0xyvna2fbr18hi5yvm0zwh77q02dfna1g4g53z9mn2rmlfn2mhjh";
|
2018-03-14 06:10:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
# We move the file first to avoid "same file" error in the default case
|
2020-10-04 16:00:16 +00:00
|
|
|
cp ${lexiconPath} new_lexicon.pl
|
2019-09-14 12:17:08 +00:00
|
|
|
rm prolog/lexicon/clex_lexicon.pl
|
|
|
|
cp new_lexicon.pl prolog/lexicon/clex_lexicon.pl
|
2018-03-14 06:10:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2019-09-14 12:17:08 +00:00
|
|
|
make SHELL=${stdenv.shell} build
|
2018-03-14 06:10:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ape.exe $out
|
|
|
|
makeWrapper $out/ape.exe $out/bin/ape --add-flags ace
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-03-14 06:10:59 +00:00
|
|
|
description = description;
|
|
|
|
license = license;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ yrashk ];
|
|
|
|
};
|
|
|
|
}
|