diff mbox series

[bug#71787,02/12] gnu: Add memento.

Message ID 20240626192717.12818-2-david.elsing@posteo.net
State New
Headers show
Series Update and unbundle ghostscript and mupdf | expand

Commit Message

David Elsing June 26, 2024, 7:26 p.m. UTC
* gnu/packages/c.scm (memento): New variable.
---
 gnu/packages/c.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index d13b62b5e2..27be60aa98 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -1678,3 +1678,44 @@  (define-public pcg-c
 Linear Congruential Generator (LCG) with a permutation function to increase
 output randomness while retaining speed, simplicity, and conciseness.")
       (license (list license:expat license:asl2.0))))) ; dual licensed
+
+(define-public memento
+  (let ((commit "46f8beaad330b9b9e1dc1678cf41f78c1b902d11")
+        (revision "0"))
+    (package
+      (name "memento")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ArtifexSoftware/memento")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1gmvbybm9s07g3n7k0zswv88s4bkk7yd66ydaljqwvf6w7d9dzg4"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            ;; There are no build system files
+            (delete 'configure)
+            (replace 'build
+              (lambda _
+                (invoke #$(cc-for-target) "memento.c" "-O2" "-g" "-shared"
+                        "-o" "libmemento.so")))
+            (replace 'install
+              (lambda _
+                (install-file "libmemento.so" (string-append #$output "/lib"))
+                (install-file "memento.h" (string-append #$output "/include"))
+                (install-file "docs/README.md"
+                              (string-append #$output "/share/doc/"
+                                             #$name "-" #$version)))))
+        #:tests? #f))
+      (home-page "https://github.com/ArtifexSoftware/memento")
+      (synopsis "Memory debugging library for C and C++ programs")
+      (description "Memento is a debugging library, which intercepts calls to
+malloc, free, realloc etc. to detect memory leaks and errors.")
+      (license license:isc))))