summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorBen Woodcroft <donttrustben@gmail.com>2018-02-05 11:47:04 +0100
committerChristopher Baines <mail@cbaines.net>2018-12-31 09:46:23 +0000
commitdaf868b1fa6b036703d133576b6240ce8aed6ae9 (patch)
tree88b2edd0b7b94b7c07add1c5fef410f0010afc41 /gnu
parent6e40aa592c76a1d067a38d4e544284408719b67d (diff)
downloadgnu-guix-daf868b1fa6b036703d133576b6240ce8aed6ae9.tar
gnu-guix-daf868b1fa6b036703d133576b6240ce8aed6ae9.tar.gz
gnu: Improve ruby-parallel.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ruby.scm64
1 files changed, 53 insertions, 11 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 04dcd0f567..89bc343096 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -33,11 +33,14 @@
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
+ #:use-module (gnu packages rails)
#:use-module (gnu packages readline)
#:use-module (gnu packages autotools)
#:use-module (gnu packages java)
#:use-module (gnu packages libffi)
#:use-module (gnu packages libidn)
+ #:use-module (gnu packages linux)
+ #:use-module (gnu packages lsof)
#:use-module (gnu packages maths)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages networking)
@@ -6563,19 +6566,58 @@ interface. It allows Jekyll to rebuild your site when a file changes.")
(package
(name "ruby-parallel")
(version "1.12.1")
- (source (origin
- (method url-fetch)
- (uri (rubygems-uri "parallel" version))
- (sha256
- (base32
- "01hj8v1qnyl5ndrs33g8ld8ibk0rbcqdpkpznr04gkbxd11pqn67"))))
+ (source
+ (origin
+ (method url-fetch)
+ ;; fetch from github as rubygem does not contain tests
+ (uri (string-append "https://github.com/grosser/parallel/archive/v"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0jpibyj9xzihllq02vg48gc7w3xklp5srx52ddcfg165mkx6xpwp"))))
(build-system ruby-build-system)
- (arguments `(#:tests? #f)); No rakefile
+ (arguments
+ `(;; TODO 3 test failures
+ ;; rspec ./spec/parallel_spec.rb:190 # Parallel.in_processes does not open unnecessary pipes
+ ;; rspec './spec/parallel_spec.rb[1:9:7]' # Parallel.each works with SQLite in processes
+ ;; rspec './spec/parallel_spec.rb[1:9:16]' # Parallel.each works with SQLite in threads
+ #:tests? #f
+ #:test-target "rspec-rerun:spec"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-Gemfile
+ (lambda _
+ (substitute* "Gemfile"
+ (("gem 'rspec-legacy_formatters'") "")
+ (("gem 'activerecord.*$") "gem 'activerecord'\n"))))
+ (add-before 'check 'delete-Gemfile.lock
+ (lambda _
+ ;; Bundler isn't being used for fetching dependendencies, so
+ ;; delete the Gemfile.lock
+ (delete-file "Gemfile.lock")
+ #t))
+ (add-before 'build 'patch-gemspec
+ (lambda _
+ (substitute* "parallel.gemspec"
+ (("git ls-files") "find"))
+ #t)))))
+ (native-inputs
+ `(("ruby-rspec" ,ruby-rspec)
+ ("ruby-rspec-rerun" ,ruby-rspec-rerun)
+ ("bundler" ,bundler)
+ ("ruby-activerecord" ,ruby-activerecord)
+ ("ruby-ruby-progressbar" ,ruby-ruby-progressbar)
+ ("ruby-bump" ,ruby-bump)
+ ("procps" ,procps)
+ ("lsof" ,lsof)
+ ("ruby-mysql2" ,ruby-mysql2)
+ ("ruby-sqlite3" ,ruby-sqlite3)
+ ("ruby-i18n" ,ruby-i18n)))
+ (synopsis "Run Ruby code in parallel processes")
+ (description
+ "Run any kind of code in parallel processes")
(home-page "https://github.com/grosser/parallel")
- (synopsis "Parallel processing in Ruby")
- (description "Parallel allows you to run any code in parallel Processes
-(to use all CPUs) or Threads(to speedup blocking operations). It is best
-suited for map-reduce or e.g. parallel downloads/uploads.")
(license license:expat)))
(define-public ruby-cane