cedille.scm 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages cedille)
  19. #:use-module (gnu packages)
  20. #:use-module (gnu packages agda)
  21. #:use-module (gnu packages emacs-xyz)
  22. #:use-module (gnu packages haskell)
  23. #:use-module (gnu packages haskell-xyz)
  24. #:use-module (guix build-system emacs)
  25. #:use-module (guix git-download)
  26. #:use-module ((guix licenses) #:prefix license:)
  27. #:use-module (guix packages))
  28. (define-public cedille
  29. (package
  30. (name "cedille")
  31. (version "1.1.2")
  32. (source
  33. (origin
  34. (method git-fetch)
  35. (uri (git-reference
  36. (url "https://github.com/cedille/cedille")
  37. (commit (string-append "v" version))))
  38. (file-name (git-file-name name version))
  39. (sha256
  40. (base32
  41. "1h5s6ayh3s76z184jai3jidcs4cjk8s4nvkkv2am8dg4gfsybq22"))))
  42. (inputs
  43. `(("agda" ,agda)
  44. ("agda-ial" ,agda-ial)
  45. ("ghc" ,ghc)
  46. ("ghc-alex" ,ghc-alex)
  47. ("ghc-happy" ,ghc-happy)))
  48. (build-system emacs-build-system)
  49. (arguments
  50. `(#:phases
  51. (modify-phases %standard-phases
  52. (add-after 'unpack 'patch-cedille-paths
  53. (lambda* (#:key outputs #:allow-other-keys)
  54. (let ((out (assoc-ref outputs "out")))
  55. (substitute* "cedille-mode.el"
  56. (("/usr/share/emacs/site-lisp/cedille-mode")
  57. (string-append
  58. out "/share/emacs/site-lisp/cedille")))
  59. (substitute* "cedille-mode/cedille-mode-info.el"
  60. (("\\(concat cedille-path-el \"cedille-info-main.info\"\\)")
  61. (string-append
  62. "\"" out "/share/info/cedille-info-main.info.gz\"")))
  63. #t)))
  64. (add-after 'patch-cedille-paths 'copy-cedille-mode
  65. (lambda* (#:key outputs #:allow-other-keys)
  66. (let* ((out (assoc-ref outputs "out"))
  67. (lisp
  68. (string-append
  69. out "/share/emacs/site-lisp/cedille/")))
  70. (mkdir-p (string-append lisp "cedille-mode"))
  71. (copy-recursively
  72. "cedille-mode"
  73. (string-append lisp "cedille-mode"))
  74. (mkdir-p (string-append lisp "se-mode"))
  75. (copy-recursively
  76. "se-mode"
  77. (string-append lisp "se-mode"))
  78. #t)))
  79. ;; FIXME: Byte compilation fails
  80. (delete 'build)
  81. (replace 'check
  82. (lambda _
  83. (with-directory-excursion "cedille-tests"
  84. (invoke "sh" "run-tests.sh"))))
  85. (add-after 'unpack 'patch-libraries
  86. (lambda _ (patch-shebang "create-libraries.sh") #t))
  87. (add-after 'unpack 'copy-ial
  88. (lambda* (#:key inputs #:allow-other-keys)
  89. (copy-recursively
  90. (search-input-directory inputs "/include/agda/ial")
  91. "ial")
  92. ;; Ambiguous module if main is included from ial
  93. (delete-file "ial/main.agda")
  94. #t))
  95. (add-after 'check 'build-cedille
  96. ;; Agda has a hard time with parallel compilation
  97. (lambda _
  98. (invoke "touch" "src/Templates.hs")
  99. (make-file-writable "src/Templates.hs")
  100. (invoke "touch" "src/templates.agda")
  101. (make-file-writable "src/templates.agda")
  102. (invoke "make" "--jobs=1")))
  103. (add-after 'install 'install-cedille
  104. (lambda* (#:key outputs #:allow-other-keys)
  105. (let ((out (assoc-ref outputs "out")))
  106. (copy-recursively
  107. "lib" (string-append out "/lib/cedille"))
  108. (install-file "cedille" (string-append out "/bin"))
  109. (install-file "core/cedille-core"
  110. (string-append out "/bin"))
  111. (install-file "docs/info/cedille-info-main.info"
  112. (string-append out "/share/info"))
  113. #t))))))
  114. (home-page "https://cedille.github.io/")
  115. (synopsis
  116. "Language based on Calculus of Dependent Lambda Eliminations")
  117. (description
  118. "Cedille is an interactive theorem-prover and dependently typed
  119. programming language, based on extrinsic (aka Curry-style) type theory. This
  120. makes it rather different from type theories like Coq and Agda, which are
  121. intrinsic (aka Church-style). In Cedille, terms are nothing more than
  122. annotated versions of terms of pure untyped lambda calculus. In contrast, in
  123. Coq or Agda, the typing annotations are intrinsic parts of terms. The typing
  124. annotations can only be erased as an optimization under certain conditions,
  125. not by virtue of the definition of the type theory.")
  126. (license license:expat)))