summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-14 14:37:25 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-28 22:22:29 -0400
commit97096c268ce3d485306a3e21d6358429a37508b8 (patch)
tree2ba0b8bf8029bdfcaed7bd16d75836f49860011a /gnu/packages
parent4319f564a7163c0cb14a6c3dde1e58049387ffc4 (diff)
downloadguix-97096c268ce3d485306a3e21d6358429a37508b8.tar.gz
gnu: Add ruby-ruby-memcheck.
* gnu/packages/ruby.scm (ruby-ruby-memcheck): New variable.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/ruby.scm41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index d091776159..a2ca791068 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -82,6 +82,7 @@
   #:use-module (gnu packages rsync)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages web-browsers)
   #:use-module (gnu packages serialization)
@@ -8268,6 +8269,46 @@ Profiling multiple threads simultaneously is supported.
     (home-page "https://github.com/ruby-prof/ruby-prof")
     (license license:bsd-2)))
 
+(define-public ruby-ruby-memcheck
+  (package
+    (name "ruby-ruby-memcheck")
+    (version "1.2.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Shopify/ruby_memcheck")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1sx8nhx7w4z5s5vj6kq6caqsfznswqzwca372j82cd80hf9iznra"))))
+    (build-system ruby-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-valgrind-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "lib/ruby_memcheck/configuration.rb"
+                (("DEFAULT_VALGRIND = \"valgrind\"")
+                 (format #f "DEFAULT_VALGRIND = ~s"
+                         (search-input-file inputs "bin/valgrind"))))))
+          (add-before 'replace-git-ls-files 'standardize-git-ls-files
+            (lambda _
+              (substitute* "ruby_memcheck.gemspec"
+                (("%x\\(git ls-files -z)")
+                 "`git ls-files -z`")))))))
+    (native-inputs (list ruby-rake-compiler ruby-rspec))
+    (inputs (list valgrind/interactive))
+    (propagated-inputs (list ruby-nokogiri))
+    (synopsis "Valgrind memcheck tool for Ruby")
+    (description "The @code{ruby_memcheck} gem provides a sane way to use
+Valgrind's memcheck on your native extension gem, that filters out all the
+false positives caused by Ruby not freeing all of the memory it allocates
+during shutdown.")
+    (home-page "https://github.com/Shopify/ruby_memcheck")
+    (license license:expat)))
+
 (define-public ruby-memory-profiler
   (package
     (name "ruby-memory-profiler")