summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZheng Junjie <zhengjunjie@iscas.ac.cn>2023-11-10 01:37:10 +0800
committerChristopher Baines <mail@cbaines.net>2023-11-12 14:14:56 +0000
commite35b7c5386c1bfacf47ed31bac9b503373dd26fc (patch)
tree85fcc971559e8eafd890a864b834a2c383cfff8b
parent34d57ba3e3e69ed1f728a5662418a46ca008a4ce (diff)
gnu: ruby: Fix cross-compilation.
* gnu/packages/ruby.scm (ruby-2.6,ruby-2.7): Fix cross-compilation. [native-inputs]: When cross compiling, add this-package. [arguments]<#:configure-flags>: When cross compiling, add LDFLAGS. Change-Id: Iba6665ba3b1b3d5b3a9b6830a01f0f3284e35efb Signed-off-by: Christopher Baines <mail@cbaines.net>
-rw-r--r--gnu/packages/ruby.scm25
1 files changed, 22 insertions, 3 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ff6829082c0..1490c783fa0 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -34,6 +34,7 @@
34;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream> 34;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
35;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com> 35;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
36;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org> 36;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
37;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
37;;; 38;;;
38;;; This file is part of GNU Guix. 39;;; This file is part of GNU Guix.
39;;; 40;;;
@@ -129,7 +130,13 @@
129 (build-system gnu-build-system) 130 (build-system gnu-build-system)
130 (arguments 131 (arguments
131 `(#:test-target "test" 132 `(#:test-target "test"
132 #:configure-flags '("--enable-shared") ; dynamic linking 133 #:configure-flags
134 ,(if (%current-target-system)
135 '(list (string-append
136 "LDFLAGS=-Wl,-rpath="
137 (assoc-ref %outputs "out") "/lib")
138 "--enable-shared")
139 ''("--enable-shared")) ; dynamic linking
133 #:phases 140 #:phases
134 (modify-phases %standard-phases 141 (modify-phases %standard-phases
135 (add-before 'configure 'replace-bin-sh-and-remove-libffi 142 (add-before 'configure 'replace-bin-sh-and-remove-libffi
@@ -147,6 +154,9 @@
147 "tool/rbinstall.rb") 154 "tool/rbinstall.rb")
148 (("/bin/sh") (which "sh"))) 155 (("/bin/sh") (which "sh")))
149 #t))))) 156 #t)))))
157 (native-inputs (if (%current-target-system)
158 (list this-package)
159 '()))
150 (inputs 160 (inputs
151 (list readline openssl-1.1 libffi gdbm)) 161 (list readline openssl-1.1 libffi gdbm))
152 (propagated-inputs 162 (propagated-inputs
@@ -177,7 +187,13 @@ a focus on simplicity and productivity.")
177 "042xrdk7hsv4072bayz3f8ffqh61i8zlhvck10nfshllq063n877")))) 187 "042xrdk7hsv4072bayz3f8ffqh61i8zlhvck10nfshllq063n877"))))
178 (arguments 188 (arguments
179 `(#:test-target "test" 189 `(#:test-target "test"
180 #:configure-flags '("--enable-shared") ; dynamic linking 190 #:configure-flags
191 ,(if (%current-target-system)
192 '(list (string-append
193 "LDFLAGS=-Wl,-rpath="
194 (assoc-ref %outputs "out") "/lib")
195 "--enable-shared")
196 ''("--enable-shared")) ; dynamic linking
181 #:phases 197 #:phases
182 (modify-phases %standard-phases 198 (modify-phases %standard-phases
183 (add-before 'configure 'replace-bin-sh-and-remove-libffi 199 (add-before 'configure 'replace-bin-sh-and-remove-libffi
@@ -204,7 +220,10 @@ a focus on simplicity and productivity.")
204 (delete-file "test/ruby/test_io.rb")))) 220 (delete-file "test/ruby/test_io.rb"))))
205 '())))) 221 '()))))
206 (native-inputs 222 (native-inputs
207 (list autoconf)))) 223 (append (if (%current-target-system)
224 (list this-package)
225 '())
226 (list autoconf)))))
208 227
209(define ruby-2.7-fixed 228(define ruby-2.7-fixed
210 (package 229 (package