unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41405] [PATCH] Update emacs-magit to latest commit.
@ 2020-05-19 17:26 Maxim Cournoyer
  2020-05-26 21:53 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Cournoyer @ 2020-05-19 17:26 UTC (permalink / raw)
  To: 41405


[-- Attachment #1.1: Type: text/plain, Size: 434 bytes --]

This updates our emacs-magit package to the latest version, which
has the following benefits:

1) The test suite is now enabled.
2) The libgit2 C library is now accelerating some of the Magit tasks
3) Using the emacs-build-system means the Magit autoload file is
now byte compiled.
4) No custom patching is done.

The other updates were required to prevent breaking some of the packages
which had a dependency on emacs-magit.

Maxim


[-- Attachment #1.2: 0001-gnu-Add-emacs-libgit.patch --]
[-- Type: text/x-patch, Size: 9920 bytes --]

From 753bd2c655b160313277dfd79a1e9821bde1f853 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Fri, 27 Mar 2020 21:21:37 -0400
Subject: [PATCH 1/5] gnu: Add emacs-libgit.

* gnu/packages/emacs-xyz.scm (emacs-libgit): New variable.
* gnu/local.mk (dist_patch_DATA): Register patch.
---
 gnu/local.mk                                  |  3 +-
 gnu/packages/emacs-xyz.scm                    | 78 +++++++++++++++-
 .../emacs-libgit-use-system-libgit2.patch     | 88 +++++++++++++++++++
 3 files changed, 167 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/emacs-libgit-use-system-libgit2.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 38b286203e..d38ac5722d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -19,7 +19,7 @@
 # Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
 # Copyright © 2018, 2019, 2020 Oleg Pykhalov <go.wigust@gmail.com>
 # Copyright © 2018 Stefan Stefanović <stefanx2ovic@gmail.com>
-# Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+# Copyright © 2018, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 # Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 # Copyright © 2019, 2020 John Soo <jsoo1@asu.edu>
 # Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
@@ -886,6 +886,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/emacs-fix-scheme-indent-function.patch	\
   %D%/packages/patches/emacs-json-reformat-fix-tests.patch	\
   %D%/packages/patches/emacs-highlight-stages-add-gexp.patch	\
+  %D%/packages/patches/emacs-libgit-use-system-libgit2.patch    \
   %D%/packages/patches/emacs-magit-log-format-author-margin.patch	\
   %D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch	\
   %D%/packages/patches/emacs-source-date-epoch.patch		\
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 4bbd482409..866f19c1fd 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -31,7 +31,7 @@
 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Mike Gerwitz <mtg@gnu.org>
-;;; Copyright © 2017, 2018, 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2017, 2018, 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Sohom Bhattacharjee <soham.bhattacharjee15@gmail.com>
 ;;; Copyright © 2018, 2019 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
@@ -314,6 +314,82 @@ For remote processes a substitute is provided, which communicates with Emacs
 on stdout instead of using a socket as the Emacsclient does.")
     (license license:gpl3+)))
 
+(define-public emacs-libgit
+  (let ((commit "0ef8b13aef011a98b7da756e4f1ce3bb18e4d55a")
+        (revision "1"))
+    (package
+      (name "emacs-libgit")
+      (version (git-version "20200515" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/magit/libegit2.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0pnjr3bg6y6354dfjjxfj0g51swzgl1fncpprah75x4k94rd369f"))
+                (patches (search-patches
+                          ;; Submitted for inclusion upstream (see:
+                          ;; https://github.com/magit/libegit2/pull/96).
+                          "emacs-libgit-use-system-libgit2.patch"))))
+      ;; Use the cmake-build-system as it provides support for cross builds.
+      (build-system cmake-build-system)
+      (arguments
+       `(#:configure-flags '("-DUSE_SYSTEM_LIBGIT2=x")
+         ;; Add the emacs-build-system byte compilation and install phases.
+         #:imported-modules (,@%cmake-build-system-modules
+                             (guix build emacs-build-system)
+                             (guix build emacs-utils))
+         #:modules ((guix build cmake-build-system)
+                    ((guix build emacs-build-system) #:prefix emacs:)
+                    (guix build emacs-utils)
+                    (guix build utils))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'set-libgit--module-file
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (make-file-writable "libgit.el")
+                 (emacs-substitute-variables "libgit.el"
+                   ("libgit--module-file"
+                    (string-append out "/share/emacs/site-lisp/libegit2.so")))
+                 #t)))
+           (add-before 'install 'prepare-for-install
+             (lambda _
+               (let ((s (string-append "../" ,name "-" ,version "-checkout")))
+                 (copy-file "libegit2.so" (string-append s "/libegit2.so"))
+                 (chdir s)
+                 #t)))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((install (assoc-ref emacs:%standard-phases 'install)))
+                 (install #:outputs outputs
+                          #:include (cons "\\.so$"
+                                          emacs:%default-include)))))
+           (add-after 'install 'make-autoloads
+             (assoc-ref emacs:%standard-phases 'make-autoloads))
+           (add-after 'make-autoloads 'enable-autoloads-compilation
+             (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation))
+           (add-after 'enable-autoloads-compilation 'patch-el-files
+             (assoc-ref emacs:%standard-phases 'patch-el-files))
+           (add-after 'patch-el-files 'emacs-build
+             (assoc-ref emacs:%standard-phases 'build))
+           (add-after 'emacs-build 'validate-compiled-autoloads
+             (assoc-ref emacs:%standard-phases 'validate-compiled-autoloads)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("emacs" ,emacs-no-x)
+         ("git" ,git-minimal)))
+      (inputs
+       `(("libgit2" ,libgit2)))
+      (home-page "https://github.com/magit/libegit2")
+      (synopsis "Emacs bindings for libgit2")
+      (description "This is an experimental module written in C providing
+libgit2 bindings for Emacs, intended to boost the performance of Magit.")
+      ;; The LICENSE file says GPL v2+, but libgit.el says GPL v3+.
+      (license license:gpl3+))))
+
 (define-public emacs-magit
   ;; `magit-setup-buffer' macro introduced in c761d28d and required in
   ;; `emacs-forge'.
diff --git a/gnu/packages/patches/emacs-libgit-use-system-libgit2.patch b/gnu/packages/patches/emacs-libgit-use-system-libgit2.patch
new file mode 100644
index 0000000000..4a5546b06b
--- /dev/null
+++ b/gnu/packages/patches/emacs-libgit-use-system-libgit2.patch
@@ -0,0 +1,88 @@
+From de3c48d72ec7064e7f0522877fe759c729df0c50 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 25 Mar 2020 11:32:18 -0400
+Subject: [PATCH] Allow using a system provided libgit2 library
+
+Setting the USE_SYSTEM_LIBGIT2 Make or CMake variable (through the
+BUILD_OPTIONS variable) to any value enables using the system library.
+The default behavior of using a bundled copy of libgit2 is unchanged.
+---
+ CMakeLists.txt     |  9 +++++++--
+ Makefile           | 11 +++++++++++
+ src/CMakeLists.txt |  9 +++++++--
+ 3 files changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a393d7c..75d6ca6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,9 +7,14 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "shared" FORCE)
+ set(BUILD_CLAR OFF CACHE BOOL "clar" FORCE)
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DEGIT_DEBUG")
+ 
+-add_subdirectory(libgit2)
++if(USE_SYSTEM_LIBGIT2)
++  find_package(PkgConfig REQUIRED)
++  pkg_check_modules(git2 REQUIRED IMPORTED_TARGET libgit2)
++else()
++  add_subdirectory(libgit2)
++  find_library(git2 libgit2.a)
++endif()
+ 
+-find_library(git2 libgit2.a)
+ add_subdirectory(src)
+ 
+ enable_testing()
+diff --git a/Makefile b/Makefile
+index 8199532..6a6a4e1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -13,6 +13,13 @@ ifeq ($(UNAME),MSYS)
+ 	BUILD_OPTIONS+= -G "MSYS Makefiles"
+ endif
+ 
++# If the variable USE_SYSTEM_LIBGIT2 is set to *any* value, use the
++# system provided libgit2 library.
++USE_SYSTEM_LIBGIT2? := \
++	$(if $(or $(USE_SYSTEM_LIBGIT2),\
++	 	  $(findstring USE_SYSTEM_LIBGIT2,$(BUILD_OPTIONS))),\
++		true)
++
+ ifeq "$(TRAVIS)" "true"
+ ## Makefile for Travis ###################################################
+ #
+@@ -87,7 +94,11 @@ submodule-update:
+ 	@git submodule update
+ 
+ libgit2:
++ifeq ($(USE_SYSTEM_LIBGIT2?),)
+ 	@git submodule update --init
++else
++	@echo "Using the system provided libgit2 library"
++endif
+ 
+ CLEAN  = $(ELCS) $(PKG)-autoloads.el build
+ 
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index cfb5777..0dbad8a 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -13,8 +13,13 @@ if(WIN32)
+   set_target_properties(egit2 PROPERTIES PREFIX lib)
+ endif(WIN32)
+ 
+-target_link_libraries(egit2 git2)
+-target_include_directories(egit2 SYSTEM PRIVATE "${libgit2_SOURCE_DIR}/include")
++if(USE_SYSTEM_LIBGIT2)
++  target_link_libraries(egit2 PRIVATE PkgConfig::git2)
++else()
++  target_link_libraries(egit2 git2)
++  target_include_directories(
++    egit2 SYSTEM PRIVATE "${libgit2_SOURCE_DIR}/include")
++endif()
+ 
+ if(CMAKE_COMPILER_IS_GNUCC)
+   target_compile_options(egit2 PRIVATE -Wall -Wextra)
+-- 
+2.26.2
+
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-emacs-magit-Update-to-commit-d05545e.patch --]
[-- Type: text/x-patch, Size: 14919 bytes --]

From 3e1dda800ce14c185538e6d824c7fe040a91bffd Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Fri, 27 Mar 2020 21:20:03 -0400
Subject: [PATCH 2/5] gnu: emacs-magit: Update to commit d05545e.

* gnu/packages/emacs-xyz.scm (emacs-magit): Update to commit
68b5a13fa1b6b122d4a2547b8c415aadff83d8ca.
[origin]: Remove obsoleted patches and snippets.
[build-system]: Switch to the emacs-build-system.
[arguments]: Remove the #:modules and #:imported-modules arguments.  Enable
tests. Remove the #:make-flags and #:test-target argument.  Specify the
\#:test-command argument.
[phases]{patch}: Remove phase.
{build-info-manual, set-magit-version, configure-git}
{disable-tramp-test}: New phases.
{configure}: Do not delete phase.
{patch-exec-paths}: Adapt file names.
* gnu/packages/patches/emacs-magit-log-format-author-margin.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Unregister it.
---
 gnu/local.mk                                  |   1 -
 gnu/packages/emacs-xyz.scm                    | 144 ++++++++----------
 ...emacs-magit-log-format-author-margin.patch |  72 ---------
 3 files changed, 63 insertions(+), 154 deletions(-)
 delete mode 100644 gnu/packages/patches/emacs-magit-log-format-author-margin.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index d38ac5722d..2d008f0be8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -887,7 +887,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/emacs-json-reformat-fix-tests.patch	\
   %D%/packages/patches/emacs-highlight-stages-add-gexp.patch	\
   %D%/packages/patches/emacs-libgit-use-system-libgit2.patch    \
-  %D%/packages/patches/emacs-magit-log-format-author-margin.patch	\
   %D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch	\
   %D%/packages/patches/emacs-source-date-epoch.patch		\
   %D%/packages/patches/emacs-telega-test-env.patch		\
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 866f19c1fd..93c7686174 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -391,12 +391,11 @@ libgit2 bindings for Emacs, intended to boost the performance of Magit.")
       (license license:gpl3+))))
 
 (define-public emacs-magit
-  ;; `magit-setup-buffer' macro introduced in c761d28d and required in
-  ;; `emacs-forge'.
-  (let ((commit "c761d28d49e5238037512b898db0ec9b40d85770"))
+  ;; There hasn't been an official release since 2018-11-16.
+  (let ((commit "d05545ec2fd7edf915eaf1b9c15c785bb08975cc"))
     (package
       (name "emacs-magit")
-      (version (git-version "2.90.1" "3" commit))
+      (version (git-version "2.90.1" "4" commit))
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
@@ -405,93 +404,76 @@ libgit2 bindings for Emacs, intended to boost the performance of Magit.")
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
-                  "16qx0404l05q1m6w7y5j8ck1z5nfmpinm00w0p2yh1hn5zzwy6dd"))
-                ;; FIXME: emacs-forge uses a function defined in this patch,
-                ;; which is newer than the current commit.
-                (patches
-                 (search-patches
-                  "emacs-magit-log-format-author-margin.patch"))
-                (modules '((guix build utils)))
-                (snippet
-                 '(begin
-                    ;; Fix syntax error
-                    (substitute* "lisp/magit-extras.el"
-                      (("rev\\)\\)\\)\\)\\)\\)") "rev)))))"))
-                    #t))))
-      (build-system gnu-build-system)
-      (native-inputs `(("texinfo" ,texinfo)
-                       ("emacs" ,emacs-minimal)))
-      (inputs
-       `(("git" ,git)
-         ("perl" ,perl)))
-      (propagated-inputs
-       `(("dash" ,emacs-dash)
-         ("with-editor" ,emacs-with-editor)
-         ("transient" ,emacs-transient)))
+                  "11aqyy4r9hrdi9nlypd70hn8384b6q89c7xavgv8c5q7f2g5z9qg"))))
+      (build-system emacs-build-system)
       (arguments
-       `(#:modules ((guix build gnu-build-system)
-                    (guix build utils)
-                    (guix build emacs-utils))
-         #:imported-modules (,@%gnu-build-system-modules
-                             (guix build emacs-utils))
-         #:test-target "test"
-         #:tests? #f                   ; tests are not included in the release
-         #:make-flags
-         (list (string-append "PREFIX=" %output)
-               ;; Don't put .el files in a sub-directory.
-               (string-append "lispdir=" %output "/share/emacs/site-lisp"))
+       `(#:emacs ,emacs-no-x            ;module support is required
+         #:tests? #t
+         #:test-command '("make" "test")
          #:phases
          (modify-phases %standard-phases
-           (add-after 'unpack 'patch
+           (add-after 'unpack 'build-info-manual
              (lambda _
-               (chmod "lisp/magit-extras.el" #o644)
-               (emacs-batch-edit-file "lisp/magit-extras.el"
-                 `(progn (progn
-                          (goto-char (point-min))
-                          (re-search-forward "(defun magit-copy-buffer-revision ()")
-                          (forward-sexp 2)
-                          (kill-sexp)
-                          (insert ,(format #f "~S"
-                                           '(if (use-region-p)
-                                                (copy-region-as-kill nil nil 'region)
-                                                (when-let ((rev (cl-case major-mode
-                                                                         ((magit-cherry-mode
-                                                                           magit-log-select-mode
-                                                                           magit-reflog-mode
-                                                                           magit-refs-mode
-                                                                           magit-revision-mode
-                                                                           magit-stash-mode
-                                                                           magit-stashes-mode)
-                                                                          (car magit-refresh-args))
-                                                                         ((magit-diff-mode magit-log-mode)
-                                                                          (let ((r (caar magit-refresh-args)))
-                                                                            (if (string-match "\\.\\.\\.?\\(.+\\)" r)
-                                                                                (match-string 1 r)
-                                                                                r)))
-                                                                         (magit-status-mode "HEAD"))))
-                                                          (when (magit-commit-p rev)
-                                                            (setq rev (magit-rev-parse rev))
-                                                            (push (list rev default-directory) magit-revision-stack)
-                                                            (kill-new (message "%s" rev))))))))
-                         (basic-save-buffer)))
+               (invoke "make" "info")
+               ;; Copy info files to the lisp directory, which acts as
+               ;; the root of the project for the emacs-build-system.
+               (for-each (lambda (f)
+                           (install-file f "lisp"))
+                         (find-files "Documentation" "\\.info$"))
+               (chdir "lisp")
                #t))
-           (delete 'configure)
-           (add-before
-               'build 'patch-exec-paths
+           (add-after 'build-info-manual 'set-magit-version
+             (lambda _
+               (make-file-writable "magit.el")
+               (emacs-substitute-variables "magit.el"
+                 ("magit-version" ,version))
+               #t))
+           (add-after 'set-magit-version 'patch-exec-paths
              (lambda* (#:key inputs #:allow-other-keys)
                (let ((perl (assoc-ref inputs "perl")))
-                 (make-file-writable "lisp/magit-sequence.el")
-                 (emacs-substitute-variables "lisp/magit-sequence.el"
+                 (make-file-writable "magit-sequence.el")
+                 (emacs-substitute-variables "magit-sequence.el"
                    ("magit-perl-executable" (string-append perl "/bin/perl")))
-                 #t))))))
+                 #t)))
+           (add-before 'check 'configure-git
+             (lambda _
+               ;; Otherwise some tests fail with error "unable to auto-detect
+               ;; email address".
+               (setenv "HOME" (getcwd))
+               (invoke "git" "config" "--global" "user.name" "toto")
+               (invoke "git" "config" "--global" "user.email"
+                       "toto@toto.com")))
+           (add-after 'configure-git 'disable-tramp-test
+             (lambda _
+               ;; There is an issue causing TRAMP to fail in the build
+               ;; environment.  Setting the tramp-remote-shell parameter of
+               ;; the sudo-method to the file name of the shell didn't help.
+               (chdir "..")
+               (substitute* "t/magit-tests.el"
+                 (("^\\(ert-deftest magit-toplevel:tramp.*" all)
+                  (string-append all "  (skip-unless nil)")))
+               #t))
+           (add-before 'install 'enter-lisp-directory
+             (lambda _
+               (chdir "lisp")
+               #t)))))
+      (native-inputs
+       `(("texinfo" ,texinfo)))
+      (inputs
+       `(("git" ,git)
+         ("perl" ,perl)))
+      (propagated-inputs
+       `(("emacs-dash" ,emacs-dash)
+         ("emacs-libgit" ,emacs-libgit)
+         ("emacs-transient" ,emacs-transient)
+         ("emacs-with-editor" ,emacs-with-editor)))
       (home-page "https://magit.vc/")
       (synopsis "Emacs interface for the Git version control system")
-      (description
-       "With Magit, you can inspect and modify your Git repositories with Emacs.
-You can review and commit the changes you have made to the tracked files, for
-example, and you can browse the history of past changes.  There is support for
-cherry picking, reverting, merging, rebasing, and other common Git
-operations.")
+      (description "With Magit, you can inspect and modify your Git
+repositories with Emacs.  You can review and commit the changes you have made
+to the tracked files, for example, and you can browse the history of past
+changes.  There is support for cherry picking, reverting, merging, rebasing,
+and other common Git operations.")
       (license license:gpl3+))))
 
 (define-public emacs-magit-svn
diff --git a/gnu/packages/patches/emacs-magit-log-format-author-margin.patch b/gnu/packages/patches/emacs-magit-log-format-author-margin.patch
deleted file mode 100644
index fc52157a32..0000000000
--- a/gnu/packages/patches/emacs-magit-log-format-author-margin.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 94914ca4690c0cff12d600a0c8ba6bfb3fb38dc5 Mon Sep 17 00:00:00 2001
-From: Jonas Bernoulli <jonas@bernoul.li>
-Date: Tue, 25 Jun 2019 21:44:32 +0200
-Subject: [PATCH] magit-log-format-author-margin: New function
-
-Split it from `magit-log-format-margin'.
----
- lisp/magit-log.el | 48 +++++++++++++++++++++++++----------------------
- 1 file changed, 26 insertions(+), 22 deletions(-)
-
-diff --git a/lisp/magit-log.el b/lisp/magit-log.el
-index c8e6ef63..c0a79b19 100644
---- a/lisp/magit-log.el
-+++ b/lisp/magit-log.el
-@@ -1374,28 +1374,32 @@ The shortstat style is experimental and rather slow."
-   (when-let ((option (magit-margin-option)))
-     (if magit-log-margin-show-shortstat
-         (magit-log-format-shortstat-margin rev)
--      (pcase-let ((`(,_ ,style ,width ,details ,details-width)
--                   (or magit-buffer-margin
--                       (symbol-value option))))
--        (magit-make-margin-overlay
--         (concat (and details
--                      (concat (propertize (truncate-string-to-width
--                                           (or author "")
--                                           details-width
--                                           nil ?\s (make-string 1 magit-ellipsis))
--                                          'face 'magit-log-author)
--                              " "))
--                 (propertize
--                  (if (stringp style)
--                      (format-time-string
--                       style
--                       (seconds-to-time (string-to-number date)))
--                    (pcase-let* ((abbr (eq style 'age-abbreviated))
--                                 (`(,cnt ,unit) (magit--age date abbr)))
--                      (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is")
--                                      (- width (if details (1+ details-width) 0)))
--                              cnt unit)))
--                  'face 'magit-log-date)))))))
-+      (magit-log-format-author-margin author date))))
-+
-+(defun magit-log-format-author-margin (author date &optional previous-line)
-+  (pcase-let ((`(,_ ,style ,width ,details ,details-width)
-+               (or magit-buffer-margin
-+                   (symbol-value option))))
-+    (magit-make-margin-overlay
-+     (concat (and details
-+                  (concat (propertize (truncate-string-to-width
-+                                       (or author "")
-+                                       details-width
-+                                       nil ?\s (make-string 1 magit-ellipsis))
-+                                      'face 'magit-log-author)
-+                          " "))
-+             (propertize
-+              (if (stringp style)
-+                  (format-time-string
-+                   style
-+                   (seconds-to-time (string-to-number date)))
-+                (pcase-let* ((abbr (eq style 'age-abbreviated))
-+                             (`(,cnt ,unit) (magit--age date abbr)))
-+                  (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is")
-+                                  (- width (if details (1+ details-width) 0)))
-+                          cnt unit)))
-+              'face 'magit-log-date))
-+     previous-line)))
- 
- (defun magit-log-format-shortstat-margin (rev)
-   (magit-make-margin-overlay
--- 
-2.23.0
-
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.4: 0003-gnu-emacs-evil-magit-Update-to-commit-253c644.patch --]
[-- Type: text/x-patch, Size: 1564 bytes --]

From 84710de8f80d33363b1f570e33ea2c0fc6d147d4 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Tue, 19 May 2020 11:09:16 -0400
Subject: [PATCH 3/5] gnu: emacs-evil-magit: Update to commit 253c644.

This resolves tests failures that appeared with the update to emacs-magit.

* gnu/packages/emacs-xyz.scm (emacs-evil-magit): Update to commit 253c644.
---
 gnu/packages/emacs-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 93c7686174..c34d8b7914 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -16082,8 +16082,8 @@ Org-mode file, and citations of Zotero items in Pandoc Markdown files.")
     (license license:gpl3+)))
 
 (define-public emacs-evil-magit
-  (let ((commit "4b66a1db8285457147a5436f209391016a819ea1")
-        (revision "3"))
+  (let ((commit "253c644807013fe92429acdef418748794b8f254")
+        (revision "4"))
     (package
       (name "emacs-evil-magit")
       (version (git-version "0.4.2" revision commit))
@@ -16096,7 +16096,7 @@ Org-mode file, and citations of Zotero items in Pandoc Markdown files.")
          (file-name (git-file-name name version))
          (sha256
           (base32
-           "0kkmbswfh34k3amfl3v140vsnz1gq4n4mg9g4khjd9yjph3zms4h"))))
+           "08mh7phxsdb9w4dfs0pmr4l4fdzzr2rm88z2s8karfi5j5ik2ag5"))))
       (build-system emacs-build-system)
       (propagated-inputs
        `(("emacs-evil" ,emacs-evil)
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.5: 0004-gnu-emacs-transient-Update-to-commit-a6e4cced.patch --]
[-- Type: text/x-patch, Size: 4799 bytes --]

From bc2c5ddcb97e10291fe59bcf7c525389102af28a Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Tue, 24 Mar 2020 21:43:55 -0400
Subject: [PATCH 4/5] gnu: emacs-transient: Update to commit a6e4cced.

This is necessary to build a recent version of emacs-forge.

* gnu/packages/emacs-xyz.scm (emacs-transient): Update to commit a6e4cced.
[build-system]: Switch to the emacs-build-system.
[arguments]: Remove the #:modules, #:imported-modules and #:make-flags
arguments.
[phases]{configure}: Do not delete.
{install}: Do not replace.
{build-info-manual}: New phase.
{enter-lisp-directory}: New phase.
[native-inputs]: Remove emacs-minimal, which is implicitly provided by the
emacs-build-system.
---
 gnu/packages/emacs-xyz.scm | 56 ++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index c34d8b7914..5be5c097e3 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -19222,11 +19222,11 @@ as Emacs Lisp.")
       (license license:gpl3+))))
 
 (define-public emacs-transient
-  ;; 0.1.0 depends on lv.el but not later versions.
-  (let ((commit "7e45a57ec81185631fe763733f64c99021df2a06"))
+  (let ((revision "1")
+        (commit "a6e4cced303b3febd59412b24a97eaf1e855e6d7"))
     (package
       (name "emacs-transient")
-      (version (git-version "0.1.0" "1" commit))
+      (version (git-version "0.2.0" revision commit))
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
@@ -19235,41 +19235,33 @@ as Emacs Lisp.")
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
-                  "0r6d4c1lga3bk0s7q7y4v4hbpxnd9h40cjxybqvax2z902931fz1"))))
-      (build-system gnu-build-system)
-      (native-inputs `(("texinfo" ,texinfo)
-                       ("emacs" ,emacs-minimal)))
-      (propagated-inputs
-       `(("dash" ,emacs-dash)))
+                  "01xsw9sxr50valc2q590ngy3ra2ll01p39l9cbzvqqz6mxyymxmd"))))
+      (build-system emacs-build-system)
       (arguments
-       `(#:modules ((guix build gnu-build-system)
-                    (guix build utils)
-                    (srfi srfi-26)
-                    (guix build emacs-utils))
-         #:imported-modules (,@%gnu-build-system-modules
-                             (guix build emacs-utils))
-         #:tests? #f                   ; tests are not included in the release
-         #:make-flags (list "lisp" "info")
+       `(#:tests? #f                      ;no test suite
          #:phases
          (modify-phases %standard-phases
-           (delete 'configure)
-           (replace 'install
-             (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let* ((out (assoc-ref outputs "out"))
-                      (lisp (string-append out "/share/emacs/site-lisp"))
-                      (info (string-append out "/share/info")))
-                 (for-each (cut install-file <> lisp)
-                           (find-files "." "\\.elc*$"))
-                 (install-file "docs/transient.info" (string-append info)))
+           (add-after 'unpack 'build-info-manual
+             (lambda _
+               (invoke "make" "info")
+               ;; Move the info file to lisp so that it gets installed by the
+               ;; emacs-build-system.
+               (rename-file "docs/transient.info" "lisp/transient.info")))
+           (add-after 'build-info-manual 'enter-lisp-directory
+             (lambda _
+               (chdir "lisp")
                #t)))))
+      (native-inputs
+       `(("texinfo" ,texinfo)))
+      (propagated-inputs
+       `(("dash" ,emacs-dash)))
       (home-page "https://magit.vc/manual/transient")
       (synopsis "Transient commands in Emacs")
-      (description
-       "Taking inspiration from prefix keys and prefix arguments in Emacs,
-Transient implements a similar abstraction involving a prefix command, infix
-arguments and suffix commands.  We could call this abstraction a \"transient
-command\", but because it always involves at least two commands (a prefix and
-a suffix) we prefer to call it just a \"transient\".")
+      (description "Taking inspiration from prefix keys and prefix arguments
+in Emacs, Transient implements a similar abstraction involving a prefix
+command, infix arguments and suffix commands.  We could call this abstraction
+a \"transient command\", but because it always involves at least two
+commands (a prefix and a suffix) we prefer to call it just a \"transient\".")
       (license license:gpl3+))))
 
 (define-public emacs-forge
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.6: 0005-gnu-emacs-forge-Update-to-commit-09bf8ad.patch --]
[-- Type: text/x-patch, Size: 1804 bytes --]

From 0dc89992266fcfcd3ebd93f2a7f2e16eaa14e388 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Tue, 19 May 2020 11:55:17 -0400
Subject: [PATCH 5/5] gnu: emacs-forge: Update to commit 09bf8ad.

* gnu/packages/emacs-xyz.scm (emacs-forge): Update to 09bf8ad.
[native-inputs]: Remove emacs-minimal, which is implicitly provided by the
emacs-build-system.
---
 gnu/packages/emacs-xyz.scm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 5be5c097e3..733b8ca7af 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -19265,10 +19265,10 @@ commands (a prefix and a suffix) we prefer to call it just a \"transient\".")
       (license license:gpl3+))))
 
 (define-public emacs-forge
-  (let ((commit "63cbf81f166fc71861d8e3d246df8e5ccedcb9bb"))
+  (let ((commit "09bf8adc9c9afb492632e612f51f39e1cc15fca0"))
     (package
       (name "emacs-forge")
-      (version (git-version "0.1.0" "3" commit))
+      (version (git-version "0.1.0" "4" commit))
       (source
        (origin
          (method git-fetch)
@@ -19278,11 +19278,10 @@ commands (a prefix and a suffix) we prefer to call it just a \"transient\".")
          (file-name (git-file-name name version))
          (sha256
           (base32
-           "1yf2xjx3459py6rji740jm8bmh2pv66ghnbjxsvjd4jf9kcdav83"))))
+           "148h1rvmfmxyrfy2q5l0vzblr7lpsyw1si30hfwhzsj8fvj21qcr"))))
       (build-system emacs-build-system)
       (native-inputs
-       `(("texinfo" ,texinfo)
-         ("emacs" ,emacs-minimal)))
+       `(("texinfo" ,texinfo)))
       (propagated-inputs
        `(("emacs-closql" ,emacs-closql)
          ("emacs-dash" ,emacs-dash)
-- 
2.26.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#41405] [PATCH] Update emacs-magit to latest commit.
  2020-05-19 17:26 [bug#41405] [PATCH] Update emacs-magit to latest commit Maxim Cournoyer
@ 2020-05-26 21:53 ` Nicolas Goaziou
  2020-05-27 17:49   ` bug#41405: " Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2020-05-26 21:53 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 41405

Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> This updates our emacs-magit package to the latest version, which
> has the following benefits:
>
> 1) The test suite is now enabled.
> 2) The libgit2 C library is now accelerating some of the Magit tasks
> 3) Using the emacs-build-system means the Magit autoload file is
> now byte compiled.
> 4) No custom patching is done.
>
> The other updates were required to prevent breaking some of the packages
> which had a dependency on emacs-magit.

LGTM!

Regards,

-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#41405: [PATCH] Update emacs-magit to latest commit.
  2020-05-26 21:53 ` Nicolas Goaziou
@ 2020-05-27 17:49   ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2020-05-27 17:49 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 41405-done

Hi,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> This updates our emacs-magit package to the latest version, which
>> has the following benefits:
>>
>> 1) The test suite is now enabled.
>> 2) The libgit2 C library is now accelerating some of the Magit tasks
>> 3) Using the emacs-build-system means the Magit autoload file is
>> now byte compiled.
>> 4) No custom patching is done.
>>
>> The other updates were required to prevent breaking some of the packages
>> which had a dependency on emacs-magit.
>
> LGTM!

Thanks for the review!  I pushed the series to master with commit
ffd2696bd8c898cb69b8b443db5584d84986d419.

Maxim




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-27 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 17:26 [bug#41405] [PATCH] Update emacs-magit to latest commit Maxim Cournoyer
2020-05-26 21:53 ` Nicolas Goaziou
2020-05-27 17:49   ` bug#41405: " Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).