guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCHES] Add ruby-nokogiri, ruby-mini-portile, and ruby-minitar


From: David Thompson
Subject: [PATCHES] Add ruby-nokogiri, ruby-mini-portile, and ruby-minitar
Date: Sat, 29 Aug 2015 08:57:38 -0400
User-agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu)

This small patch set adds a few more Ruby libraries to our arsenal, the
most important being Nokogiri: A widely used XML parsing library with
native C extensions.  The official Ruby packaging system cannot capture
non-Ruby dependencies outside of developers bundling them in their
source releases, so the ruby-nokogiri package is a great example of how
Guix improves upon language-specific package managers.  As a user of
Nokogiri, it's nice to be able to run:

    guix environment --ad-hoc ruby ruby-nokogiri -E irb

And get a Ruby REPL with Nokogiri without having to manually install
libxml2, libxslt, and the GCC toolchain from the system package manager
and hoped that things were ABI compatible when 'gem install nokogiri'
compiled the extension.

Thanks to Pjotr for writing the initial version of the Nokogiri package
and being patient for the couple of months it took me to get it reviewed
and updated for the new Ruby build system.

Patches below:

>From c043d79f1b66c90b20652632880d67d8fcc5275e Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
Date: Sat, 29 Aug 2015 08:32:32 -0400
Subject: [PATCH 1/3] gnu: Add ruby-minitar.

* gnu/packages/ruby.scm (ruby-minitar): New variable.
---
 gnu/packages/ruby.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 9a702dd..4afc0bc 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -628,3 +628,24 @@ net/http library.")
     (description "Arel is a SQL AST manager for Ruby.  It simplifies the
 generation of complex SQL queries and is compatible with various RDBMSes.")
     (license license:expat)))
+
+(define-public ruby-minitar
+  (package
+    (name "ruby-minitar")
+    (version "0.5.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "minitar" version))
+       (sha256
+        (base32
+         "1vpdjfmdq1yc4i620frfp9af02ia435dnpj8ybsd7dc3rypkvbka"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(#:tests? #f)) ; missing a gemspec
+    (synopsis "Ruby library and utility for handling tar archives")
+    (description
+     "Archive::Tar::Minitar is a pure-Ruby library and command-line utility
+that provides the ability to deal with POSIX tar archive files.")
+    (home-page "http://www.github.com/atoulme/minitar";)
+    (license (list license:gpl2+ license:ruby))))
-- 
2.5.0

>From bd6a2e115585064e2978adfa7860c253ebb68834 Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
Date: Sat, 29 Aug 2015 08:32:56 -0400
Subject: [PATCH 2/3] gnu: Add ruby-mini-portile.

* gnu/packages/ruby.scm (ruby-mini-portile): New variable.
---
 gnu/packages/ruby.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 4afc0bc..9e006d6 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -649,3 +649,26 @@ generation of complex SQL queries and is compatible with 
various RDBMSes.")
 that provides the ability to deal with POSIX tar archive files.")
     (home-page "http://www.github.com/atoulme/minitar";)
     (license (list license:gpl2+ license:ruby))))
+
+(define-public ruby-mini-portile
+  (package
+    (name "ruby-mini-portile")
+    (version "0.6.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "mini_portile" version))
+       (sha256
+        (base32
+         "0h3xinmacscrnkczq44s6pnhrp4nqma7k056x5wv5xixvf2wsq2w"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(#:tests? #f)) ; tests require network access
+    (synopsis "Simplistic port-like solution for developers. It provides a
+standard and simplified way to compile against dependency libraries without
+messing up your system.")
+    (description "Simplistic port-like solution for developers. It provides a
+standard and simplified way to compile against dependency libraries without
+messing up your system.")
+    (home-page "http://github.com/flavorjones/mini_portile";)
+    (license license:expat)))
-- 
2.5.0

>From 7f4691bad70a716aa6bb0d13f47514f405e8d188 Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
Date: Sat, 29 Aug 2015 08:35:54 -0400
Subject: [PATCH 3/3] gnu: Add ruby-nokogiri.

Co-Authored-By: Pjotr Prins <address@hidden>

* gnu/packages/ruby.scm (ruby-nokogiri): New variable.
---
 gnu/packages/ruby.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 9e006d6..7d5196a 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -34,6 +34,7 @@
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages xml)
   #:use-module (guix build-system ruby))
 
 (define-public ruby
@@ -672,3 +673,37 @@ standard and simplified way to compile against dependency 
libraries without
 messing up your system.")
     (home-page "http://github.com/flavorjones/mini_portile";)
     (license license:expat)))
+
+(define-public ruby-nokogiri
+  (package
+    (name "ruby-nokogiri")
+    (version "1.6.6.2")
+    (source (origin
+              (method url-fetch)
+              (uri (rubygems-uri "nokogiri" version))
+              (sha256
+               (base32
+                "1j4qv32qjh67dcrc1yy1h8sqjnny8siyy4s44awla8d6jk361h30"))))
+    (build-system ruby-build-system)
+    (arguments
+     ;; Tests fail because Nokogiri can only test with an installed extension,
+     ;; and also because many test framework dependencies are missing.
+     '(#:tests? #f
+       #:gem-flags (list "--" "--use-system-libraries"
+                         (string-append "--with-xml2-include="
+                                        (assoc-ref %build-inputs "libxml2")
+                                        "/include/libxml2" ))))
+    (native-inputs
+     `(("ruby-hoe" ,ruby-hoe)
+       ("ruby-rake-compiler", ruby-rake-compiler)))
+    (inputs
+     `(("zlib" ,zlib)
+       ("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)))
+    (propagated-inputs
+     `(("ruby-mini-portile" ,ruby-mini-portile)))
+    (synopsis "HTML, XML, SAX, and Reader parser for Ruby")
+    (description "Nokogiri (鋸) parses and searches XML/HTML, and features
+both CSS3 selector and XPath 1.0 support.")
+    (home-page "http://www.nokogiri.org/";)
+    (license license:expat)))
-- 
2.5.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]