me
/
guix
Archived
1
0
Fork 0

gnu: emacs-telega: Adjust to changes in emacs-build-system.

* gnu/packages/emacs-telega.scm (emacs-telega)[#:phases]: Reorder.
<telega-paths-patch>: Rename to...
<patch-sources>: ... this.  Also don't patch paths to subdirs.
Remove the snippet, that would push contrib to the load path.
<server-suite-patch>: Rename to...
<patch-test-suite>: ... this.
<emacs-install>: Also install etc.
<emacs-bytecomp-contrib, telega-install-contrib, telega-install-data>: Removed
phases.
master
Leo Prikler 2021-04-17 19:06:22 +02:00
parent f974455708
commit 132560821c
No known key found for this signature in database
GPG Key ID: 442A84B8C70E2F87
1 changed files with 15 additions and 47 deletions

View File

@ -25328,7 +25328,9 @@ other @code{helm-type-file} sources such as @code{helm-locate}.")
(("python3 run_tests.py") (("python3 run_tests.py")
"")) ""))
#t)) #t))
(add-after 'check 'telega-paths-patch (add-after 'unpack 'expand-load-path
(assoc-ref emacs:%standard-phases 'expand-load-path))
(add-after 'unpack 'patch-sources
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; Hard-code paths to `ffplay` and `ffmpeg`. ;; Hard-code paths to `ffplay` and `ffmpeg`.
(let ((ffplay-bin (string-append (assoc-ref inputs "ffmpeg") (let ((ffplay-bin (string-append (assoc-ref inputs "ffmpeg")
@ -25344,24 +25346,15 @@ other @code{helm-type-file} sources such as @code{helm-locate}.")
(string-append (string-append
"(and (file-executable-p \"" ffmpeg-bin "\")" "(and (file-executable-p \"" ffmpeg-bin "\")"
"\"" ffmpeg-bin "\")")))) "\"" ffmpeg-bin "\")"))))
;; Modify telega-util to reflect unique dir name in ;; This would push the "contrib" sources to the load path,
;; `telega-install-data' phase. ;; but as contrib is not installed alongside telega, it does
(substitute* "telega-util.el" ;; nothing.
(("\\(concat \"etc/\" filename\\) telega--lib-directory")
"(concat \"telega-data/\" filename)
(locate-dominating-file telega--lib-directory
\"telega-data\")"))
;; Modify telega.el to reflect unique dir name in
;; `telega-install-contrib' phase.
(substitute* "telega.el" (substitute* "telega.el"
(("\\(push \\(expand-file-name \"contrib\" telega--lib-directory\\) load-path\\)") (("\\(push .* load-path\\)") ""))
"(push (expand-file-name \"telega-contrib\"
(locate-dominating-file telega--lib-directory
\"telega-contrib\")) load-path)"))
#t)) #t))
;; The server test suite has a hardcoded path. ;; The server test suite has a hardcoded path.
;; Reset this behavior to use the proper path. ;; Reset this behavior to use the proper path.
(add-after 'unpack 'server-suite-patch (add-after 'unpack 'patch-test-suite
(lambda _ (lambda _
(substitute* "server/run_tests.py" (substitute* "server/run_tests.py"
(("~/.telega/telega-server") (("~/.telega/telega-server")
@ -25373,39 +25366,14 @@ other @code{helm-type-file} sources such as @code{helm-locate}.")
(invoke "python3" "server/run_tests.py") (invoke "python3" "server/run_tests.py")
#t)) #t))
(delete 'configure) (delete 'configure)
;; Build emacs-side using `emacs-build-system' (add-after 'expand-load-path 'emacs-install
(add-after 'compress-documentation 'emacs-add-source-to-load-path (lambda args
(assoc-ref emacs:%standard-phases 'add-source-to-load-path)) (apply (assoc-ref emacs:%standard-phases 'install)
;; Manually invoke bytecompilation for the contrib #:include `("etc" ,@emacs:%default-include)
;; subdirectory. args)))
(add-after 'emacs-add-source-to-load-path 'emacs-bytecomp-contrib (add-after 'emacs-install 'emacs-build
(lambda _
(substitute* "Makefile"
(("byte-recompile-directory \".\"")
"byte-recompile-directory \"contrib\""))
(invoke "make" "compile")
#t))
(add-after 'emacs-bytecomp-contrib 'emacs-install
(assoc-ref emacs:%standard-phases 'install))
;; This step installs subdir /etc, which contains images, sounds and
;; various other data, next to the site-lisp dir.
(add-after 'emacs-install 'telega-install-data
(lambda* (#:key outputs #:allow-other-keys)
(copy-recursively
"etc"
(string-append (assoc-ref outputs "out")
"/share/emacs/telega-data/"))
#t))
(add-after 'emacs-install 'telega-install-contrib
(lambda* (#:key outputs #:allow-other-keys)
(copy-recursively
"contrib"
(string-append (assoc-ref outputs "out")
"/share/emacs/telega-contrib"))
#t))
(add-after 'telega-install-contrib 'emacs-build
(assoc-ref emacs:%standard-phases 'build)) (assoc-ref emacs:%standard-phases 'build))
(add-after 'telega-install-contrib 'emacs-make-autoloads (add-after 'emacs-install 'emacs-make-autoloads
(assoc-ref emacs:%standard-phases 'make-autoloads))))) (assoc-ref emacs:%standard-phases 'make-autoloads)))))
(inputs (inputs
`(("ffmpeg" ,ffmpeg))) ; mp4/gif support. `(("ffmpeg" ,ffmpeg))) ; mp4/gif support.