From 6a068abcfca4d1328133417e3cface00ecc93b5b Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 1 Feb 2024 04:20:00 +0000 Subject: [PATCH 1/2] lean4: 4.4.0 -> 4.5.0 Diff: https://github.com/leanprover/lean4/compare/v4.4.0...v4.5.0 Changelog: https://github.com/leanprover/lean4/blob/v4.5.0/RELEASES.md --- pkgs/applications/science/logic/lean4/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/logic/lean4/default.nix b/pkgs/applications/science/logic/lean4/default.nix index 092489f84456..fe7088075cf7 100644 --- a/pkgs/applications/science/logic/lean4/default.nix +++ b/pkgs/applications/science/logic/lean4/default.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "lean4"; - version = "4.4.0"; + version = "4.5.0"; src = fetchFromGitHub { owner = "leanprover"; repo = "lean4"; rev = "v${version}"; - hash = "sha256-lU67wjl6yJP2r97lHYxrJqn+JhqMcBIbz/+qlCgY3/o="; + hash = "sha256-KTCTk4Fpbmm7FsUo03tAvenC6HuB3zJGax6iGTwLaXM="; }; postPatch = '' From 2c6116bd1cdb8b9fef448b0516cd6d71ccc51044 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 1 Feb 2024 04:20:00 +0000 Subject: [PATCH 2/2] lean4: add version tester --- .../science/logic/lean4/default.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/science/logic/lean4/default.nix b/pkgs/applications/science/logic/lean4/default.nix index fe7088075cf7..97336c06b806 100644 --- a/pkgs/applications/science/logic/lean4/default.nix +++ b/pkgs/applications/science/logic/lean4/default.nix @@ -5,22 +5,23 @@ , git , gmp , perl +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "lean4"; version = "4.5.0"; src = fetchFromGitHub { owner = "leanprover"; repo = "lean4"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-KTCTk4Fpbmm7FsUo03tAvenC6HuB3zJGax6iGTwLaXM="; }; postPatch = '' substituteInPlace src/CMakeLists.txt \ - --replace 'set(GIT_SHA1 "")' 'set(GIT_SHA1 "${src.rev}")' + --replace 'set(GIT_SHA1 "")' 'set(GIT_SHA1 "${finalAttrs.src.rev}")' # Remove tests that fails in sandbox. # It expects `sourceRoot` to be a git repository. @@ -54,13 +55,19 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; }; + passthru.tests = { + version = testers.testVersion { + package = finalAttrs.finalPackage; + }; + }; + meta = with lib; { description = "Automatic and interactive theorem prover"; homepage = "https://leanprover.github.io/"; - changelog = "https://github.com/leanprover/lean4/blob/${src.rev}/RELEASES.md"; + changelog = "https://github.com/leanprover/lean4/blob/${finalAttrs.src.rev}/RELEASES.md"; license = licenses.asl20; platforms = platforms.all; maintainers = with maintainers; [ marsam ]; mainProgram = "lean"; }; -} +})