gnu: r-mlinterfaces: Update to 1.62.1.
[jackhill/guix/guix.git] / gnu / packages / debug.scm
index 1f23863..49e40ee 100644 (file)
@@ -2,6 +2,8 @@
 ;;; Copyright © 2014, 2015, 2016, 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages golang)
-  #:use-module (gnu packages indent)
+  #:use-module (gnu packages code)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pretty-print)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages readline)
   #:use-module (gnu packages virtualization)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
@@ -169,7 +175,7 @@ tools that process C/C++ code.")
       (inputs
        `(("custom-qemu"
           ;; The afl-qemu tool builds qemu 2.10.0 with a few patches applied.
-          ,(package (inherit (@@ (gnu packages bootloaders) qemu-minimal-2.10))
+          ,(package (inherit qemu-minimal-2.10)
              (name "afl-qemu")
              (inputs
               `(("afl-src" ,source)
@@ -193,10 +199,8 @@ tools that process C/C++ code.")
                                   (patch-dir
                                    (string-append afl-dir
                                                   "/qemu_mode/patches")))
-                             (unless (zero?
-                                      (system* "tar" "xf"
-                                               (assoc-ref inputs "afl-src")))
-                               (error "tar failed to unpack afl-src"))
+                             (invoke "tar" "xf"
+                                     (assoc-ref inputs "afl-src"))
                              (install-file (string-append patch-dir
                                                           "/afl-qemu-cpu-inl.h")
                                            ".")
@@ -209,11 +213,12 @@ tools that process C/C++ code.")
                              (substitute* (string-append patch-dir
                                                          "/cpu-exec.diff")
                                (("\\.\\./patches/") ""))
-                             (every (lambda (patch-file)
-                                      (zero? (system* "patch" "--force" "-p1"
-                                                      "--input" patch-file)))
-                                    (find-files patch-dir
-                                                "\\.diff$"))))))))))))))
+                             (for-each (lambda (patch-file)
+                                         (invoke "patch" "--force" "-p1"
+                                                 "--input" patch-file))
+                                       (find-files patch-dir
+                                                   "\\.diff$"))
+                             #t))))))))))))
       (arguments
        `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
                             "CC=gcc")
@@ -284,12 +289,13 @@ down the road.")
        ;; patch-* phases work properly, we unpack the source first, then
        ;; repack before the configure phase.
        (let ((make-dir (string-append "make-" (package-version gnu-make))))
-         `(#:configure-flags '("--with-make-tar=./make.tar.xz")
+         `(#:configure-flags '("--with-make-tar=./make.tar.xz"
+                               "make_cv_sys_gnu_glob=yes")
            #:phases
            (modify-phases %standard-phases
              (add-after 'unpack 'unpack-make
                (lambda* (#:key inputs #:allow-other-keys)
-                 (zero? (system* "tar" "xf" (assoc-ref inputs "make-source")))))
+                 (invoke "tar" "xf" (assoc-ref inputs "make-source"))))
              (add-after 'unpack-make 'set-default-shell
                (lambda _
                  ;; Taken mostly directly from (@ (gnu packages base) gnu-make)
@@ -299,7 +305,7 @@ down the road.")
                             (which "sh"))))))
              (add-before 'configure 'repack-make
                (lambda _
-                 (zero? (system* "tar" "cJf" "./make.tar.xz" ,make-dir))))))))
+                 (invoke "tar" "cJf" "./make.tar.xz" ,make-dir)))))))
       (home-page "https://github.com/losalamos/stress-make")
       (synopsis "Expose race conditions in Makefiles")
       (description
@@ -335,3 +341,61 @@ conditions.")
 intercepting file operations and changing random bits in the program's
 input.  Zzuf's behaviour is deterministic, making it easy to reproduce bugs.")
     (license (non-copyleft "http://www.wtfpl.net/txt/copying/"))))
+
+(define-public scanmem
+  (package
+    (name "scanmem")
+    (version "0.17")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/scanmem/scanmem")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "17p8sh0rj8yqz36ria5bp48c8523zzw3y9g8sbm2jwq7sc27i7s9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags '("--enable-gui")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'hardcode-python
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "gui/GameConqueror.py"
+               (("/usr/bin/env python")
+                (string-append (assoc-ref %build-inputs
+                                          "python-wrapper") "/bin/python")))
+             #t))
+         (add-after 'install 'wrap-gameconqueror
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out               (assoc-ref outputs "out"))
+                   (gi-typelib-path   (getenv "GI_TYPELIB_PATH"))
+                   (python-path       (getenv "PYTHONPATH")))
+               (wrap-program (string-append out "/share/gameconqueror/GameConqueror.py")
+                 `("GI_TYPELIB_PATH"        ":" prefix (,gi-typelib-path))
+                 `("PYTHONPATH"             ":" prefix (,python-path))))
+             #t)))))
+    (native-inputs
+     `(("libtool" ,libtool)
+       ("python-wrapper" ,python-wrapper)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+" ,gtk+)
+       ("intltool" ,intltool)
+       ("automake" ,automake)
+       ("autoconf" ,autoconf)))
+    (inputs
+     `(("readline" ,readline)))
+    (propagated-inputs
+     `(("python-pygobject" ,python-pygobject)))
+    (home-page "https://github.com/scanmem/scanmem")
+    (synopsis "Memory scanner")
+    (description "Scanmem is a debugging utility designed to isolate the
+address of an arbitrary variable in an executing process.  Scanmem simply
+needs to be told the pid of the process and the value of the variable at
+several different times.  After several scans of the process, scanmem isolates
+the position of the variable and allows you to modify its value.")
+    ;; The library is covered by LGPLv3 or later; the application is covered
+    ;; by GPLv3 or later.
+    (license (list lgpl3+ gpl3+))))