diff mbox series

[bug#62196,221/223] gnu: ruby-liquid: Update to 5.4.0 and enable tests.

Message ID 20230320172933.13101-20-maxim.cournoyer@gmail.com
State New
Headers show
Series None | expand

Commit Message

Maxim Cournoyer March 20, 2023, 5:29 p.m. UTC
* gnu/packages/ruby.scm (ruby-liquid): Update to 5.4.0.
[arguments]: Enable tests.  Add #:phases.
[native-inputs]: New field.
(ruby-liquid-4): New variable.
(jekyll) [propagated-inputs]: Replace ruby-liquid with ruby-liquid-4.
---

 gnu/packages/ruby.scm | 48 +++++++++++++++++++++++++++++++++++++------
 1 file changed, 42 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 6968362504..7daacd706e 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -13452,21 +13452,57 @@  (define-public ruby-launchy
 (define-public ruby-liquid
   (package
     (name "ruby-liquid")
-    (version "4.0.3")
+    (version "5.4.0")
     (source (origin
-              (method url-fetch)
-              (uri (rubygems-uri "liquid" version))
+              (method git-fetch)        ;for tests
+              (uri (git-reference
+                    (url "https://github.com/Shopify/liquid")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "0zhg5ha8zy8zw9qr3fl4wgk4r5940n4128xm2pn4shpbzdbsj5by"))))
+                "1qdnvd1f9zs6wyilcgxyh93wis7ikbpimjxfpbkpk2ngr1m2c8la"))))
     (build-system ruby-build-system)
-    (arguments `(#:tests? #f)); No rakefile
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'check)               ;moved after the install phase
+          (add-after 'install 'check
+            (assoc-ref %standard-phases 'check))
+          (add-before 'check 'set-GEM_PATH
+            (lambda _
+              (setenv "GEM_PATH" (string-append
+                                  (getenv "GEM_PATH") ":"
+                                  #$output "/lib/ruby/vendor_ruby"))))
+          (add-before 'check 'delete-problematic-tests
+            (lambda _
+              ;; The following test fails with 'Unknown tag' errors (see:
+              ;; https://github.com/Shopify/liquid/issues/1699).
+              (delete-file "test/integration/tags/inline_comment_test.rb"))))))
+    (native-inputs (list ruby-liquid-c-bootstrap ruby-rspec ruby-stackprof))
     (home-page "https://shopify.github.io/liquid/")
     (synopsis "Template language")
     (description "Liquid is a template language written in Ruby.  It is used
 to load dynamic content on storefronts.")
     (license license:expat)))
 
+(define-public ruby-liquid-4
+  (package
+    (inherit ruby-liquid)
+    (name "ruby-liquid")
+    (version "4.0.4")
+    (source (origin
+              (method git-fetch)        ;for tests
+              (uri (git-reference
+                    (url "https://github.com/Shopify/liquid")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0cr321nd0zkbxirgdfmz37xx7j26zfnicjh585fi20vx60frry83"))))
+    (arguments (list #:tests? #f))))    ;avoid required an older ruby-liquid-c
+
 ;;; This variant is purposefully incomplete, lacking ruby-liquid so that it
 ;;; can be used for ruby-liquid's test suite.
 (define ruby-liquid-c-bootstrap
@@ -13701,7 +13737,7 @@  (define-public jekyll
            ruby-jekyll-sass-converter
            ruby-jekyll-watch
            ruby-kramdown-parser-gfm
-           ruby-liquid
+           ruby-liquid-4
            ruby-mercenary
            ruby-pathutil
            ruby-rouge