GNU bug report logs - #67021
[PATCH] gnu: ruby: Fix cross-compilation.

Previous Next

Package: guix-patches;

Reported by: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>

Date: Thu, 9 Nov 2023 17:40:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.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 67021 in the body.
You can then email your comments to 67021 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 <at> cbaines.net, guix-patches <at> gnu.org:
bug#67021; Package guix-patches. (Thu, 09 Nov 2023 17:40:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zheng Junjie <zhengjunjie <at> iscas.ac.cn>:
New bug report received and forwarded. Copy sent to guix <at> cbaines.net, guix-patches <at> gnu.org. (Thu, 09 Nov 2023 17:40:01 GMT) Full text and rfc822 format available.

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

From: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: ruby: Fix cross-compilation.
Date: Fri, 10 Nov 2023 01:37:10 +0800
* gnu/packages/ruby.scm (ruby-2.6,ruby-2.7): Fix cross-compilation.
[native-inputs]: when cross-compilation, add this-package.
[arguments]<#:configure-flags>: when cross-compilation, add LDFLAGS.

Change-Id: Iba6665ba3b1b3d5b3a9b6830a01f0f3284e35efb
---
 gnu/packages/ruby.scm | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ff6829082c..1490c783fa 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -34,6 +34,7 @@
 ;;; Copyright © 2023 Yovan Naumovski <yovan <at> gorski.stream>
 ;;; Copyright © 2023 gemmaro <gemmaro.dev <at> gmail.com>
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke <at> gnu.org>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -129,7 +130,13 @@ (define-public ruby-2.6
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
-       #:configure-flags '("--enable-shared") ; dynamic linking
+       #:configure-flags
+       ,(if (%current-target-system)
+            '(list (string-append
+                    "LDFLAGS=-Wl,-rpath="
+                    (assoc-ref %outputs "out") "/lib")
+                   "--enable-shared")
+            ''("--enable-shared")) ; dynamic linking
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'replace-bin-sh-and-remove-libffi
@@ -147,6 +154,9 @@ (define-public ruby-2.6
                             "tool/rbinstall.rb")
                (("/bin/sh") (which "sh")))
              #t)))))
+    (native-inputs (if (%current-target-system)
+                       (list this-package)
+                       '()))
     (inputs
      (list readline openssl-1.1 libffi gdbm))
     (propagated-inputs
@@ -177,7 +187,13 @@ (define-public ruby-2.7
          "042xrdk7hsv4072bayz3f8ffqh61i8zlhvck10nfshllq063n877"))))
     (arguments
      `(#:test-target "test"
-       #:configure-flags '("--enable-shared") ; dynamic linking
+       #:configure-flags
+       ,(if (%current-target-system)
+            '(list (string-append
+                    "LDFLAGS=-Wl,-rpath="
+                    (assoc-ref %outputs "out") "/lib")
+                   "--enable-shared")
+            ''("--enable-shared")) ; dynamic linking
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'replace-bin-sh-and-remove-libffi
@@ -204,7 +220,10 @@ (define-public ruby-2.7
                      (delete-file "test/ruby/test_io.rb"))))
                '()))))
     (native-inputs
-     (list autoconf))))
+     (append (if (%current-target-system)
+                 (list this-package)
+                 '())
+             (list autoconf)))))
 
 (define ruby-2.7-fixed
   (package

base-commit: 42bec70a91d2205371c96287bcf565dcc5f5dd74
-- 
2.41.0





Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Sun, 12 Nov 2023 14:38:02 GMT) Full text and rfc822 format available.

Notification sent to Zheng Junjie <zhengjunjie <at> iscas.ac.cn>:
bug acknowledged by developer. (Sun, 12 Nov 2023 14:38:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
Cc: 67021-done <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#67021] [PATCH] gnu: ruby: Fix cross-compilation.
Date: Sun, 12 Nov 2023 14:34:29 +0000
[Message part 1 (text/plain, inline)]
Zheng Junjie <zhengjunjie <at> iscas.ac.cn> writes:

> * gnu/packages/ruby.scm (ruby-2.6,ruby-2.7): Fix cross-compilation.
> [native-inputs]: when cross-compilation, add this-package.
> [arguments]<#:configure-flags>: when cross-compilation, add LDFLAGS.
>
> Change-Id: Iba6665ba3b1b3d5b3a9b6830a01f0f3284e35efb
> ---
>  gnu/packages/ruby.scm | 25 ++++++++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)

Thanks for the patch, I tried building ruby for aarch64 with this change
and it seems to work for me. I've pushed it to master as
e35b7c5386c1bfacf47ed31bac9b503373dd26fc.

Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#67021; Package guix-patches. (Sun, 12 Nov 2023 14:39:02 GMT) Full text and rfc822 format available.

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

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

Previous Next


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