Subject: [bug#76434] [PATCH core-updates] gnu: ruby-racc: Update to 1.8.1.

From: gemmaro <[email-masked]>
Date: Thu, 20 Feb 2025 16:32:44 +0900

* gnu/packages/ruby.scm (ruby-racc): Update to 1.8.1.
[source]: Use the Git repository for tests.
[arguments]<#:tests>: Remove the disabling of tests.
<#:phases>: Add the compile phase before the build phase to support the
optional native extension for performance improvements.
[native-inputs]: Remove Hoe and add test-unit-ruby-core as a test dependency.

Change-Id: Ifef15fb29b5178a4eea85b524b3c4a5c11b5f2da
---
 gnu/packages/ruby.scm | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 774e0df472..b993293146 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -32,7 +32,7 @@
 ;;; Copyright © 2022-2024 Remco van 't Veer <[email-masked]>
 ;;; Copyright © 2022 Taiju HIGASHI <[email-masked]>
 ;;; Copyright © 2023 Yovan Naumovski <[email-masked]>
-;;; Copyright © 2023, 2024 gemmaro <[email-masked]>
+;;; Copyright © 2023, 2024, 2025 gemmaro <[email-masked]>
 ;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <[email-masked]>
 ;;; Copyright © 2023, 2024 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2023, 2024 Hartmut Goebel <[email-masked]>
@@ -8765,19 +8765,27 @@ (define-public ruby-nokogiri-diff
 (define-public ruby-racc
   (package
     (name "ruby-racc")
-    (version "1.5.2")
+    (version "1.8.1")
     (source
      (origin
-       (method url-fetch)
-       (uri (rubygems-uri "racc" version))
+       (method git-fetch) ;for tests
+       (uri (git-reference
+             (url "https://github.com/ruby/racc")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "178k7r0xn689spviqzhvazzvxfq6fyjldxb3ywjbgipbfi4s8j1g"))))
+         "1sg2mqp6yxdxrn9kbbsxkd6930fxvm4yjl8knsc0wq6fkipnhm8q"))))
     (build-system ruby-build-system)
     (arguments
-     `(#:tests? #f))            ; Fails while parsing test instructions.
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'build 'compile
+            (lambda _
+              (invoke "rake" "compile"))))))
     (native-inputs
-     (list ruby-hoe ruby-rake-compiler))
+     (list ruby-rake-compiler ruby-test-unit-ruby-core))
     (synopsis "LALR(1) parser generator for Ruby")
     (description
      "Racc is a LALR(1) parser generator.  It is written in Ruby itself, and
-- 
2.48.1