[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
18/23: gnu: Add ruby-nokogumbo.
From: |
Ricardo Wurmus |
Subject: |
18/23: gnu: Add ruby-nokogumbo. |
Date: |
Mon, 14 Dec 2015 13:10:57 +0000 |
rekado pushed a commit to branch master
in repository guix.
commit c2c4e5b2ee7d3e9412822e87bd5aaedbfa40f9bd
Author: Ricardo Wurmus <address@hidden>
Date: Wed Nov 25 15:57:37 2015 +0100
gnu: Add ruby-nokogumbo.
* gnu/packages/ruby.scm (ruby-nokogumbo): New variable.
---
gnu/packages/ruby.scm | 64 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index f4c9c0a..d10dc04 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -39,6 +39,7 @@
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (gnu packages xml)
+ #:use-module (gnu packages web)
#:use-module (guix build-system ruby))
(define-public ruby
@@ -2302,6 +2303,69 @@ multibyte strings, internationalization, time zones, and
testing.")
(home-page "https://github.com/rgrove/crass/")
(license license:expat)))
+(define-public ruby-nokogumbo
+ (package
+ (name "ruby-nokogumbo")
+ (version "1.4.6")
+ (source (origin
+ ;; We use the git reference, because there's no Rakefile in the
+ ;; published gem and the tarball on Github is outdated.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rubys/nokogumbo.git")
+ (commit "d56f954d20a")))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "0bnppjy96xiadrsrc9dp8y6wvdwnkfa930n7acrp0mqm4qywl2wl"))))
+ (build-system ruby-build-system)
+ (arguments
+ `(#:modules ((guix build ruby-build-system)
+ (guix build utils)
+ (ice-9 rdelim))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'build-gemspec
+ (lambda _
+ (substitute* "Rakefile"
+ ;; Build Makefile even without a copy of gumbo-parser sources
+ (("'gumbo-parser/src',") "")
+ ;; We don't bundle gumbo-parser sources
+ (("'gumbo-parser/src/\\*',") "")
+ (("'gumbo-parser/visualc/include/\\*',") "")
+ ;; The definition of SOURCES will be cut in gemspec, and
+ ;; "FileList" will be undefined.
+ (("SOURCES \\+ FileList\\[")
+ "['ext/nokogumboc/extconf.rb', 'ext/nokogumboc/nokogumbo.c', "))
+
+ ;; Copy the Rakefile and cut out the gemspec.
+ (copy-file "Rakefile" ".gemspec")
+ (with-atomic-file-replacement ".gemspec"
+ (lambda (in out)
+ (let loop ((line (read-line in 'concat))
+ (skipping? #t))
+ (if (eof-object? line)
+ #t
+ (let ((skip-next? (if skipping?
+ (not (string-prefix? "SPEC ="
line))
+ (string-prefix? "end" line))))
+ (when (or (not skipping?)
+ (and skipping? (not skip-next?)))
+ (format #t "~a" line)
+ (display line out))
+ (loop (read-line in 'concat) skip-next?))))))
+ #t)))))
+ (inputs
+ `(("gumbo-parser" ,gumbo-parser)))
+ (propagated-inputs
+ `(("ruby-nokogiri" ,ruby-nokogiri)))
+ (synopsis "Ruby bindings to the Gumbo HTML5 parser")
+ (description
+ "Nokogumbo allows a Ruby program to invoke the Gumbo HTML5 parser and
+access the result as a Nokogiri parsed document.")
+ (home-page "https://github.com/rubys/nokogumbo/")
+ (license license:asl2.0)))
+
(define-public ruby-ox
(package
(name "ruby-ox")
- 05/23: gnu: Add ruby-pstree., (continued)
- 05/23: gnu: Add ruby-pstree., Ricardo Wurmus, 2015/12/14
- 13/23: gnu: Add ruby-unf-ext., Ricardo Wurmus, 2015/12/14
- 12/23: gnu: Add ruby-netrc., Ricardo Wurmus, 2015/12/14
- 06/23: gnu: Add ruby-utils., Ricardo Wurmus, 2015/12/14
- 07/23: gnu: Add ruby-json-pure., Ricardo Wurmus, 2015/12/14
- 02/23: gnu: Add ruby-gem-hadar., Ricardo Wurmus, 2015/12/14
- 15/23: gnu: Add ruby-nokogiri-diff., Ricardo Wurmus, 2015/12/14
- 09/23: gnu: Add ruby-rb-fsevent., Ricardo Wurmus, 2015/12/14
- 10/23: gnu: ruby-listen: Add rb-fsevent to inputs., Ricardo Wurmus, 2015/12/14
- 17/23: gnu: Add Gumbo Parser., Ricardo Wurmus, 2015/12/14
- 18/23: gnu: Add ruby-nokogumbo.,
Ricardo Wurmus <=
- 14/23: gnu: Add ruby-tdiff., Ricardo Wurmus, 2015/12/14
- 11/23: gnu: Add ruby-guard., Ricardo Wurmus, 2015/12/14
- 16/23: gnu: Add ruby-crass., Ricardo Wurmus, 2015/12/14
- 23/23: gnu: Add ruby-redcloth., Ricardo Wurmus, 2015/12/14
- 19/23: gnu: Add ruby-clap., Ricardo Wurmus, 2015/12/14
- 21/23: gnu: Add ruby-pygmentize., Ricardo Wurmus, 2015/12/14
- 20/23: gnu: Add ruby-cutest., Ricardo Wurmus, 2015/12/14
- 22/23: gnu: Add ruby-sanitize., Ricardo Wurmus, 2015/12/14