unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add ruby-nokogiri
@ 2015-07-13 13:09 Pjotr Prins
  2015-07-13 13:24 ` Ricardo Wurmus
  0 siblings, 1 reply; 17+ messages in thread
From: Pjotr Prins @ 2015-07-13 13:09 UTC (permalink / raw)
  To: guix-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 889 bytes --]

Sorry, the second mail got sent off too early.

Patch for the Ruby-nokogiri gem, an infamous hard to install piece of
software. Not so hard to add to GNU Guix, though I had to run 'rake
gem' 2x to create the gem (the first time it merely installs the build
directory). The tests are skipped because they currently expect the
gem to be already installed (not only built!).

I documented the process of making the patch here:

  https://github.com/pjotrp/guix-notes/blob/master/RUBYGEMS-Nokogiri.org

David Thompson gave me advice on how to introduce the new 'gem-flags'
key. Though the blame is mine if I got it wrong :)

It is a work in progress - I'll send a sanity patch upstream for
Nokogiri and get testing working. But I thought I'd share this with
you first for comments. Inclusion can be useful to others as the
package does work. It is a critical package for many Ruby gems.

Pj.


[-- Attachment #2: 0001-gnu-Add-ruby-nokogiri.patch --]
[-- Type: text/x-diff, Size: 2711 bytes --]

From e2fd935a659cacde5cb74bef19406f056a262f79 Mon Sep 17 00:00:00 2001
From: pjotrp <pjotr.public01@thebird.nl>
Date: Mon, 13 Jul 2015 14:56:40 +0200
Subject: [PATCH] gnu: Add ruby-nokogiri

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

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index bb7d865..85cb0d4 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
@@ -519,6 +520,45 @@ using Net::HTTP, supporting reconnection and retry according to RFC 2616.")
     (home-page "https://github.com/drbrain/net-http-persistent")
     (license license:expat)))
 
+(define-public ruby-nokogiri
+  (package
+    (name "ruby-nokogiri")
+    (version "1.6.6.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+		    "https://github.com/sparklemotion/nokogiri/archive/v"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+	      (patches (map search-patch
+                            (list "ruby-nokogiri-Rakefile.patch")))
+              (sha256
+               (base32
+                "1dpmmxr8azbyvhhmw9hpyk3dds577vsd6c312gh2s7kgjd98nd9j"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(
+       #:tests? #f  ;; test fails because nokogiri can only test with a built extension (now part of install phase)
+       #:gem-flags (list "--use-system-libraries" (string-append "--with-xml2-include=" (assoc-ref %build-inputs "libxml2") "/include/libxml2" ))
+       #:phases (alist-replace
+                 'build
+                 (lambda _
+		   ;; calling rake gem 2x begets a gem
+		   (system* "rake" "gem")
+		   (zero? (system* "rake" "gem")))
+		  %standard-phases)))
+    (native-inputs
+     `(("ruby-hoe" ,ruby-hoe)
+       ("ruby-rake-compiler", ruby-rake-compiler)))
+    (inputs
+     `(("zlib" ,zlib)
+       ("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)))
+    (synopsis "Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser")
+    (description "Nokogiri parses and searches XML/HTML very quickly, and also has correctly implemented CSS3 selector support as well as XPath 1.0 support.")
+    (home-page "http://www.nokogiri.org/")
+    (license license:x11)))
+
 (define-public ruby-minitest
   (package
     (name "ruby-minitest")
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-03-02 18:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 13:09 [PATCH] gnu: Add ruby-nokogiri Pjotr Prins
2015-07-13 13:24 ` Ricardo Wurmus
2015-07-14  9:06   ` Pjotr Prins
2015-07-14 14:25     ` Ricardo Wurmus
2016-02-17 22:37     ` Pjotr Prins
2016-02-17 23:05       ` Ben Woodcroft
2016-02-18  6:25         ` Foreign packages (formerly Re: [PATCH] gnu: Add ruby-nokogiri) Pjotr Prins
2016-02-21 11:16           ` Ricardo Wurmus
2016-02-21 11:50             ` Ben Woodcroft
2016-02-21 12:05               ` Pjotr Prins
2016-02-21 17:22                 ` Foreign packages and reproducibility " Pjotr Prins
2016-02-21 17:31                   ` Pjotr Prins
2016-02-22 12:51                     ` Pjotr Prins
2016-02-23 18:52                       ` Pjotr Prins
2016-03-02 10:33                         ` Ricardo Wurmus
2016-03-02 18:50                           ` Pjotr Prins
2016-02-21 12:02             ` Foreign packages " Pjotr Prins

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).