gnu: telega: Use new package style.

* gnu/packages/emacs-xyz.scm (emacs-telega, emacs-telega-contrib): Use gexps,
remove trailing #t.
This commit is contained in:
Andrew Tropin 2022-01-20 14:09:14 +03:00
parent 6fe253da9b
commit 6cba399c04
No known key found for this signature in database
GPG key ID: 2208D20958C1DEB0

View file

@ -30403,39 +30403,40 @@ service, and connect it with Emacs via inter-process communication.")
(name "emacs-telega") (name "emacs-telega")
(build-system emacs-build-system) (build-system emacs-build-system)
(arguments (arguments
`(#:emacs ,(if (target-64bit?) (list
emacs-minimal #:emacs (if (target-64bit?)
;; Require wide-int support for 32-bit platform. emacs-minimal
emacs-wide-int) ;; Require wide-int support for 32-bit platform.
#:include (cons "^etc\\/" %default-include) emacs-wide-int)
#:phases #:include #~(cons "^etc\\/" %default-include)
(modify-phases %standard-phases #:phases
(add-after 'unpack 'patch-sources #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'patch-sources
;; Hard-code paths to `ffplay` and `ffmpeg`. (lambda* (#:key inputs #:allow-other-keys)
(let* ((ffplay-bin (search-input-file inputs "/bin/ffplay")) ;; Hard-code paths to `ffplay` and `ffmpeg`.
(ffmpeg-bin (search-input-file inputs "/bin/ffmpeg"))) (let* ((ffplay-bin (search-input-file inputs "/bin/ffplay"))
(substitute* '("telega-ffplay.el" "telega-vvnote.el") (ffmpeg-bin (search-input-file inputs "/bin/ffmpeg")))
(("(shell-command-to-string\|concat) \"(ffmpeg\|ffprobe)" (substitute* '("telega-ffplay.el" "telega-vvnote.el")
all func cmd) (("(shell-command-to-string\|concat) \"(ffmpeg\|ffprobe)"
(string-append func " \"" all func cmd)
(search-input-file (string-append func " \""
inputs (string-append "/bin/" cmd)))) (search-input-file
(("\\(executable-find \"ffplay\"\\)") inputs (string-append "/bin/" cmd))))
(string-append "(and (file-executable-p \"" ffplay-bin "\")" (("\\(executable-find \"ffplay\"\\)")
"\"" ffplay-bin "\")")) (string-append "(and (file-executable-p \"" ffplay-bin "\")"
(("\\(executable-find \"ffmpeg\"\\)") "\"" ffplay-bin "\")"))
(string-append "(and (file-executable-p \"" ffmpeg-bin "\")" (("\\(executable-find \"ffmpeg\"\\)")
"\"" ffmpeg-bin "\")")))))) (string-append "(and (file-executable-p \"" ffmpeg-bin "\")"
(add-after 'unpack 'configure "\"" ffmpeg-bin "\")"))))))
(lambda* (#:key inputs outputs #:allow-other-keys) (add-after 'unpack 'configure
(substitute* "telega-customize.el" (lambda* (#:key inputs outputs #:allow-other-keys)
(("@TELEGA_SERVER_BIN@") (substitute* "telega-customize.el"
(search-input-file inputs "/bin/telega-server"))) (("@TELEGA_SERVER_BIN@")
(substitute* "telega-util.el" (search-input-file inputs "/bin/telega-server")))
(("@TELEGA_SHARE@") (substitute* "telega-util.el"
(string-append (elpa-directory (assoc-ref outputs "out")) (("@TELEGA_SHARE@")
"/etc")))))))) (string-append (elpa-directory (assoc-ref outputs "out"))
"/etc"))))))))
(inputs (inputs
(list emacs-telega-server ffmpeg)) (list emacs-telega-server ffmpeg))
(native-inputs '()) (native-inputs '())
@ -30451,13 +30452,14 @@ for the Telegram messaging platform.")))
(inherit emacs-telega) (inherit emacs-telega)
(name "emacs-telega-contrib") (name "emacs-telega-contrib")
(arguments (arguments
`(#:exclude '("telega-live-location.el") (list
#:phases #:exclude #~(list "telega-live-location.el")
(modify-phases %standard-phases #:phases
(add-after 'unpack 'enter-subdirectory #~(modify-phases %standard-phases
(lambda _ (chdir "contrib") #t)) (add-after 'unpack 'enter-subdirectory
(add-before 'install-license-files 'leave-subdirectory (lambda _ (chdir "contrib")))
(lambda _ (chdir "..") #t))))) (add-before 'install-license-files 'leave-subdirectory
(lambda _ (chdir ".."))))))
(inputs '()) (inputs '())
(native-inputs '()) (native-inputs '())
(propagated-inputs (propagated-inputs