You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
3.0 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 Amin Bandali <bandali@gnu.org>
  3. ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages lean)
  20. #:use-module (gnu packages multiprecision)
  21. #:use-module (guix build-system cmake)
  22. #:use-module ((guix licenses) #:prefix license:)
  23. #:use-module (guix packages)
  24. #:use-module (guix git-download))
  25. (define-public lean
  26. (package
  27. (name "lean")
  28. (version "3.17.1")
  29. (home-page "https://github.com/leanprover-community/lean")
  30. (source (origin
  31. (method git-fetch)
  32. (uri (git-reference (url home-page)
  33. (commit (string-append "v" version))))
  34. (file-name (git-file-name name version))
  35. (sha256
  36. (base32
  37. "15yfryg98x9lvy00v1w5kg4hp921mpvlxx1ic3m08k1ls6p1gkj4"))))
  38. (build-system cmake-build-system)
  39. (inputs
  40. `(("gmp" ,gmp)))
  41. (arguments
  42. `(#:build-type "Release" ; default upstream build type
  43. ;; XXX: Test phases currently fail on 32-bit sytems.
  44. ;; Tests for those architectures have been temporarily
  45. ;; disabled, pending further investigation.
  46. #:tests? ,(let ((arch (or (%current-target-system)
  47. (%current-system))))
  48. (not (or (string-prefix? "i686" arch)
  49. (string-prefix? "armhf" arch))))
  50. #:phases
  51. (modify-phases %standard-phases
  52. (add-after 'patch-source-shebangs 'patch-tests-shebangs
  53. (lambda _
  54. (let ((sh (which "sh"))
  55. (bash (which "bash")))
  56. (substitute* (find-files "tests/lean" "\\.sh$")
  57. (("#![[:blank:]]?/bin/sh")
  58. (string-append "#!" sh))
  59. (("#![[:blank:]]?/bin/bash")
  60. (string-append "#!" bash))
  61. (("#![[:blank:]]?usr/bin/env bash")
  62. (string-append "#!" bash)))
  63. #t)))
  64. (add-before 'configure 'chdir-to-src
  65. (lambda _ (chdir "src") #t)))))
  66. (synopsis "The Lean theorem prover and programming language")
  67. (description
  68. "Lean is a theorem prover and programming language with a small trusted
  69. core based on dependent typed theory, aiming to bridge the gap between
  70. interactive and automated theorem proving.")
  71. (license license:asl2.0)))