gnu: ruby-stackprof: Update to 0.2.25.

* gnu/packages/ruby.scm (ruby-stackprof): Update to 0.2.25.
[arguments]: Update style, add patch-gemspec phase and use bundle in check
phase.
[native-inputs]: Add bundler and use ruby-mocha-1.
This commit is contained in:
Christopher Baines 2023-06-26 20:38:19 +01:00
parent cdb2f02f0e
commit 2857b99e0d
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

@ -9100,33 +9100,45 @@ (define-public ruby-pry-byebug
(define-public ruby-stackprof (define-public ruby-stackprof
(package (package
(name "ruby-stackprof") (name "ruby-stackprof")
(version "0.2.17") (version "0.2.25")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (rubygems-uri "stackprof" version)) (uri (rubygems-uri "stackprof" version))
(sha256 (sha256
(base32 "06lz70k8c0r7fyxk1nc3idh14x7nvsr21ydm1bsmbj00jyhmfzsn")))) (base32 "0bhdgfb0pmw9mav1kw9fn0ka012sa0i3h5ppvqssw5xq48nhxnr8"))))
(build-system ruby-build-system) (build-system ruby-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases
(add-before 'check 'skip-dubious-test #~(modify-phases %standard-phases
(lambda _ (add-before 'check 'patch-gemspec
,@(if (or (target-riscv64?) (lambda _
(target-ppc32?)) (substitute* "stackprof.gemspec"
;; This unreliable test can fail with "Expected 32 to be <= 25." (("rake-compiler.*")
'((substitute* "test/test_stackprof.rb" "rake-compiler>.freeze, [\"> 0.9\"])\n")
((".*assert_operator profile\\[:missed_samples.*") ""))) (("mocha.*")
;; This unreliable test can fail with "Expected 0 to be >= 1." "mocha>.freeze, [\"> 0.14\"])\n"))))
'((substitute* "test/test_stackprof.rb" (add-before 'check 'skip-dubious-test
(("def test_(cputime)" _ name) (lambda _
(string-append "def skip_" name))))))) #$(if (or (target-riscv64?)
(add-before 'check 'build-tests (target-ppc32?))
(lambda _ ;; This unreliable test can fail with "Expected 32 to be <= 25."
(invoke "rake" "compile")))))) #~(substitute* "test/test_stackprof.rb"
((".*assert_operator profile\\[:missed_samples.*") ""))
;; This unreliable test can fail with "Expected 0 to be >= 1."
#~(substitute* "test/test_stackprof.rb"
(("def test_(cputime)" _ name)
(string-append "def skip_" name))))))
(add-before 'check 'build-tests
(lambda _
(invoke "rake" "compile")))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "bundle" "exec" "rake" "default")))))))
(native-inputs (native-inputs
(list ruby-mocha ruby-rake-compiler)) (list bundler ruby-mocha-1 ruby-rake-compiler))
(synopsis "Sampling profiler for Ruby code") (synopsis "Sampling profiler for Ruby code")
(description (description
"@code{stackprof} is a fast sampling profiler for Ruby code, with cpu, "@code{stackprof} is a fast sampling profiler for Ruby code, with cpu,