summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-18 00:06:46 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-28 22:22:50 -0400
commit958f1ff68da05205ab54227a55b6b636889379b3 (patch)
tree496ed39e4d8596e447ef307c6835f738534ae1c2 /gnu
parent8b8d8d8fd9bbac8b8137f6816346f28f009ae8af (diff)
downloadguix-958f1ff68da05205ab54227a55b6b636889379b3.tar.gz
gnu: ruby-liquid: Update to 5.4.0 and enable tests.
* 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.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ruby.scm48
1 files changed, 42 insertions, 6 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 657d47ab86..f759def4d9 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -13452,21 +13452,57 @@ external applications from within Ruby programs.")
 (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 @@ Unicode formatted tables.")
            ruby-jekyll-sass-converter
            ruby-jekyll-watch
            ruby-kramdown-parser-gfm
-           ruby-liquid
+           ruby-liquid-4
            ruby-mercenary
            ruby-pathutil
            ruby-rouge