trealla: init at 1.7.65

This commit is contained in:
Ben Siraphob 2021-03-08 12:06:59 +07:00
parent fa488cd9bf
commit ca4e35218e
2 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{ lib, stdenv, fetchFromGitHub, readline, openssl, withThread ? true, withSSL ? true, xxd }:
stdenv.mkDerivation rec {
pname = "trealla";
version = "1.7.65";
src = fetchFromGitHub {
owner = "infradig";
repo = "trealla";
rev = "v${version}";
sha256 = "sha256-uCDACBwdiCeAwF6IZHz7s5pD83JXTP7jAQDjGld8tt0=";
};
postPatch = ''
substituteInPlace Makefile \
--replace '-I/usr/local/include' "" \
--replace '-L/usr/local/lib' "" \
--replace 'GIT_VERSION :=' 'GIT_VERSION ?='
'';
makeFlags = [
"GIT_VERSION=\"v${version}\""
(lib.optionalString withThread "THREADS=1")
(lib.optionalString (!withSSL) "NOSSL=1")
(lib.optionalString stdenv.isDarwin "NOLDLIBS=1")
];
nativeBuildInputs = [ xxd ];
buildInputs = [ readline openssl ];
installPhase = ''
install -Dm755 -t $out/bin tpl
'';
doCheck = true;
preCheck = ''
# Disable test 81 due to floating point error
rm tests/issues/test081.expected tests/issues/test081.pl
'';
meta = with lib; {
description = "A compact, efficient Prolog interpreter written in ANSI C";
homepage = "https://github.com/infradig/trealla";
license = licenses.mit;
maintainers = with maintainers; [ siraben ];
platforms = platforms.all;
};
}

View file

@ -11791,6 +11791,8 @@ in
tclreadline = callPackage ../development/interpreters/tclreadline { };
trealla = callPackage ../development/interpreters/trealla { };
wasm = ocamlPackages.wasm;
proglodyte-wasm = callPackage ../development/interpreters/proglodyte-wasm { };