unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pjotr Prins <pjotr.public12@thebird.nl>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: [PATCH] gnu: Add ruby-nokogiri
Date: Tue, 14 Jul 2015 11:06:13 +0200	[thread overview]
Message-ID: <20150714090613.GA1523@thebird.nl> (raw)
In-Reply-To: <877fq4i41n.fsf@elephly.net>

Hi Ricardo,

Many thanks for your help and bearing with me. Here the improved
version of the code, would this be OK? I'll repost the patches when
this looks good.

Pj.


diff --git a/gnu/packages/patches/ruby-nokogiri-Rakefile.patch b/gnu/packages/patches/ruby-nokogiri-Rakefile.patch
new file mode 100644
index 0000000..91923eb
--- /dev/null
+++ b/gnu/packages/patches/ruby-nokogiri-Rakefile.patch
@@ -0,0 +1,10 @@
+--- nokogiri-1.6.6.2/Rakefile	2015-01-23 19:22:19.000000000 +0100
++++ /tmp/Rakefile	2015-07-06 10:15:16.153659819 +0200
+@@ -134,7 +134,6 @@
+       # for more details, see:
+       # - https://github.com/sparklemotion/nokogiri/issues/1102
+       # - https://github.com/luislavena/mini_portile/issues/32
+-      ["mini_portile",    "~> 0.6.0"],
+     ]
+   end
+ 
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index bb7d865..987b8c1 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,52 @@ 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 (list (search-patch "ruby-nokogiri-Rakefile.patch")))
+              (sha256
+               (base32
+                "1dpmmxr8azbyvhhmw9hpyk3dds577vsd6c312gh2s7kgjd98nd9j"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(#:tests? #f  ;; test fails because nokogiri can only test with
+                    ;; an installed 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
+         (modify-phases %standard-phases
+           (replace 'build
+                    (lambda _
+                      ;; calling rake gem 2x begets a gem. The first time
+                      ;; only the build-dir is created
+                      (zero? (begin
+                               (system* "rake" "gem")
+                               (system* "rake" "gem"))))))))
+    (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")

  reply	other threads:[~2015-07-14  9:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150714090613.GA1523@thebird.nl \
    --to=pjotr.public12@thebird.nl \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).