* gnu/packages/coq.scm (proof-general)[native-inputs]: Remove 'which'.
[inputs]: Remove 'coq' and 'emacs'.
[arguments]<#:make-flags>: Adjust to find 'emacs'.
Set 'ELISP' and 'DEST_LISP'.
<#:modules, #:imported-modules>: Remove.
<#:phases>: Remove call to 'which' in Makefile.
Add copy file allowing Emacs autoloads.
gnu/packages/coq.scm | 85 +++++++++++++++++++++++---------------------
1 file changed, 45 insertions(+), 40 deletions(-)
Toggle diff (102 lines)
diff --git a/gnu/packages/coq.scm b/gnu/packages/coq.scm
index dccb9bea4c..2cf9d1a602 100644
--- a/gnu/packages/coq.scm
+++ b/gnu/packages/coq.scm
@@ -135,50 +135,55 @@ (define-public proof-general
"00cga3n9nj2xa3ivb0fdkkdx3k11fp4879y188738631yd1x2lsa"))))
(build-system gnu-build-system)
- ("emacs" ,emacs-minimal)
+ `(("emacs" ,emacs-minimal)
- `(("host-emacs" ,emacs)
- `(#:tests? #f ; no check target
- #:make-flags (list (string-append "PREFIX=" %output)
- (string-append "DEST_PREFIX=" %output)
- (string-append "ELISP_START=" %output
- "/share/emacs/site-lisp/ProofGeneral"))
- #:modules ((guix build gnu-build-system)
- (guix build emacs-utils))
- #:imported-modules (,@%gnu-build-system-modules
- (guix build emacs-utils))
- (modify-phases %standard-phases
- (add-after 'unpack 'disable-byte-compile-error-on-warn
- (substitute* "Makefile"
- (("\\(setq byte-compile-error-on-warn t\\)")
- "(setq byte-compile-error-on-warn nil)"))))
- (add-after 'unpack 'patch-hardcoded-paths
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (coq (assoc-ref inputs "coq"))
- (emacs (assoc-ref inputs "host-emacs")))
+ (let ((base-directory "/share/emacs/site-lisp/ProofGeneral"))
+ `(#:tests? #f ; no check target
+ #:make-flags (list (string-append "PREFIX=" %output)
+ (string-append "EMACS=" (assoc-ref %build-inputs "emacs")
+ (string-append "DEST_PREFIX=" %output)
+ (string-append "ELISP=" %output ,base-directory)
+ (string-append "DEST_ELISP=" %output ,base-directory)
+ (string-append "ELISP_START=" %output ,base-directory))
+ (modify-phases %standard-phases
+ (add-after 'unpack 'disable-byte-compile-error-on-warn
+ (substitute* "Makefile"
+ (("\\(setq byte-compile-error-on-warn t\\)")
+ "(setq byte-compile-error-on-warn nil)"))))
+ (add-after 'unpack 'patch-hardcoded-paths
+ (substitute* "Makefile"
+ (("/sbin/install-info") "install-info"))))
+ (add-after 'unpack 'remove-which
+ (substitute* "Makefile"
+ (("`which perl`") "perl")
+ (("`which bash`") "bash"))))
+ (add-after 'unpack 'clean
+ ;; Delete the pre-compiled elc files for Emacs 23.
+ (invoke "make" "clean")))
+ (add-after 'install 'install-doc
+ (lambda* (#:key make-flags #:allow-other-keys)
+ ;; XXX FIXME avoid building/installing pdf files,
+ ;; due to unresolved errors building them.
- (("/sbin/install-info") "install-info")))))
- (add-after 'unpack 'clean
- ;; Delete the pre-compiled elc files for Emacs 23.
- (invoke "make" "clean")))
- (add-after 'install 'install-doc
- (lambda* (#:key make-flags #:allow-other-keys)
- ;; XXX FIXME avoid building/installing pdf files,
- ;; due to unresolved errors building them.
- (substitute* "Makefile"
- (apply invoke "make" "install-doc" make-flags))))))
+ (apply invoke "make" "install-doc" make-flags)))
+ (add-after 'install 'allow-subfolders-autoloads
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; Make it visible by Emacs
+ (copy-file "proof-general.el"
+ (string-append out ,base-directory
+ "/proof-general-autoloads.el")))))))))
(home-page "https://proofgeneral.github.io/")
(synopsis "Generic front-end for proof assistants based on Emacs")