nixpkgs/pkgs/development/interpreters/trealla/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, readline, openssl, libffi, valgrind, withThread ? true, withSSL ? true, xxd }:
2021-03-08 05:06:59 +00:00
stdenv.mkDerivation rec {
pname = "trealla";
2023-03-02 08:58:37 +00:00
version = "2.8.6";
2021-03-08 05:06:59 +00:00
src = fetchFromGitHub {
2022-09-25 06:46:46 +00:00
owner = "trealla-prolog";
2021-03-08 05:06:59 +00:00
repo = "trealla";
rev = "v${version}";
2023-03-02 08:58:37 +00:00
sha256 = "sha256-0sAPexGKriaJVhBDRsopRYD8xrJAaXZiscCcwfWdEgQ=";
2021-03-08 05:06:59 +00:00
};
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 ];
2022-09-25 06:46:46 +00:00
buildInputs = [ readline openssl libffi ];
checkInputs = lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [ valgrind ];
2022-09-25 06:46:46 +00:00
enableParallelBuilding = true;
2021-03-08 05:06:59 +00:00
installPhase = ''
install -Dm755 -t $out/bin tpl
'';
doCheck = true;
preCheck = ''
2022-09-25 06:46:46 +00:00
# Disable tests due to floating point error
rm tests/issues-OLD/test081.pl
rm tests/issues-OLD/test585.pl
# Disable test due to Unicode issues
rm tests/issues-OLD/test252.pl
2021-03-08 05:06:59 +00:00
'';
meta = with lib; {
description = "A compact, efficient Prolog interpreter written in ANSI C";
2022-09-25 06:46:46 +00:00
homepage = "https://github.com/trealla-prolog/trealla";
2021-03-08 05:06:59 +00:00
license = licenses.mit;
maintainers = with maintainers; [ siraben ];
mainProgram = "tpl";
2021-03-08 05:06:59 +00:00
platforms = platforms.all;
};
}