diff options
author | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-07-10 13:38:46 -0300 |
---|---|---|
committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-07-12 21:42:26 -0300 |
commit | c1a92af32523ff936a96f678a57bf060bee1dc36 (patch) | |
tree | ec2e22d954bd23d47335181c2e732e7fb4bc381b /pkgs/development/interpreters/trealla/default.nix | |
parent | 0ebafdb84272f847fc9eaddd7a762235a4568e5f (diff) |
trealla: 2.8.6 -> 2.21.33
Diffstat (limited to 'pkgs/development/interpreters/trealla/default.nix')
-rw-r--r-- | pkgs/development/interpreters/trealla/default.nix | 88 |
1 files changed, 62 insertions, 26 deletions
diff --git a/pkgs/development/interpreters/trealla/default.nix b/pkgs/development/interpreters/trealla/default.nix index 84637bed1d09..8d738691d38f 100644 --- a/pkgs/development/interpreters/trealla/default.nix +++ b/pkgs/development/interpreters/trealla/default.nix @@ -1,14 +1,28 @@ -{ lib, stdenv, fetchFromGitHub, readline, openssl, libffi, valgrind, withThread ? true, withSSL ? true, xxd }: +{ lib +, stdenv +, fetchFromGitHub +, libffi +, openssl +, readline +, valgrind +, xxd +, checkLeaks ? false +, enableFFI ? true +, enableSSL ? true +, enableThreads ? true +, lineEditingLibrary ? "readline" +}: -stdenv.mkDerivation rec { +assert lib.elem lineEditingLibrary [ "isocline" "readline" ]; +stdenv.mkDerivation (finalAttrs: { pname = "trealla"; - version = "2.8.6"; + version = "2.21.33"; src = fetchFromGitHub { owner = "trealla-prolog"; repo = "trealla"; - rev = "v${version}"; - sha256 = "sha256-0sAPexGKriaJVhBDRsopRYD8xrJAaXZiscCcwfWdEgQ="; + rev = "v${finalAttrs.version}"; + hash = "sha256-IpJey3S5iOCGfdfyHzc+lU9JR5fK04fnA0Ulq5Mmqks="; }; postPatch = '' @@ -18,37 +32,59 @@ stdenv.mkDerivation rec { --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 ]; - nativeBuildInputs = [ xxd ]; - buildInputs = [ readline openssl libffi ]; - checkInputs = lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [ valgrind ]; + buildInputs = + lib.optional enableFFI libffi + ++ lib.optional enableSSL openssl + ++ lib.optional (lineEditingLibrary == "readline") readline; + + checkInputs = lib.optionals finalAttrs.doCheck [ valgrind ]; + + dontConfigure = true; + + makeFlags = [ + "GIT_VERSION=\"v${finalAttrs.version}\"" + ] + ++ lib.optional (lineEditingLibrary == "isocline") "ISOCLINE=1" + ++ lib.optional (!enableFFI) "NOFFI=1" + ++ lib.optional (!enableSSL) "NOSSL=1" + ++ lib.optional enableThreads "THREADS=1"; + enableParallelBuilding = true; installPhase = '' + runHook preInstall install -Dm755 -t $out/bin tpl + runHook postInstall ''; doCheck = true; - preCheck = '' - # 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 - ''; - meta = with lib; { + checkFlags = [ + "test" + ] ++ lib.optional checkLeaks "leaks"; + + meta = { + homepage = "https://trealla-prolog.github.io/trealla/"; description = "A compact, efficient Prolog interpreter written in ANSI C"; - homepage = "https://github.com/trealla-prolog/trealla"; - license = licenses.mit; - maintainers = with maintainers; [ siraben ]; + longDescription = '' + Trealla is a compact, efficient Prolog interpreter with ISO Prolog + aspirations. + Trealla is not WAM-based. It uses tree-walking, structure-sharing and + deep-binding. Source is byte-code compiled to an AST that is interpreted + at runtime. The intent and continued aim of Trealla is to be a small, + easily ported, Prolog core. + The name Trealla comes from the Liaden Universe books by Lee & Miller + (where it doesn't seem to mean anything) and also a reference to the + Trealla region of Western Australia. + ''; + changelog = "https://github.com/trealla-prolog/trealla/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ siraben AndersonTorres ]; mainProgram = "tpl"; - platforms = platforms.all; + platforms = lib.platforms.all; }; -} +}) |