From 8fdfe10bcffab56ab95d7e092acd9d8b9157e65c Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Fri, 18 Mar 2022 18:30:32 -0300 Subject: [PATCH] lean2: 2017-07-22 -> 2018-10-01, unbreak --- .../science/logic/lean2/default.nix | 46 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/applications/science/logic/lean2/default.nix diff --git a/pkgs/applications/science/logic/lean2/default.nix b/pkgs/applications/science/logic/lean2/default.nix new file mode 100644 index 000000000000..e30b8af04735 --- /dev/null +++ b/pkgs/applications/science/logic/lean2/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, gmp, mpfr, python3 +, jemalloc, ninja, makeWrapper }: + +stdenv.mkDerivation { + pname = "lean2"; + version = "2018-10-01"; + + src = fetchFromGitHub { + owner = "leanprover"; + repo = "lean2"; + rev = "8072fdf9a0b31abb9d43ab894d7a858639e20ed7"; + sha256 = "12bscgihdgvaq5xi0hqf5r4w386zxm3nkx1n150lv5smhg8ga3gg"; + }; + + patches = [ + # https://github.com/leanprover/lean2/pull/13 + (fetchpatch { + name = "lean2-fix-compilation-error.patch"; + url = "https://github.com/collares/lean2/commit/09b316ce75fd330b3b140d138bcdae2b0e909234.patch"; + sha256 = "060mvqn9y8lsn4l20q9rhamkymzsgh0r1vzkjw78gnj8kjw67jl5"; + }) + ]; + nativeBuildInputs = [ cmake makeWrapper ninja ]; + buildInputs = [ gmp mpfr python3 jemalloc ]; + + preConfigure = '' + patchShebangs bin/leantags + cd src + ''; + + cmakeFlags = [ "-GNinja" ]; + + postInstall = '' + wrapProgram $out/bin/linja --prefix PATH : $out/bin:${ninja}/bin + ''; + + meta = with lib; { + description = "Automatic and interactive theorem prover (version with HoTT support)"; + homepage = "http://leanprover.github.io"; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ thoughtpolice gebner ]; + broken = stdenv.isAarch64; + mainProgram = "lean"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 743d67d5d6aa..8a610240574d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33276,6 +33276,7 @@ with pkgs; keymapviz = callPackage ../tools/misc/keymapviz { }; lean = callPackage ../applications/science/logic/lean {}; + lean2 = callPackage ../applications/science/logic/lean2 {}; lean3 = lean; elan = callPackage ../applications/science/logic/elan {}; mathlibtools = with python3Packages; toPythonApplication mathlibtools;