gnu: emacs-pdf-tools: Use emacs-build-system for elisp side.

* gnu/packages/emacs.scm (emacs-pdf-tools)[arguments]: Add phases from
emacs-build-system to build elisp side.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Alex Kost 2016-03-11 11:34:20 +03:00
parent 5e3161d38e
commit 1bcae5c5c5

View file

@ -1018,40 +1018,41 @@ (define-public emacs-pdf-tools
(arguments (arguments
`(#:tests? #f ; there are no tests `(#:tests? #f ; there are no tests
#:modules ((guix build gnu-build-system) #:modules ((guix build gnu-build-system)
((guix build emacs-build-system) #:prefix emacs:)
(guix build utils) (guix build utils)
(guix build emacs-utils)) (guix build emacs-utils))
#:imported-modules (,@%gnu-build-system-modules #:imported-modules (,@%gnu-build-system-modules
(guix build emacs-build-system)
(guix build emacs-utils)) (guix build emacs-utils))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'enter-dir (lambda _ (chdir "server") #t)) ;; Build server side using 'gnu-build-system'.
(add-before (add-after 'unpack 'enter-server-dir
'configure 'autogen (lambda _ (chdir "server") #t))
(lambda _ (add-before 'configure 'autogen
(zero? (system* "bash" "autogen.sh")))) (lambda _
(add-before (zero? (system* "bash" "autogen.sh"))))
'build 'patch-variables
(lambda* (#:key outputs #:allow-other-keys) ;; Build emacs side using 'emacs-build-system'.
(with-directory-excursion "../lisp" (add-after 'compress-documentation 'enter-lisp-dir
;; Set path to epdfinfo program. (lambda _ (chdir "../lisp") #t))
(emacs-substitute-variables "pdf-info.el" (add-after 'enter-lisp-dir 'emacs-patch-variables
("pdf-info-epdfinfo-program" (lambda* (#:key outputs #:allow-other-keys)
(string-append (assoc-ref outputs "out") ;; Set path to epdfinfo program.
"/bin/epdfinfo"))) (emacs-substitute-variables "pdf-info.el"
;; Set 'pdf-tools-handle-upgrades' to nil to avoid "auto ("pdf-info-epdfinfo-program"
;; upgrading" that pdf-tools tries to perform. (string-append (assoc-ref outputs "out")
(emacs-substitute-variables "pdf-tools.el" "/bin/epdfinfo")))
("pdf-tools-handle-upgrades" '()))))) ;; Set 'pdf-tools-handle-upgrades' to nil to avoid "auto
(add-after ;; upgrading" that pdf-tools tries to perform.
'install 'install-lisp (emacs-substitute-variables "pdf-tools.el"
(lambda* (#:key outputs #:allow-other-keys) ("pdf-tools-handle-upgrades" '()))))
(let ((target (string-append (assoc-ref outputs "out") (add-after 'emacs-patch-variables 'emacs-install
"/share/emacs/site-lisp/"))) (assoc-ref emacs:%standard-phases 'install))
(for-each (lambda (file) (add-after 'emacs-install 'emacs-build
(install-file file target)) (assoc-ref emacs:%standard-phases 'build))
(find-files "../lisp" "^(pdf|tab).*\\.elc?")) (add-after 'emacs-install 'emacs-make-autoloads
(emacs-byte-compile-directory target) (assoc-ref emacs:%standard-phases 'make-autoloads)))))
(emacs-generate-autoloads "pdf-tools" target)))))))
(native-inputs `(("autoconf" ,autoconf) (native-inputs `(("autoconf" ,autoconf)
("automake" ,automake) ("automake" ,automake)
("pkg-config" ,pkg-config) ("pkg-config" ,pkg-config)