Subject: [bug#52043] [PATCH 1/2] gnu: Add instrumentation packages.

From: Olivier Dion <[email-masked]>
Date: Mon, 22 Nov 2021 14:13:22 -0500

* gnu/packages/instrumentation.scm: New file
(dyninst): New variable.
---
 gnu/local.mk                     |  1 +
 gnu/packages/instrumentation.scm | 56 ++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 gnu/packages/instrumentation.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 2513530d0d..3f190c4f6a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -307,6 +307,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/inklingreader.scm		\
   %D%/packages/inkscape.scm			\
   %D%/packages/installers.scm			\
+  %D%/packages/instrumentation.scm		\
   %D%/packages/ipfs.scm			\
   %D%/packages/irc.scm  			\
   %D%/packages/irods.scm  			\
diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm
new file mode 100644
index 0000000000..cacd74ac0a
--- /dev/null
+++ b/gnu/packages/instrumentation.scm
@@ -0,0 +1,56 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Olivier Dion <[email-masked]>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages instrumentation)
+  #:use-module (gnu packages boost)
+  #:use-module (gnu packages elf)
+  #:use-module (gnu packages llvm)
+  #:use-module (gnu packages tbb)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system cmake)
+  #:use-module ((guix licenses) #:prefix license:))
+
+(define-public dyninst
+  (package
+    (name "dyninst")
+    ;; Newer versions are not promoted on main home page and require libiberty.
+    (version "10.2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/dyninst/dyninst/archive/v"
+                                  version ".tar.gz"))
+              (sha256
+               (base32 "18bvmvm3l18lpw8fz9yrjkd6fwqvxg0j2xfhvkzx4xr5l73wcxw0"))))
+
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f
+       ;; STERILE_BUILD: Do not download/build third-party dependencies from
+       ;; source.
+       #:configure-flags
+       (list "-DSTERILE_BUILD=ON")))
+    (inputs
+     `(("elfutils" ,elfutils)
+       ("boost" ,boost)
+       ("tbb" ,tbb)
+       ("libomp" ,libomp)))
+    (home-page "https://dyninst.org/")
+    (synopsis "Dynamic instrumentation")
+    (description "Tools for binary instrumentation, analysis, and modification.")
+    (license license:lgpl2.0)))
-- 
2.34.0