From 9923d5a40fa3e5950c2291d84b34961af497294e Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 20 Sep 2018 03:23:37 +0200 Subject: gnu: Use INVOKE & return #t from Ruby package phases. * gnu/packages/maths.scm (ruby-asciimath)[arguments]: Return #t from all phases. * gnu/packages/rails.scm (ruby-debug-inspector)[arguments]: Substitute INVOKE for SYSTEM*. * gnu/packages/ruby.scm (ruby-permutation, ruby-blankslate) (ruby-minitest-pretty-diff, ruby-guard, ruby-rb-inotify, ruby-tins) (ruby-gem-hadar, ruby-term-ansicolor, ruby-json-pure) (ruby-activesupport, ruby-redcloth, ruby-netrc, ruby-unf-ext, ruby-yard) (ruby-turn, ruby-sqlite3, ruby-shoulda-context, ruby-shoulda-matchers) (ruby-shoulda, ruby-httpclient, ruby-ansi, ruby-bio-commandeer) (ruby-rubytest, ruby-brass, ruby-qed, ruby-ae, ruby-lemon, ruby-hashery) (ruby-rc4, ruby-concurrent)[arguments]: Likewise. --- gnu/packages/maths.scm | 3 ++- gnu/packages/rails.scm | 14 +++++----- gnu/packages/ruby.scm | 73 +++++++++++++++++++++++++------------------------- 3 files changed, 44 insertions(+), 46 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 704ae9781b..736bac163e 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2084,7 +2084,8 @@ (define-public ruby-asciimath (lambda _ (substitute* "spec/parser_spec.rb" (("\\\\\"") - "\""))))))) + "\"")) + #t))))) (native-inputs `(("bundler" ,bundler) ("ruby-rspec" ,ruby-rspec))) diff --git a/gnu/packages/rails.scm b/gnu/packages/rails.scm index 7f171eaa6e..5348d914cf 100644 --- a/gnu/packages/rails.scm +++ b/gnu/packages/rails.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Matthew Jordan +;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -80,14 +81,11 @@ (define-public ruby-debug-inspector (modify-phases %standard-phases (replace 'check (lambda _ - (and - (zero? (system* "rake" "compile")) - (zero? - (system* - "ruby" "-Ilib" "-e" - (string-append - "require 'debug_inspector'; RubyVM::DebugInspector." - "open{|dc| p dc.backtrace_locations}"))))))))) + (invoke "rake" "compile") + (invoke "ruby" "-Ilib" "-e" + (string-append + "require 'debug_inspector'; RubyVM::DebugInspector." + "open{|dc| p dc.backtrace_locations}"))))))) (synopsis "Ruby wrapper for the MRI 2.0 debug_inspector API") (description "This package provides a Ruby wrapper for the MRI 2.0 debug_inspector diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 99ad125e3c..3673bf2346 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -1114,7 +1114,7 @@ (define-public ruby-permutation #t)) (replace 'check (lambda _ - (zero? (system* "ruby" "-Ilib" "test/test.rb"))))))) + (invoke "ruby" "-Ilib" "test/test.rb")))))) (synopsis "Library to perform operations with sequence permutations") (description "This package provides a Ruby library to perform different operations with permutations of sequences, such as strings and arrays.") @@ -1618,7 +1618,7 @@ (define-public ruby-blankslate `(#:phases (modify-phases %standard-phases (replace 'check - (lambda _ (zero? (system* "rspec" "spec/"))))))) + (lambda _ (invoke "rspec" "spec/")))))) (native-inputs `(("bundler" ,bundler) ("ruby-rspec" ,ruby-rspec))) @@ -2028,7 +2028,7 @@ (define-public ruby-minitest-pretty-diff (modify-phases %standard-phases (replace 'check (lambda _ - (zero? (system* "script/test"))))))) + (invoke "script/test")))))) (native-inputs `(("bundler" ,bundler) ("ruby-turn" ,ruby-turn))) @@ -2603,7 +2603,7 @@ (define-public ruby-guard #t)) (replace 'build (lambda _ - (zero? (system* "gem" "build" "guard.gemspec"))))))) + (invoke "gem" "build" "guard.gemspec")))))) (propagated-inputs `(("ruby-formatador" ,ruby-formatador) ("ruby-listen" ,ruby-listen) @@ -2718,7 +2718,7 @@ (define-public ruby-rb-inotify ;; list of files. (replace 'build (lambda _ - (zero? (system* "gem" "build" "rb-inotify.gemspec"))))))) + (invoke "gem" "build" "rb-inotify.gemspec")))))) (propagated-inputs `(("ruby-ffi" ,ruby-ffi))) (native-inputs @@ -2811,7 +2811,7 @@ (define-public ruby-tins ;; causes an error. (substitute* "tins.gemspec" (("\"lib/spruz\", ") "")) - (zero? (system* "gem" "build" "tins.gemspec"))))))) + (invoke "gem" "build" "tins.gemspec")))))) (synopsis "Assorted tools for Ruby") (description "Tins is a Ruby library providing assorted tools.") (home-page "https://github.com/flori/tins") @@ -2836,7 +2836,7 @@ (define-public ruby-gem-hadar (modify-phases %standard-phases (replace 'build (lambda _ - (zero? (system* "gem" "build" "gem_hadar.gemspec"))))))) + (invoke "gem" "build" "gem_hadar.gemspec")))))) (propagated-inputs `(("git" ,git) ("ruby-tins" ,ruby-tins) @@ -2913,7 +2913,7 @@ (define-public ruby-term-ansicolor (modify-phases %standard-phases (replace 'build (lambda _ - (zero? (system* "gem" "build" "term-ansicolor.gemspec"))))))) + (invoke "gem" "build" "term-ansicolor.gemspec")))))) (propagated-inputs `(("ruby-tins" ,ruby-tins))) (native-inputs @@ -3021,7 +3021,7 @@ (define-public ruby-json-pure (lambda _ ;; Regenerate gemspec so loosened dependency constraints are ;; propagated. - (zero? (system* "rake" "gemspec"))))))) + (invoke "rake" "gemspec")))))) (native-inputs `(("bundler" ,bundler) ("ragel" ,ragel) @@ -3105,8 +3105,8 @@ (define-public ruby-activesupport (modify-phases %standard-phases (replace 'check (lambda _ - ;; There is no tests, instead attempt to load the library. - (zero? (system* "ruby" "-Ilib" "-r" "active_support"))))))) + ;; There are no tests, instead attempt to load the library. + (invoke "ruby" "-Ilib" "-r" "active_support")))))) (propagated-inputs `(("ruby-concurrent" ,ruby-concurrent) ("ruby-i18n" ,ruby-i18n) @@ -3316,7 +3316,7 @@ (define-public ruby-redcloth ;; existing gemspec. (replace 'build (lambda _ - (zero? (system* "gem" "build" "redcloth.gemspec"))))))) + (invoke "gem" "build" "redcloth.gemspec")))))) (native-inputs `(("bundler" ,bundler) ("ruby-diff-lcs" ,ruby-diff-lcs) @@ -3394,9 +3394,9 @@ (define-public ruby-netrc ;; There is no Rakefile and minitest can only run one file at once, ;; so we have to iterate over all test files. (lambda _ - (and (map (lambda (file) - (zero? (system* "ruby" "-Itest" file))) - (find-files "./test" "test_.*\\.rb")))))))) + (map (lambda (file) + (invoke "ruby" "-Itest" file)) + (find-files "./test" "test_.*\\.rb"))))))) (native-inputs `(("ruby-minitest" ,ruby-minitest))) (synopsis "Library to read and update netrc files") @@ -3421,7 +3421,7 @@ (define-public ruby-unf-ext `(#:phases (modify-phases %standard-phases (add-after 'build 'build-ext - (lambda _ (zero? (system* "rake" "compile:unf_ext"))))))) + (lambda _ (invoke "rake" "compile:unf_ext")))))) (native-inputs `(("bundler" ,bundler) ("ruby-rake-compiler" ,ruby-rake-compiler) @@ -3797,7 +3797,7 @@ (define-public ruby-yard ;; $HOME needs to be set to somewhere writeable for tests to run (setenv "HOME" "/tmp") ;; Run tests without using 'rake' to avoid dependencies. - (zero? (system* "rspec"))))))) + (invoke "rspec")))))) (native-inputs `(("ruby-rspec" ,ruby-rspec) ("ruby-rack" ,ruby-rack))) @@ -3984,7 +3984,7 @@ (define-public ruby-turn ;; without issue. (replace 'check (lambda _ - (zero? (system* "ruby" "-Ilib" "bin/turn" "-h"))))))) + (invoke "ruby" "-Ilib" "bin/turn" "-h")))))) (propagated-inputs `(("ruby-ansi" ,ruby-ansi) ("ruby-minitest" ,ruby-minitest-4))) @@ -4124,7 +4124,7 @@ (define-public ruby-sqlite3 #t)) (add-before 'check 'add-gemtest-file ;; This file exists in the repository but is not distributed. - (lambda _ (zero? (system* "touch" ".gemtest"))))))) + (lambda _ (invoke "touch" ".gemtest")))))) (inputs `(("sqlite" ,sqlite))) (native-inputs @@ -4158,7 +4158,7 @@ (define-public ruby-shoulda-context (lambda _ ;; Do not run tests to avoid circular dependence with rails. ;; Instead just import the library to test. - (zero? (system* "ruby" "-Ilib" "-r" "shoulda-context"))))))) + (invoke "ruby" "-Ilib" "-r" "shoulda-context")))))) (synopsis "Test::Unit context framework extracted from Shoulda") (description "@code{shoulda-context} is the context framework extracted from Shoulda. @@ -4187,7 +4187,7 @@ (define-public ruby-shoulda-matchers (lambda _ ;; Do not run tests to avoid circular dependence with rails. Instead ;; just import the library to test. - (zero? (system* "ruby" "-Ilib" "-r" "shoulda-matchers"))))))) + (invoke "ruby" "-Ilib" "-r" "shoulda-matchers")))))) (propagated-inputs `(("ruby-activesupport" ,ruby-activesupport))) (synopsis "Collection of testing matchers extracted from Shoulda") @@ -4227,7 +4227,7 @@ (define-public ruby-shoulda (replace 'check ;; Don't run tests to avoid circular dependence with rails. Instead ;; just import the library to test. - (lambda _ (zero? (system* "ruby" "-Ilib" "-r" "shoulda"))))))) + (lambda _ (invoke "ruby" "-Ilib" "-r" "shoulda")))))) (propagated-inputs `(("ruby-shoulda-context" ,ruby-shoulda-context) ("ruby-shoulda-matchers" ,ruby-shoulda-matchers-2))) @@ -4380,10 +4380,9 @@ (define-public ruby-httpclient (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? - (zero? - (system* "ruby" - "-Ilib" - "test/runner.rb")) + (invoke "ruby" + "-Ilib" + "test/runner.rb") #t)))))) (native-inputs `(("ruby-rack" ,ruby-rack))) @@ -4422,7 +4421,7 @@ (define-public ruby-ansi ;; be require'd. (replace 'check (lambda _ - (zero? (system* "ruby" "-Ilib" "-r" "ansi")))) + (invoke "ruby" "-Ilib" "-r" "ansi"))) (add-before 'validate-runpath 'replace-broken-symlink (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -4493,7 +4492,7 @@ (define-public ruby-bio-commandeer ;; Run test without calling 'rake' so that jeweler is ;; not required as an input. (lambda _ - (zero? (system* "rspec" "spec/bio-commandeer_spec.rb"))))))) + (invoke "rspec" "spec/bio-commandeer_spec.rb")))))) (propagated-inputs `(("ruby-bio-logger" ,ruby-bio-logger) ("ruby-systemu" ,ruby-systemu))) @@ -4530,7 +4529,7 @@ (define-public ruby-rubytest (modify-phases %standard-phases (replace 'check (lambda _ - (zero? (system* "ruby" "-Ilib" "-r" "rubytest"))))))) + (invoke "ruby" "-Ilib" "-r" "rubytest")))))) (propagated-inputs `(("ruby-ansi" ,ruby-ansi))) (synopsis "Universal test harness for Ruby") @@ -4560,7 +4559,7 @@ (define-public ruby-brass (modify-phases %standard-phases (replace 'check (lambda _ - (zero? (system* "ruby" "-Ilib" "-r" "brass"))))))) + (invoke "ruby" "-Ilib" "-r" "brass")))))) (synopsis "Basic foundational assertions framework") (description "BRASS (Bare-Metal Ruby Assertion System Standard) is a basic @@ -4588,7 +4587,7 @@ (define-public ruby-qed (modify-phases %standard-phases (replace 'check (lambda _ - (zero? (system* "ruby" "-Ilib" "bin/qed" "--copyright"))))))) + (invoke "ruby" "-Ilib" "bin/qed" "--copyright")))))) (propagated-inputs `(("ruby-ansi" ,ruby-ansi) ("ruby-brass" ,ruby-brass))) @@ -4622,7 +4621,7 @@ (define-public ruby-ae `(#:phases (modify-phases %standard-phases (replace 'check - (lambda _ (zero? (system* "qed")))) + (lambda _ (invoke "qed"))) (add-before 'validate-runpath 'replace-broken-symlink (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -4660,7 +4659,7 @@ (define-public ruby-lemon (arguments `(#:phases (modify-phases %standard-phases - (replace 'check (lambda _ (zero? (system* "qed"))))))) + (replace 'check (lambda _ (invoke "qed")))))) (propagated-inputs `(("ruby-ae" ,ruby-ae) ("ruby-ansi" ,ruby-ansi) @@ -4716,8 +4715,8 @@ (define-public ruby-hashery (modify-phases %standard-phases (replace 'check (lambda _ - (and (zero? (system* "qed")) - (zero? (system* "rubytest" "-Ilib" "-Itest" "test/")))))))) + (invoke "qed") + (invoke "rubytest" "-Ilib" "-Itest" "test/")))))) (native-inputs `(("ruby-rubytest-cli" ,ruby-rubytest-cli) ("ruby-qed" ,ruby-qed) @@ -4751,7 +4750,7 @@ (define-public ruby-rc4 (modify-phases %standard-phases (replace 'check (lambda _ - (zero? (system* "rspec" "spec/rc4_spec.rb"))))))) + (invoke "rspec" "spec/rc4_spec.rb")))))) (native-inputs `(("ruby-rspec" ,ruby-rspec-2))) (synopsis "Implementation of the RC4 algorithm") @@ -5005,7 +5004,7 @@ (define-public ruby-concurrent (add-before 'check 'rake-compile ;; Fix the test error described at ;; https://github.com/ruby-concurrency/concurrent-ruby/pull/408 - (lambda _ (zero? (system* "rake" "compile")))) + (lambda _ (invoke "rake" "compile"))) (add-before 'check 'remove-timecop-dependency ;; Remove timecop-dependent tests as having timecop as a depedency ;; causes circular depedencies. -- cgit v1.2.3