* [bug#67021] [PATCH] gnu: ruby: Fix cross-compilation.
@ 2023-11-09 17:37 Zheng Junjie
2023-11-12 14:34 ` bug#67021: " Christopher Baines
0 siblings, 1 reply; 2+ messages in thread
From: Zheng Junjie @ 2023-11-09 17:37 UTC (permalink / raw)
To: 67021; +Cc: Christopher Baines
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2843 bytes --]
* 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@gorski.stream>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023 Zheng Junjie <873216071@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#67021: [PATCH] gnu: ruby: Fix cross-compilation.
2023-11-09 17:37 [bug#67021] [PATCH] gnu: ruby: Fix cross-compilation Zheng Junjie
@ 2023-11-12 14:34 ` Christopher Baines
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Baines @ 2023-11-12 14:34 UTC (permalink / raw)
To: Zheng Junjie; +Cc: 67021-done, guix-patches
[-- Attachment #1: Type: text/plain, Size: 602 bytes --]
Zheng Junjie <zhengjunjie@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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-12 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 17:37 [bug#67021] [PATCH] gnu: ruby: Fix cross-compilation Zheng Junjie
2023-11-12 14:34 ` bug#67021: " Christopher Baines
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.