dannym pushed a commit to branch master
in repository guix.

commit bdb12d429dbe5d492f1c54c705b24ec23a2b1794
Author: Simon South <[email protected]>
AuthorDate: Fri Jan 27 15:34:28 2023 -0500

    gnu: Add sanitizers-cmake.
    
    * gnu/packages/cmake.scm (sanitizers-cmake): New variable.
    
    Signed-off-by: Danny Milosavljevic <[email protected]>
---
 gnu/packages/cmake.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 8310dc55fa..35ac62f731 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2019 Pierre-Moana Levesque <[email protected]>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <[email protected]>
 ;;; Copyright © 2021 Ricardo Wurmus <[email protected]>
+;;; Copyright © 2023 Simon South <[email protected]>
 ;;; Copyright © 2024 John Kehayias <[email protected]>
 ;;; Copyright © 2024 dan <[email protected]>
 ;;; Copyright © 2024 Charles <[email protected]>
@@ -36,6 +37,7 @@
   #:use-module (guix packages)
   #:use-module (guix gexp)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
@@ -587,3 +589,42 @@ CMake modules.")
     (description "CPM.cmake is a cross-platform CMake script that adds
 dependency management capabilities to CMake.")
     (license license:expat)))
+
+(define-public sanitizers-cmake
+  (let ((commit "0573e2ea8651b9bb3083f193c41eb086497cc80a")
+        (revision "0"))
+    (package
+      (name "sanitizers-cmake")
+      (version (git-version "0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/arsenm/sanitizers-cmake";)
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1sqjmx65iif67k10jwlf1j8p279rsniy1i3ff660hfrynr0knlry"))))
+      (build-system cmake-build-system)
+      (arguments
+       (list
+        #:configure-flags
+        #~(list
+           ;; Otherwise optimizer will optimize away our faulty thing.
+           "-DCMAKE_BUILD_TYPE=Debug")
+        #:phases
+        #~(modify-phases %standard-phases
+            ;; No install target provided; manually copy files to a suitable
+            ;; folder in the output.
+            (replace 'install
+              (lambda* (#:key source #:allow-other-keys)
+                (copy-recursively
+                 (string-append source "/cmake")
+                 (string-append #$output "/share/" #$name "/cmake")))))))
+      (synopsis "CMake module to enable sanitizers for binary targets")
+      (description "@code{sanitizers-cmake} provides a module for the CMake
+build system that can enable address, memory, thread and undefined-behavior
+sanitizers for binary targets using flags appropriate for the compiler in
+use.")
+      (home-page "https://github.com/arsenm/sanitizers-cmake";)
+      (license license:expat))))

Reply via email to