2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, gmp, coreutils }:
|
2016-12-08 15:29:33 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "lean";
|
2022-01-12 19:25:20 +00:00
|
|
|
version = "3.38.0";
|
2016-12-08 15:29:33 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-02-15 07:13:17 +00:00
|
|
|
owner = "leanprover-community";
|
2016-12-08 15:29:33 +00:00
|
|
|
repo = "lean";
|
2021-05-26 15:53:55 +01:00
|
|
|
# lean's version string contains the commit sha1 it was built
|
|
|
|
# from. this is then used to check whether an olean file should be
|
|
|
|
# rebuilt. don't use a tag as rev because this will get replaced into
|
|
|
|
# src/githash.h.in in preConfigure.
|
2022-01-12 19:25:20 +00:00
|
|
|
rev = "a8cf8a0c9ea19a633baeb3aa7e8d706b86c2c0f9";
|
|
|
|
sha256 = "14dam91pnn266fgii5c2j5p9p2i31bghx0s2h3qnnqyvxi4s5isx";
|
2016-12-08 15:29:33 +00:00
|
|
|
};
|
|
|
|
|
2017-10-18 14:37:50 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ gmp ];
|
2016-12-08 15:29:33 +00:00
|
|
|
|
2020-11-04 15:32:56 +00:00
|
|
|
cmakeDir = "../src";
|
|
|
|
|
|
|
|
# Running the tests is required to build the *.olean files for the core
|
|
|
|
# library.
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-05-26 15:53:55 +01:00
|
|
|
preConfigure = assert builtins.stringLength src.rev == 40; ''
|
|
|
|
substituteInPlace src/githash.h.in \
|
|
|
|
--subst-var-by GIT_SHA1 "${src.rev}"
|
|
|
|
substituteInPlace library/init/version.lean.in \
|
|
|
|
--subst-var-by GIT_SHA1 "${src.rev}"
|
|
|
|
'';
|
|
|
|
|
2020-11-04 15:32:56 +00:00
|
|
|
postPatch = "patchShebangs .";
|
2016-12-08 15:29:33 +00:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2020-05-16 10:20:00 +01:00
|
|
|
substituteInPlace $out/bin/leanpkg \
|
|
|
|
--replace "greadlink" "${coreutils}/bin/readlink"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-12-08 15:29:33 +00:00
|
|
|
description = "Automatic and interactive theorem prover";
|
2020-03-04 06:26:01 +00:00
|
|
|
homepage = "https://leanprover.github.io/";
|
2020-03-13 09:20:00 +00:00
|
|
|
changelog = "https://github.com/leanprover-community/lean/blob/v${version}/doc/changes.md";
|
2016-12-08 15:29:33 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice gebner ];
|
|
|
|
};
|
|
|
|
}
|
2020-02-15 07:13:17 +00:00
|
|
|
|