all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
To: 68048@debbugs.gnu.org
Subject: [bug#68048] [PATCH] gnu: cdparanoia: Fix cross-compiling.
Date: Tue, 26 Dec 2023 22:26:45 +0800	[thread overview]
Message-ID: <d36bc5b8d1bc2755c618218450c0dcf33ab54e1e.1703600805.git.zhengjunjie@iscas.ac.cn> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2748 bytes --]

* gnu/packages/cdrom.scm (cdparanoia)
[native-inputs]: when cross compiling to riscv64-linux-gnu, add config.
[arguments]: when target riscv64-linux-gnu, add update-config-scripts phase.
<#:configure-flags>: when cross-compiling, use `(assoc-ref %outputs "out")'.

Change-Id: I442c668c3d52c241f0d405f51ea8d995bfefd3fd
---
 gnu/packages/cdrom.scm | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm
index aaa2e50293..4e858c571f 100644
--- a/gnu/packages/cdrom.scm
+++ b/gnu/packages/cdrom.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
+;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -233,10 +234,33 @@ (define-public cdparanoia
      `(#:tests? #f ; there is no check target
        #:parallel-build? #f             ;randomly fails to link
        #:configure-flags ; Add $libdir to the RUNPATH of all the executables.
-       (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
+       (list (string-append "LDFLAGS=-Wl,-rpath="
+                            ,(if (%current-target-system)
+                                 '(assoc-ref %outputs "out")
+                                 '%output)
+                            "/lib"))
        ;; Building in parallel is flaky: “ld: […]/cachetest.c:393: undefined
        ;; reference to `paranoia_free'”.
-       #:parallel-build? #f))
+       #:parallel-build? #f
+       ,@(if (and (target-riscv64?)
+                  (%current-target-system))
+             '(#:phases
+               (modify-phases %standard-phases
+                 (add-after 'unpack 'update-config-scripts
+                   (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                     ;; Replace outdated config.guess and config.sub.
+                     (for-each (lambda (file)
+                                 (install-file
+                                  (search-input-file
+                                   (or native-inputs inputs)
+                                   (string-append "/bin/" file)) "."))
+                               '("config.guess" "config.sub"))))))
+             '())))
+    (native-inputs
+     (if (and (target-riscv64?)
+              (%current-target-system))
+         (list config)
+         '()))
     (home-page "https://www.xiph.org/paranoia/")
     (synopsis "Audio CD reading utility")
     (description "Cdparanoia retrieves audio tracks from CDDA capable CDROM

base-commit: 0d13d095420861022e68e87ceebd5e037e12a8b3
-- 
2.41.0





             reply	other threads:[~2023-12-26 18:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 14:26 Zheng Junjie [this message]
2023-12-27 20:49 ` [bug#68048] [PATCH] gnu: cdparanoia: Fix cross-compiling Mathieu Othacehe
2023-12-28  2:54 ` [bug#68048] [PATCH v2] " Zheng Junjie
2023-12-28  9:18   ` bug#68048: " Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d36bc5b8d1bc2755c618218450c0dcf33ab54e1e.1703600805.git.zhengjunjie@iscas.ac.cn \
    --to=zhengjunjie@iscas.ac.cn \
    --cc=68048@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.