diff options
author | Ben Woodcroft <donttrustben@gmail.com> | 2018-02-05 11:42:19 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-07-16 07:38:07 +0100 |
commit | deb764a8cd36d65a5f7850ef364800e686a7a4b1 (patch) | |
tree | eb47ea08fd86dab52e43f78b7050d8de9875875a | |
parent | e7351b8bac5f217ffa99ff59cd3d4c1b9b4ab9d5 (diff) | |
download | guix-deb764a8cd36d65a5f7850ef364800e686a7a4b1.tar guix-deb764a8cd36d65a5f7850ef364800e686a7a4b1.tar.gz |
gnu: Add ruby-childprocess.
-rw-r--r-- | gnu/packages/ruby.scm | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 92dc659d8e..9aa9569a2d 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -5497,3 +5497,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))) |