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