summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-09 23:40:21 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-11 14:26:59 -0400
commitfef0564c6fc8b18af0ab0151c70ed8ecc9137da1 (patch)
tree32a64de8b822e6cb4950f8620d7bedd77bc89e90 /gnu
parentb1c79cab1fe626853afc49ecec13de83d2ead0af (diff)
downloadguix-fef0564c6fc8b18af0ab0151c70ed8ecc9137da1.tar.gz
gnu: Add ruby-slim.
* gnu/packages/ruby.scm (ruby-slim): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ruby.scm46
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ce5b71bd42..8377bbf77b 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1048,6 +1048,52 @@ more.")
     (home-page "https://github.com/xwmx/pandoc-ruby")
     (license license:expat)))
 
+(define-public ruby-slim
+  (package
+    (name "ruby-slim")
+    (version "4.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "slim" version))
+       (sha256
+        (base32
+         "0gjx30g84c82qzg32bd7giscvb4206v7mvg56kc839w9wjagn36n"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; See: https://github.com/slim-template/slim/issues/857 and
+         ;; https://github.com/slim-template/slim/issues/858.
+         (add-after 'unpack 'skip-broken-tests
+           (lambda _
+             (substitute* "test/core/test_embedded_engines.rb"
+               (("def test_render_with_markdown")
+                "def skipped_test_render_with_markdown"))
+             (substitute* "test/translator/test_translator.rb"
+               (("raise (\"Missing test for.*)" _ tail)
+                (string-append "print " tail)))
+             #t))
+         ;; See: https://salsa.debian.org/ruby-team/ruby-slim/-/commit/
+         ;; 824862bd99d1675bc699d8fc71ba965a785c1f44.
+         (add-after 'unpack 'prevent-bundler-interference
+           (lambda _
+             (substitute* "Rakefile"
+               (("require 'bundler/setup'") "nil")
+               (("Bundler::GemHelper\\.install_tasks") "nil"))
+             #t)))))
+    (native-inputs
+     `(("ruby-rack-test" ,ruby-rack-test)
+       ("ruby-sinatra" ,ruby-sinatra)))
+    (propagated-inputs
+     `(("ruby-temple" ,ruby-temple)
+       ("ruby-tilt" ,ruby-tilt)))
+    (synopsis "Minimalist template language for Ruby")
+    (description "Slim is a template language for Ruby that aims to reduce the
+syntax to the minimum while remaining clear.")
+    (home-page "http://slim-lang.com/")
+    (license license:expat)))
+
 (define-public ruby-asciidoctor
   (package
   (name "ruby-asciidoctor")