* File is read-only; trying to patch anyway
@ 2020-01-11 0:38 LaFreniere, Joseph
2020-01-11 20:20 ` Tobias Geerinckx-Rice
0 siblings, 1 reply; 3+ messages in thread
From: LaFreniere, Joseph @ 2020-01-11 0:38 UTC (permalink / raw)
To: Guix Help
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]
I am working on the attached patch to package
https://github.com/akermu/emacs-libvterm.git.
When building the package I get the following error:
> building
> /gnu/store/89icdpwha5vvqmn2yn3949w503ck6cq6-emacs-vterm-0-1.de63115.tar.xz.drv...
> File vterm-module-make.el is read-only; trying to patch anyway
> patching file vterm-module-make.el
> File vterm.el is read-only; trying to patch anyway
> patching file vterm.el
> Hunk #1 FAILED at 45.
> 1 out of 1 hunk FAILED -- saving rejects to file vterm.el.rej
I have looked at several other packages and the call I'm making to
`make-file-writable` _looks_ to be correct. But that function is
either not called before the patch is applied or else it is not
having the intended effect.
--
Joseph LaFreniere
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-emacs-vterm.patch --]
[-- Type: text/x-patch, Size: 6595 bytes --]
From 0b4ae3a55fce423780e376e59e2bf00bed53e2da 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 | 60 +++++++++++++++++
...emacs-vterm-remove-vterm-module-make.patch | 65 +++++++++++++++++++
2 files changed, 125 insertions(+)
create mode 100644 gnu/packages/patches/emacs-vterm-remove-vterm-module-make.patch
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 6c9d493c62..8e1307af55 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -104,6 +104,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)
@@ -17342,6 +17343,65 @@ 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 "de63115918b9b8633c78509b7bdf05f4935ee20d"))
+ (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
+ "0qxabjf9nq3i1cpyzghxcf0bjhnl5y9g8dvbqjip0gb0l570sbfm"))
+ (modules '((guix build utils)
+ (guix build emacs-build-system)
+ ((guix build cmake-build-system) #:prefix cmake:)))
+ (patches
+ (search-patches
+ "emacs-vterm-remove-vterm-module-make.patch"))))
+ (build-system emacs-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-after 'unpack 'make-el-writable
+ (lambda _
+ (for-each make-file-writable
+ (find-files "." "\\.el$"))
+ #t))
+ (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")
diff --git a/gnu/packages/patches/emacs-vterm-remove-vterm-module-make.patch b/gnu/packages/patches/emacs-vterm-remove-vterm-module-make.patch
new file mode 100644
index 0000000000..284b4a220d
--- /dev/null
+++ b/gnu/packages/patches/emacs-vterm-remove-vterm-module-make.patch
@@ -0,0 +1,65 @@
+From 0780015958a7480a981827a9791c0ea22859062b Mon Sep 17 00:00:00 2001
+From: Joseph LaFreniere <joseph@lafreniere.xyz>
+Date: Thu, 9 Jan 2020 00:55:38 -0600
+Subject: [PATCH] Remove vterm-module-make
+
+---
+ vterm-module-make.el | 31 -------------------------------
+ vterm.el | 4 +---
+ 2 files changed, 1 insertion(+), 34 deletions(-)
+ delete mode 100644 vterm-module-make.el
+
+diff --git a/vterm-module-make.el b/vterm-module-make.el
+deleted file mode 100644
+index 086907f..0000000
+--- a/vterm-module-make.el
++++ /dev/null
+@@ -1,31 +0,0 @@
+-;;; vterm-module-make.el --- make vterm-module in elisp -*- lexical-binding: t; -*-
+-
+-(require 'files)
+-
+-(defvar vterm-install-buffer-name " *Install vterm"
+- "Name of the buffer used for compiling vterm-module.")
+-
+-;;;###autoload
+-(defun vterm-module-compile ()
+- "This function compiles the vterm-module."
+- (interactive)
+- (let ((default-directory
+- (file-name-directory (file-truename (locate-library "vterm"))))
+- (make-commands
+- "mkdir -p build; \
+- cd build; \
+- cmake \
+- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+- ..; \
+- make"))
+- (unless (file-executable-p (concat default-directory "vterm-module.so"))
+- (let* ((buffer (get-buffer-create vterm-install-buffer-name)))
+- (pop-to-buffer vterm-install-buffer-name)
+- (if (zerop (call-process "sh" nil buffer t "-c" make-commands))
+- (message "Compilation of emacs-libvterm module succeeded")
+- (error "Compilation of emacs-libvterm module failed!"))))))
+-
+-(or (require 'vterm-module nil t)
+- (vterm-module-compile))
+-
+-(provide 'vterm-module-make)
+diff --git a/vterm.el b/vterm.el
+index 0060e6a..93e93fa 100644
+--- a/vterm.el
++++ b/vterm.el
+@@ -45,9 +45,7 @@
+ (unless module-file-suffix
+ (error "VTerm needs module support. Please compile your Emacs with the --with-modules option!"))
+
+-(or (require 'vterm-module nil t)
+- (and (require 'vterm-module-make)
+- (require 'vterm-module)))
++(module-load "vterm-module.so")
+
+ (require 'subr-x)
+ (require 'cl-lib)
+--
+2.24.1
--
2.24.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: File is read-only; trying to patch anyway
2020-01-11 0:38 File is read-only; trying to patch anyway LaFreniere, Joseph
@ 2020-01-11 20:20 ` Tobias Geerinckx-Rice
2020-01-12 3:56 ` LaFreniere, Joseph
0 siblings, 1 reply; 3+ messages in thread
From: Tobias Geerinckx-Rice @ 2020-01-11 20:20 UTC (permalink / raw)
To: help-guix, LaFreniere, Joseph
[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]
Joseph,
LaFreniere, Joseph 写道:
> I am working on the attached patch to package
> https://github.com/akermu/emacs-libvterm.git.
Thanks!
> When building the package I get the following error:
>
>> building
>> /gnu/store/89icdpwha5vvqmn2yn3949w503ck6cq6-emacs-vterm-0-1.de63115.tar.xz.drv...
>> File vterm-module-make.el is read-only; trying to patch anyway
>> patching file vterm-module-make.el
>> File vterm.el is read-only; trying to patch anyway
>> patching file vterm.el
>> Hunk #1 FAILED at 45.
>> 1 out of 1 hunk FAILED -- saving rejects to file vterm.el.rej
>
> I have looked at several other packages and the call I'm making
> to
> `make-file-writable` _looks_ to be correct.
Indeed.
> But that function is
> either not called before the patch is applied
Also correct.
The source origin is built as a completely separate derivation,
before Guix even starts to build your package, and long before
your package's phases are called.
Snippets are (vaguely) like phases for your source derivation.
This might work:
(source …
(modules '((guix build utils)))
(snippet
'(begin
(for-each make-file-writable (find-files "."))
#t)))
But… I don't have access to Guix at the moment and am not
positively certain in which order the snippet and patches field
are applied. Try it and let me know.
Kind regards,
T G-R
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: File is read-only; trying to patch anyway
2020-01-11 20:20 ` Tobias Geerinckx-Rice
@ 2020-01-12 3:56 ` LaFreniere, Joseph
0 siblings, 0 replies; 3+ messages in thread
From: LaFreniere, Joseph @ 2020-01-12 3:56 UTC (permalink / raw)
To: Tobias Geerinckx-Rice; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 511 bytes --]
Tobias Geerinckx-Rice <me@tobias.gr> writes:
> The source origin is built as a completely separate derivation,
> before Guix even
> starts to build your package, and long before your package's
> phases are called.
>
> Snippets are (vaguely) like phases for your source derivation.
Thank you for making me aware of snippets! Using snippets I was
finally able to get the build working, and submitted the patch as
bug #39093. The submitted patch is also attached here for
reference.
--
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] 3+ messages in thread
end of thread, other threads:[~2020-01-12 3:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-11 0:38 File is read-only; trying to patch anyway LaFreniere, Joseph
2020-01-11 20:20 ` Tobias Geerinckx-Rice
2020-01-12 3:56 ` LaFreniere, Joseph
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.