Merge pull request #235517 from marsam/add-lean4

lean4: init at 4.0.0
This commit is contained in:
Mario Rodas 2023-09-11 06:34:44 -05:00 committed by GitHub
commit 513d06cf6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,60 @@
{ lib
, stdenv
, cmake
, fetchFromGitHub
, git
, gmp
, perl
}:
stdenv.mkDerivation rec {
pname = "lean4";
version = "4.0.0";
src = fetchFromGitHub {
owner = "leanprover";
repo = "lean4";
rev = "v${version}";
hash = "sha256-3Ni+NiD0iSsOruUyRpBd+aC0TZNYfOLhwqCpPHPruPg=";
};
postPatch = ''
substituteInPlace src/CMakeLists.txt \
--replace 'set(GIT_SHA1 "")' 'set(GIT_SHA1 "${src.rev}")'
# Remove tests that fails in sandbox.
# It expects `sourceRoot` to be a git repository.
rm -rf src/lake/examples/git/
'';
preConfigure = ''
patchShebangs stage0/src/bin/ src/bin/
'';
nativeBuildInputs = [
cmake
];
buildInputs = [
gmp
];
nativeCheckInputs = [
git
perl
];
cmakeFlags = [
"-DUSE_GITHASH=OFF"
];
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";
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ marsam ];
mainProgram = "lean";
};
}

View File

@ -39772,6 +39772,7 @@ with pkgs;
lean = callPackage ../applications/science/logic/lean { };
lean2 = callPackage ../applications/science/logic/lean2 { };
lean4 = callPackage ../applications/science/logic/lean4 { };
lean3 = lean;
elan = callPackage ../applications/science/logic/elan { };
mathlibtools = with python3Packages; toPythonApplication mathlibtools;