* [bug#39093] [PATCH] gnu: Add emacs-vterm.
@ 2020-01-12 3:50 LaFreniere, Joseph
2020-01-21 14:07 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: LaFreniere, Joseph @ 2020-01-12 3:50 UTC (permalink / raw)
To: 39093
[-- Attachment #1: Type: text/plain, Size: 373 bytes --]
Patch files is attached. There have not yet been any tagged
releases in the source repo, so I have left the version as 0.
I initially tried using a patch file instead of manually using the
substitute snippet, but that was failing with an error that
vterm.el was read-only. If there is a workaround, I would gladly
return to using a patch file.
--
Joseph LaFreniere
[-- Attachment #2: 0001-gnu-Add-emacs-vterm.patch --]
[-- Type: text/x-patch, Size: 4940 bytes --]
From 06223ab2ed07b3fbfb2dfd95aa0a5fce1c44baf9 Mon Sep 17 00:00:00 2001
From: Joseph LaFreniere <joseph@lafreniere.xyz>
Date: Mon, 6 Jan 2020 20:56:35 -0600
Subject: [PATCH] gnu: Add emacs-vterm.
* gnu/packages/emacs-xyz.scm (emacs-vterm): New variable.
---
gnu/packages/emacs-xyz.scm | 67 +++++++++++++++++++++++++++++++++++++-
1 file changed, 66 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 0559f0c7cc..9a0f08e16a 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -46,7 +46,7 @@
;;; Copyright © 2019 Brian Leung <bkleung89@gmail.com>
;;; Copyright © 2019 mikadoZero <mikadozero@yandex.com>
;;; Copyright © 2019 Gabriel Hondet <gabrielhondet@gmail.com>
-;;; Copyright © 2019 LaFreniere, Joseph <joseph@lafreniere.xyz>
+;;; Copyright © 2019, 2020 Joseph LaFreniere <joseph@lafreniere.xyz>
;;; Copyright © 2019 Amar Singh <nly@disroot.org>
;;; Copyright © 2019 Baptiste Strazzulla <bstrazzull@hotmail.fr>
;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
@@ -105,6 +105,7 @@
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages telephony)
+ #:use-module (gnu packages terminals)
#:use-module (gnu packages tex)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages tcl)
@@ -17401,6 +17402,70 @@ next, volume) and display and control the current playlist as well as your
stored playlists.")
(license license:gpl3+)))
+(define-public emacs-vterm
+ (let ((version "0")
+ (revision "1")
+ (commit "7d7381fa8104b55b70148cf147523d9ab7f01fcd"))
+ (package
+ (name "emacs-vterm")
+ (version (git-version version revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/akermu/emacs-libvterm.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04a2jlhmr20ipgzpnba3yryw3ly7qdxjgaw10dwn9wxy1yqmapz1"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (delete-file "vterm-module-make.el")
+ (substitute* "vterm.el"
+ (((string-append "\\(or \\(require 'vterm-module nil t\\)\n"
+ "^.*\\(and \\(require 'vterm-module-make\\)\n"
+ "^.*\\(require 'vterm-module\\)\\)\\)"))
+ "(module-load \"vterm-module.so)"))
+ (make-file-writable "vterm.el")
+ #t))))
+ (build-system emacs-build-system)
+ (arguments
+ `(#:modules ((guix build emacs-build-system)
+ ((guix build cmake-build-system) #:prefix cmake:)
+ (guix build utils))
+ #:imported-modules (,@%emacs-build-system-modules
+ (guix build cmake-build-system))
+ #:phases (modify-phases %standard-phases
+ (add-before 'add-source-to-load-path 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ ((assoc-ref cmake:%standard-phases 'configure)
+ #:outputs outputs
+ #:out-of-source? #f
+ #:configure-flags '("-DUSE_SYSTEM_LIBVTERM=ON"))))
+ (add-before 'install 'make
+ (lambda* (#:key (make-flags '()) #:allow-other-keys)
+ (apply invoke "make" "all" make-flags)
+ #t))
+ (add-before 'make-autoloads 'move-el
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (site-lisp (string-append out "/share/emacs/site-lisp")))
+ (mkdir-p site-lisp)
+ (copy-file "vterm.el" (string-append site-lisp "/vterm.el"))
+ (copy-file "vterm-module.so" (string-append site-lisp "/vterm-module.so"))
+ #t))))
+ #:tests? #f))
+ (native-inputs
+ `(("cmake" ,cmake-minimal)
+ ("libtool" ,libtool)
+ ("libvterm" ,libvterm)))
+ (home-page "https://github.com/akermu/emacs-libvterm")
+ (synopsis "Emacs libvterm integration")
+ (description "This package implements a bridge to @code{libvterm} to
+display a terminal in an Emacs buffer.")
+ (license license:gpl3+))))
+
(define-public emacs-simple-mpc
;; There have been no releases.
(let ((commit "bee8520e81292b4c7353e45b193f9a13b482f5b2")
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#39093] [PATCH] gnu: Add emacs-vterm.
2020-01-12 3:50 [bug#39093] [PATCH] gnu: Add emacs-vterm LaFreniere, Joseph
@ 2020-01-21 14:07 ` Ludovic Courtès
2020-01-26 15:06 ` LaFreniere, Joseph
0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2020-01-21 14:07 UTC (permalink / raw)
To: LaFreniere, Joseph; +Cc: 39093
Hello Joseph,
"LaFreniere, Joseph" <joseph@lafreniere.xyz> skribis:
>>From 06223ab2ed07b3fbfb2dfd95aa0a5fce1c44baf9 Mon Sep 17 00:00:00 2001
> From: Joseph LaFreniere <joseph@lafreniere.xyz>
> Date: Mon, 6 Jan 2020 20:56:35 -0600
> Subject: [PATCH] gnu: Add emacs-vterm.
>
> * gnu/packages/emacs-xyz.scm (emacs-vterm): New variable.
Neat!
> + (modules '((guix build utils)))
> + (snippet
> + '(begin
> + (delete-file "vterm-module-make.el")
> + (substitute* "vterm.el"
> + (((string-append "\\(or \\(require 'vterm-module nil t\\)\n"
> + "^.*\\(and \\(require 'vterm-module-make\\)\n"
> + "^.*\\(require 'vterm-module\\)\\)\\)"))
> + "(module-load \"vterm-module.so)"))
> + (make-file-writable "vterm.el")
Apparently this substitution doesn’t have the desired effect. Also,
I strongly recommend using literal strings as patterns.
Actually, what about performing this substitution as a phase instead of
here? We could probably use ‘emacs-substitute-sexps’ to do that, which
should be nicer, and we could also hard-code the absolute file name of
‘vterm-module.so’.
How does that sound?
The rest LGTM!
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bug#39093] [PATCH] gnu: Add emacs-vterm.
2020-01-21 14:07 ` Ludovic Courtès
@ 2020-01-26 15:06 ` LaFreniere, Joseph
2020-01-26 22:10 ` bug#39093: " Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: LaFreniere, Joseph @ 2020-01-26 15:06 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 39093
[-- Attachment #1: Type: text/plain, Size: 603 bytes --]
Ludovic Courtès <ludo@gnu.org> writes:
> Actually, what about performing this substitution as a phase
> instead of
> here? We could probably use ‘emacs-substitute-sexps’ to do
> that, which
> should be nicer, and we could also hard-code the absolute file
> name of
> ‘vterm-module.so’.
Thank you for the feedback, Ludo.
A new patch is attached. Both of the suggested changes (using
emacs-substitute-sexps and hardcoding the absolute path of the
shared object) have been implemented. Additionally, the shared
object has been moved into /lib.
--
Joseph LaFreniere
[-- Attachment #2: 0001-gnu-Add-emacs-vterm.patch --]
[-- Type: text/x-patch, Size: 4682 bytes --]
From 74e99bf345ef14b08a052c923418a068c9a24de0 Mon Sep 17 00:00:00 2001
From: Joseph LaFreniere <joseph@lafreniere.xyz>
Date: Mon, 6 Jan 2020 20:56:35 -0600
Subject: [PATCH] gnu: Add emacs-vterm.
* gnu/packages/emacs-xyz.scm (emacs-vterm): New variable.
---
gnu/packages/emacs-xyz.scm | 70 +++++++++++++++++++++++++++++++++++++-
1 file changed, 69 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 40839d4869..d30a3ecbc1 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -46,7 +46,7 @@
;;; Copyright © 2019 Brian Leung <bkleung89@gmail.com>
;;; Copyright © 2019 mikadoZero <mikadozero@yandex.com>
;;; Copyright © 2019 Gabriel Hondet <gabrielhondet@gmail.com>
-;;; Copyright © 2019 LaFreniere, Joseph <joseph@lafreniere.xyz>
+;;; Copyright © 2019, 2020 Joseph LaFreniere <joseph@lafreniere.xyz>
;;; Copyright © 2019 Amar Singh <nly@disroot.org>
;;; Copyright © 2019 Baptiste Strazzulla <bstrazzull@hotmail.fr>
;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
@@ -105,6 +105,7 @@
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages telephony)
+ #:use-module (gnu packages terminals)
#:use-module (gnu packages tex)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages tcl)
@@ -17401,6 +17402,73 @@ next, volume) and display and control the current playlist as well as your
stored playlists.")
(license license:gpl3+)))
+(define-public emacs-vterm
+ (let ((version "0")
+ (revision "1")
+ (commit "7d7381fa8104b55b70148cf147523d9ab7f01fcd"))
+ (package
+ (name "emacs-vterm")
+ (version (git-version version revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/akermu/emacs-libvterm.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04a2jlhmr20ipgzpnba3yryw3ly7qdxjgaw10dwn9wxy1yqmapz1"))))
+ (build-system emacs-build-system)
+ (arguments
+ `(#:modules ((guix build emacs-build-system)
+ ((guix build cmake-build-system) #:prefix cmake:)
+ (guix build emacs-utils)
+ (guix build utils))
+ #:imported-modules (,@%emacs-build-system-modules
+ (guix build cmake-build-system))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'add-source-to-load-path 'remove-vterm-module-make
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Remove the Emacs Lisp file.
+ (delete-file "vterm-module-make.el")
+ ;; Remove references to the removed file.
+ (make-file-writable "vterm.el")
+ (emacs-substitute-sexps "vterm.el"
+ ("(or (require 'vterm-module nil t)"
+ `(module-load
+ ,(string-append (assoc-ref outputs "out")
+ "/lib/vterm-module.so"))))
+ #t))
+ (add-after 'build 'configure
+ ;; Run cmake.
+ (lambda* (#:key outputs #:allow-other-keys)
+ ((assoc-ref cmake:%standard-phases 'configure)
+ #:outputs outputs
+ #:out-of-source? #f
+ #:configure-flags '("-DUSE_SYSTEM_LIBVTERM=ON"))
+ #t))
+ (add-after 'configure 'make
+ ;; Run make.
+ (lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
+ ;; Compile the shared object file.
+ (apply invoke "make" "all" make-flags)
+ ;; Move the file into /lib.
+ (install-file
+ "vterm-module.so"
+ (string-append (assoc-ref outputs "out") "/lib"))
+ #t)))
+ #:tests? #f))
+ (native-inputs
+ `(("cmake" ,cmake-minimal)
+ ("libtool" ,libtool)
+ ("libvterm" ,libvterm)))
+ (home-page "https://github.com/akermu/emacs-libvterm")
+ (synopsis "Emacs libvterm integration")
+ (description "This package implements a bridge to @code{libvterm} to
+display a terminal in an Emacs buffer.")
+ (license license:gpl3+))))
+
(define-public emacs-simple-mpc
;; There have been no releases.
(let ((commit "bee8520e81292b4c7353e45b193f9a13b482f5b2")
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#39093: [PATCH] gnu: Add emacs-vterm.
2020-01-26 15:06 ` LaFreniere, Joseph
@ 2020-01-26 22:10 ` Ludovic Courtès
0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2020-01-26 22:10 UTC (permalink / raw)
To: LaFreniere, Joseph; +Cc: 39093-done
Hi,
"LaFreniere, Joseph" <joseph@lafreniere.xyz> skribis:
> A new patch is attached. Both of the suggested changes (using
> emacs-substitute-sexps and hardcoding the absolute path of the shared
> object) have been implemented. Additionally, the shared object has
> been moved into /lib.
Awesome.
> From 74e99bf345ef14b08a052c923418a068c9a24de0 Mon Sep 17 00:00:00 2001
> From: Joseph LaFreniere <joseph@lafreniere.xyz>
> Date: Mon, 6 Jan 2020 20:56:35 -0600
> Subject: [PATCH] gnu: Add emacs-vterm.
>
> * gnu/packages/emacs-xyz.scm (emacs-vterm): New variable.
Applied, thanks!
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-26 22:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-12 3:50 [bug#39093] [PATCH] gnu: Add emacs-vterm LaFreniere, Joseph
2020-01-21 14:07 ` Ludovic Courtès
2020-01-26 15:06 ` LaFreniere, Joseph
2020-01-26 22:10 ` bug#39093: " Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.