Subject: [PATCH 2/2] gnu: ruby: fix unbundling of libffi for inheriting rubies

From: Remco van 't Veer <[email-masked]>
Date: Wed, 24 Aug 2022 17:27:47 +0200

* gnu/packages/ruby.scm (ruby-2.4, ruby-2.5, ruby-3.0, ruby-3.1): Inherit package-source to ensure inclusion of unbundling snippet
---
 gnu/packages/ruby.scm | 77 ++++++++++++++++++++-----------------------
 1 file changed, 36 insertions(+), 41 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ad8ef3d390..e98814da6d 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -187,62 +187,57 @@ (define-public ruby-3.0
   (package
     (inherit ruby-2.7)
     (version "3.0.2")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
-                           (version-major+minor version)
-                           "/ruby-" version ".tar.xz"))
-       (sha256
-        (base32
-         "0h2w2ms4gx2s96v3lzdr3add94bd2qqkhdjzaycmaqhg21rpf3jp"))))))
+    (source (origin
+              (inherit (package-source ruby-2.7))
+              (method url-fetch)
+              (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+                                  (version-major+minor version) "/ruby-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "0h2w2ms4gx2s96v3lzdr3add94bd2qqkhdjzaycmaqhg21rpf3jp"))))))
 
 (define-public ruby-3.1
   (package
     (inherit ruby-2.7)
     (version "3.1.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
-                           (version-major+minor version)
-                           "/ruby-" version ".tar.xz"))
-       (sha256
-        (base32
-         "1akcl7vhmwfm6ybj7493kzy58ykh2r39ri9f4xfm2xmhg1msmvvs"))))))
+    (source (origin
+              (inherit (package-source ruby-2.7))
+              (method url-fetch)
+              (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+                                  (version-major+minor version) "/ruby-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "1akcl7vhmwfm6ybj7493kzy58ykh2r39ri9f4xfm2xmhg1msmvvs"))))))
 
 (define-public ruby-2.5
   (package
     (inherit ruby-2.6)
     (version "2.5.9")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
-                           (version-major+minor version)
-                           "/ruby-" version ".tar.xz"))
-       (sha256
-        (base32
-         "1w2qncacm7h3f3il1whghdabwnv9fvwmz9f1a9vcg32006ljyzx8"))))))
+    (source (origin
+              (inherit (package-source ruby-2.6))
+              (method url-fetch)
+              (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+                                  (version-major+minor version) "/ruby-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "1w2qncacm7h3f3il1whghdabwnv9fvwmz9f1a9vcg32006ljyzx8"))))))
 
 (define-public ruby-2.4
   (package
     (inherit ruby-2.6)
     (version "2.4.10")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
-                           (version-major+minor version)
-                           "/ruby-" version ".tar.xz"))
-       (sha256
-        (base32
-         "1prhqlgik1zmw9lakl6hkriqslspw48pvhxff17h7ns42p8qwrnm"))
-       (modules '((guix build utils)))
-       (snippet `(begin
-                   ;; Remove bundled libffi
-                   (delete-file-recursively "ext/fiddle/libffi-3.2.1")
-                   #t))))))
+    (source (origin
+              (inherit (package-source ruby-2.6))
+              (method url-fetch)
+              (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+                                  (version-major+minor version) "/ruby-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "1prhqlgik1zmw9lakl6hkriqslspw48pvhxff17h7ns42p8qwrnm"))))))
 
 (define-public ruby ruby-2.7)
 
-- 
2.37.2