summary refs log tree commit diff
path: root/gnu/packages/ruby.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-14 22:26:17 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-17 23:01:33 -0400
commitdb9f951b837a95558e98564fdeed1cc2fd37d39b (patch)
treee2132bc7628e68b76ac0a76bfbf37d19c4ed0401 /gnu/packages/ruby.scm
parent97295c2aa4b7c2e9f5952b6e181812d8e34b769f (diff)
downloadguix-db9f951b837a95558e98564fdeed1cc2fd37d39b.tar.gz
gnu: Add ruby-chunky-png.
* gnu/packages/ruby.scm (ruby-chunky-png): New variable.
Diffstat (limited to 'gnu/packages/ruby.scm')
-rw-r--r--gnu/packages/ruby.scm68
1 files changed, 68 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index e38f9afd22..530e5a14f7 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1577,6 +1577,74 @@ to save time in the following ways:
     (home-page "https://github.com/testdouble/standard")
     (license license:expat)))
 
+(define-public ruby-chunky-png
+  ;; There hasn't been a release since 2018/11/21 and there are test failures
+  ;; in that release, so use the latest commit.
+  (let ((revision "1")
+        (commit "143b9cd1412e49edd4f8b661c7cd9b22941f43c0"))
+    (package
+      (name "ruby-chunky-png")
+      (version (git-version "1.3.11" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/wvanbergen/chunky_png.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0wbcgfzymbpmmxsb04arc49a2icki6f2fc6d6sqgg8369mc67g9z"))))
+      (build-system ruby-build-system)
+      (arguments
+       `(#:test-target "spec"
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'disable-bundler
+             (lambda _
+               (substitute* (find-files "." "\\.rb$")
+                 (("require.*bundler/setup.*") ""))
+               #t))
+           (replace 'replace-git-ls-files
+             (lambda _
+               ;; TODO: Remove after the fix of using 'cut' to better mimic the
+               ;; git ls-files output is merged in ruby-build-system.
+               (substitute* "chunky_png.gemspec"
+                 (("`git ls-files`")
+                  "`find . -type f -not -regex '.*\\.gem$' |sort |cut -c3-`"))
+               #t)))))
+      (native-inputs
+       `(("bundler" ,bundler)
+         ("ruby-rspec" ,ruby-rspec)
+         ("ruby-standard" ,ruby-standard)
+         ("ruby-yard" ,ruby-yard)))
+      (synopsis "Ruby library to handle PNG images")
+      (description "ChunkyPNG is a pure Ruby library that can read and write
+Portable Network Graphics (PNG) images without depending on an external image
+library.  It tries to be memory efficient and reasonably fast.  It has
+features such as:
+@itemize
+@item
+Decoding support for any image that the PNG standard allows.  This includes all
+standard color modes, all bit depths, all transparency, and interlacing and
+filtering options.
+@item
+Encoding support for images of all color modes (true color, grayscale, and
+indexed) and transparency for all these color modes.  The best color mode is
+chosen automatically, based on the amount of used colors.
+@item Read/write access to the image's pixels.
+@item Read/write access to all image metadata that is stored in chunks.
+@item
+Memory efficiency: @code{fixnum} are used, i.e. 4 or 8 bytes of memory per
+pixel, depending on the hardware).
+@item
+Performance: ChunkyPNG is reasonably fast for Ruby standards, by only using
+integer math and a highly optimized saving routine.
+@item Interoperability with RMagick.
+@end itemize")
+      (home-page "https://github.com/wvanbergen/chunky_png/wiki")
+      (license license:expat))))
+
 (define-public ruby-ast
   (package
     (name "ruby-ast")