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")