;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Julien Lepiller ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Dan Frumin ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2020 Björn Höfling ;;; Copyright © 2020 raingloom ;;; Copyright © 2020 Robin Green ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages coq) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bison) #:use-module (gnu packages boost) #:use-module (gnu packages emacs) #:use-module (gnu packages flex) #:use-module (gnu packages gawk) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ocaml) #:use-module (gnu packages perl) #:use-module (gnu packages python) #:use-module (gnu packages rsync) #:use-module (gnu packages texinfo) #:use-module (guix build-system gnu) #:use-module (guix build-system ocaml) #:use-module (guix download) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) #:use-module ((srfi srfi-1) #:hide (zip))) (define-public coq (package (name "coq") (version "8.11.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/coq/coq") (commit (string-append "V" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1gia82dkmzqspw2w3s4gjyh39ghbmw4i41i4hyzc91g7mza17nbz")))) (native-search-paths (list (search-path-specification (variable "COQPATH") (files (list "lib/coq/user-contrib"))))) (build-system ocaml-build-system) (outputs '("out" "ide")) (inputs `(("lablgtk" ,lablgtk3) ("python" ,python-2) ("camlp5" ,camlp5) ("ocaml-num" ,ocaml-num))) (native-inputs `(("ocaml-ounit" ,ocaml-ounit) ("rsync" ,rsync) ("which" ,which))) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'make-git-checkout-writable (lambda _ (for-each make-file-writable (find-files ".")) #t)) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (mandir (string-append out "/share/man")) (browser "icecat -remote \"OpenURL(%s,new-tab)\"")) (invoke "./configure" "-prefix" out "-mandir" mandir "-browser" browser "-coqide" "opt")))) (replace 'build (lambda _ (invoke "make" "-j" (number->string (parallel-job-count)) "world"))) (delete 'check) (add-after 'install 'remove-duplicate (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin")) (coqtop (string-append bin "/coqtop")) (coqidetop (string-append bin "/coqidetop")) (coqtop.opt (string-append coqtop ".opt")) (coqidetop.opt (string-append coqidetop ".opt"))) ;; These files are exact copies without `.opt` extension. ;; Removing these saves 35 MiB in the resulting package. ;; Unfortunately, completely deleting them breaks coqide. (delete-file coqtop.opt) (delete-file coqidetop.opt) (symlink coqtop coqtop.opt) (symlink coqidetop coqidetop.opt)) #t)) (add-after 'install 'install-ide (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) (ide (assoc-ref outputs "ide"))) (mkdir-p (string-append ide "/