aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Woodcroft <donttrustben@gmail.com>2018-02-05 11:42:19 +0100
committerChristopher Baines <mail@cbaines.net>2018-05-18 10:50:32 +0100
commit613c21bd3191697f3954eba7a79b910bb5164fe5 (patch)
tree4e64c390e95672178e922d0da1d21bc322b7aeb0
parent8716eb84e40ab8657a25f0aee21835793fb484b2 (diff)
downloadguix-613c21bd3191697f3954eba7a79b910bb5164fe5.tar
guix-613c21bd3191697f3954eba7a79b910bb5164fe5.tar.gz
gnu: Add ruby-childprocess.
-rw-r--r--gnu/packages/ruby.scm60
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 189f5f3f63..672e52584e 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -5446,3 +5446,63 @@ percentage, bars of various formats, elapsed time and estimated time remaining.
(home-page
"https://github.com/cucumber/event-bus")
(license license:expat)))
+
+(define-public ruby-childprocess
+ (package
+ (name "ruby-childprocess")
+ (version "0.5.8")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (rubygems-uri "childprocess" version))
+ (sha256
+ (base32
+ "1lv7axi1fhascm9njxh3lx1rbrnsm8wgvib0g7j26v4h1fcphqg0"))))
+ (build-system ruby-build-system)
+ (arguments
+ `(#:tests? #f
+; #:test-target "spec"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'remove-dependency-and-patch-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "spec/spec_helper.rb"
+ ;; cannot require coveralls otherwise there is a dependency cycle
+ ;; childprocess, coveralls, rest-client, webmock, addressable,
+ ;; rspec-its, aruba, childprocess.
+ ((".*coveralls.*") "")
+ ((".*Coveralls.*") "")
+ ;; patch path to /bin/sh
+ (("/bin/sh") (which "sh"))
+ ;; testing
+ (("; sleep") "; puts \"before_sleep\"; sleep; puts \"after_sleep\"")
+ )
+ (substitute* "lib/childprocess/unix/process.rb"
+ (("send_signal 'TERM'") "puts 'terming'; send_signal 'TERM'")
+ (("send_signal 'KILL'") "puts 'killing'; send_signal 'KILL'")
+ (("return true if @exit_code")
+ "puts \"exit_code: #{@exit_code}\"; p self; return true if @exit_code"))
+ ;; sleep POLL_INTERVAL
+ (substitute* "lib/childprocess/abstract_process.rb"
+ (("sleep POLL_INTERVAL")
+ "puts 'sleeping'; sleep POLL_INTERVAL; puts 'awake'")
+ (("unless ok") "puts \"ok was #{ok} and exited? was #{exited?}\"; unless ok"))
+ #t))
+ ;(replace 'check
+ ; ;; for testing for ben only
+ ; (lambda _
+ ; (zero? (system* "rspec" "spec/childprocess_spec.rb" "-e" "kills
+ ; the full process tree"))))
+ )))
+ (propagated-inputs
+ `(("ruby-ffi" ,ruby-ffi)))
+ (native-inputs
+ `(("bundler" ,bundler)
+ ("ruby-rspec" ,ruby-rspec)))
+ (synopsis
+ "This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.")
+ (description
+ "This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.")
+ (home-page
+ "http://github.com/jarib/childprocess")
+ (license license:expat)))