GNU bug report logs - #64304
[PATCH] gnu: a2jmidid: Fix building on riscv64-linux and use gexp.

Previous Next

Package: guix-patches;

Reported by: Z572 <873216071 <at> qq.com>

Date: Mon, 26 Jun 2023 16:58:01 UTC

Severity: normal

Tags: patch

Done: 宋文武 <iyzsong <at> envs.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64304 in the body.
You can then email your comments to 64304 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#64304; Package guix-patches. (Mon, 26 Jun 2023 16:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Z572 <873216071 <at> qq.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 26 Jun 2023 16:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Z572 <873216071 <at> qq.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: a2jmidid: Fix building on riscv64-linux and use gexp.
Date: Tue, 27 Jun 2023 00:56:23 +0800
* gnu/packages/music.scm(a2jmidid)[source]: add patch.
[arguments]: Use gexps.
* gnu/packages/patches/a2jmidid-enable-riscv-build.patch: new file.
* gnu/local.mk: register it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/music.scm                        | 27 ++++++------
 .../patches/a2jmidid-enable-riscv-build.patch | 44 +++++++++++++++++++
 3 files changed, 59 insertions(+), 13 deletions(-)
 create mode 100644 gnu/packages/patches/a2jmidid-enable-riscv-build.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 4566f1b4a4..6833df10db 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -872,6 +872,7 @@ MODULES_NOT_COMPILED +=				\
 
 patchdir = $(guilemoduledir)/%D%/packages/patches
 dist_patch_DATA =						\
+  %D%/packages/patches/a2jmidid-enable-riscv-build.patch	\
   %D%/packages/patches/abcl-fix-build-xml.patch	\
   %D%/packages/patches/ableton-link-system-libraries-debian.patch	\
   %D%/packages/patches/abiword-explictly-cast-bools.patch	\
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 5069e6f0df..9017966f2f 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -54,6 +54,7 @@
 ;;; Copyright © 2023 Antero Mejr <antero <at> mailbox.org>
 ;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus <at> gmail.com>
 ;;; Copyright © 2023 Yovan Naumovski <yovan <at> gorski.stream>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -7014,20 +7015,20 @@ (define-public a2jmidid
                     (commit version)))
               (sha256
                (base32 "1x6rcl3f4nklnx4p5jln9a7fpj9y7agjxs9rw7cccmwnski7pnsq"))
-              (file-name (git-file-name name version))))
+              (file-name (git-file-name name version))
+              ;; https://github.com/jackaudio/a2jmidid/pull/18
+              (patches (search-patches "a2jmidid-enable-riscv-build.patch"))))
     (arguments
-     `(#:tests? #f      ; No tests.
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'wrap-programs
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin/")))
-               (substitute* (string-append bin "a2j")
-                 (("a2j_control") (string-append bin "a2j_control")))
-               (wrap-program (string-append bin "a2j_control")
-                `("PYTHONPATH" prefix (,(getenv "GUIX_PYTHONPATH"))))
-               #t))))))
+     (list #:tests? #f      ; No tests.
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'install 'wrap-programs
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (let ((bin (string-append #$output "/bin/")))
+                     (substitute* (string-append bin "a2j")
+                       (("a2j_control") (string-append bin "a2j_control")))
+                     (wrap-program (string-append bin "a2j_control")
+                       `("PYTHONPATH" prefix (,(getenv "GUIX_PYTHONPATH"))))))))))
     (build-system meson-build-system)
     (inputs
      (list alsa-lib
diff --git a/gnu/packages/patches/a2jmidid-enable-riscv-build.patch b/gnu/packages/patches/a2jmidid-enable-riscv-build.patch
new file mode 100644
index 0000000000..2b9e2ed1c5
--- /dev/null
+++ b/gnu/packages/patches/a2jmidid-enable-riscv-build.patch
@@ -0,0 +1,44 @@
+From 2c3fbef6854743416d95d85b1565dde51668488c Mon Sep 17 00:00:00 2001
+From: Heinrich Schuchardt <heinrich.schuchardt <at> canonical.com>
+Date: Fri, 1 Oct 2021 16:15:29 +0200
+Subject: [PATCH] sigsegv: enable RISC-V build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Avoid build error
+
+../sigsegv.c:104:39: error: ‘mcontext_t’ has no member named ‘gregs’;
+did you mean ‘__gregs’?
+  104 |                 ucontext->uc_mcontext.gregs[i]
+      |                                       ^~~~~
+
+Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt <at> canonical.com>
+---
+ sigsegv.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sigsegv.c b/sigsegv.c
+index fb4456e..6930185 100644
+--- a/sigsegv.c
++++ b/sigsegv.c
+@@ -91,7 +91,9 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr) {
+     a2j_error("info.si_errno = %d", info->si_errno);
+     a2j_error("info.si_code  = %d (%s)", info->si_code, si_codes[info->si_code]);
+     a2j_error("info.si_addr  = %p", info->si_addr);
+-#if !defined(__alpha__) && !defined(__ia64__) && !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && !defined(__sh__) && !defined(__aarch64__)
++#if !defined(__alpha__) && !defined(__ia64__) && \
++    !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && \
++    !defined(__sh__) && !defined(__aarch64__) && !defined(__riscv)
+     for(i = 0; i < NGREG; i++)
+         a2j_error("reg[%02d]       = 0x" REGFORMAT, i,
+ #if defined(__powerpc__) && !defined(__powerpc64__)
+@@ -108,7 +110,7 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr) {
+                 ucontext->uc_mcontext.gregs[i]
+ #endif
+                 );
+-#endif /* alpha, ia64, kFreeBSD, arm, hppa, aarch64 */
++#endif /* alpha, ia64, kFreeBSD, arm, hppa, aarch64, riscv */
+ 
+ #if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
+ # if defined(SIGSEGV_STACK_IA64)

base-commit: 269cfe341f242c2b5f37774cb9b1e17d9aa68e2c
-- 
2.40.1





Reply sent to 宋文武 <iyzsong <at> envs.net>:
You have taken responsibility. (Tue, 19 Mar 2024 11:22:02 GMT) Full text and rfc822 format available.

Notification sent to Z572 <873216071 <at> qq.com>:
bug acknowledged by developer. (Tue, 19 Mar 2024 11:22:02 GMT) Full text and rfc822 format available.

Message #10 received at 64304-done <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: Z572 <873216071 <at> qq.com>
Cc: 64304-done <at> debbugs.gnu.org
Subject: Re: [bug#64304] [PATCH] gnu: a2jmidid: Fix building on
 riscv64-linux and use gexp.
Date: Tue, 19 Mar 2024 19:21:27 +0800
Z572 <873216071 <at> qq.com> writes:


> [arguments]: Use gexps.

Pushed as commit a66a5d55c5.

> * gnu/packages/music.scm(a2jmidid)[source]: add patch.
> * gnu/packages/patches/a2jmidid-enable-riscv-build.patch: new file.
> * gnu/local.mk: register it.

As the patch is trivial, I replace it with 'snippet' as in commit
8dbc9b4658.

Thank you!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 16 Apr 2024 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 23 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.