Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / debug.scm
index 83346a4..82a57d4 100644 (file)
@@ -1,6 +1,9 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2014, 2015, 2016, 2017, 2019 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))
@@ -45,7 +52,7 @@
      (origin
       (method url-fetch)
       (uri (list
-            (string-append "http://ftp.de.debian.org/debian/pool/main/d/delta/"
+            (string-append "mirror://debian/pool/main/d/delta/"
                            "delta_" version ".orig.tar.gz")
             ;; This uri seems to send guix download into an infinite loop
             (string-append "http://delta.tigris.org/files/documents/3103/"
@@ -66,8 +73,6 @@
                     (bin (string-append out "/bin"))
                     (doc (string-append out "/share/doc/delta-" ,version)))
                (begin
-                 (mkdir-p bin)
-                 (mkdir-p doc)
                  (for-each (lambda (h)
                              (install-file h doc))
                            `("License.txt" ,@(find-files "www" ".*\\.html")))
@@ -75,7 +80,7 @@
                              (install-file b bin))
                            `("delta" "multidelta" "topformflat"))))
              #t))
-         (delete 'configure))))
+         (delete 'configure))))         ; no configure script
     (home-page "http://delta.tigris.org/")
     (synopsis "Heuristical file minimizer")
     (description
@@ -90,7 +95,7 @@ program to exhibit a bug.")
 (define-public c-reduce
   (package
     (name "c-reduce")
-    (version "2.5.0")
+    (version "2.10.0")
     (source
      (origin
       (method url-fetch)
@@ -98,8 +103,7 @@ program to exhibit a bug.")
             (string-append "http://embed.cs.utah.edu/creduce/"
                            "creduce-" version ".tar.gz")))
       (sha256
-       (base32
-        "1r23lhzq3dz8vi2dalxk5las8bf0av2w94hxxbs61pr73m77ik9d"))))
+       (base32 "0qx0zq8jxzx2as2zf0740g7kvgq163ayn3041di4vwk77490y76v"))))
     (build-system gnu-build-system)
     (inputs
      `(("astyle"          ,astyle)
@@ -112,11 +116,16 @@ program to exhibit a bug.")
        ("file-which"      ,perl-file-which)
        ("getopt-tabular"  ,perl-getopt-tabular)
        ("regex-common"    ,perl-regexp-common)
-       ("sys-cpu"         ,perl-sys-cpu)
        ("term-readkey"    ,perl-term-readkey)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (with-directory-excursion "tests"
+               ;; Running all tests can take a looong time, and tests 4 and 5
+               ;; require frama-c or kcc.  So run just one for sanity.
+               (invoke "./run_tests" "1"))))
          (add-after 'install 'set-load-paths
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; Tell creduce where to find the perl modules it needs.
@@ -131,9 +140,9 @@ program to exhibit a bug.")
                                           ,(package-version perl)))
                          '("term-readkey"    "exporter-lite"
                            "file-which"      "getopt-tabular"
-                           "regex-common"    "sys-cpu")))))
+                           "regex-common")))))
              #t)))))
-    (home-page "http://embed.cs.utah.edu/creduce")
+    (home-page "https://embed.cs.utah.edu/creduce")
     (synopsis "Reducer for interesting code")
     (description
      "C-Reduce is a tool that takes a large C or C++ program that has a
@@ -143,27 +152,6 @@ intended for use by people who discover and report bugs in compilers and other
 tools that process C/C++ code.")
     (license ncsa)))
 
-(define qemu-2.3.0
-  (package
-    (inherit qemu-minimal)
-    (version "2.3.0")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "http://wiki.qemu-project.org/download/qemu-"
-                    version ".tar.bz2"))
-              (sha256
-               (base32
-                "120m53c3p28qxmfzllicjzr8syjv6v4d9rsyrgkp7gnmcgvvgfmn"))))
-    (arguments
-     ;; XXX: Disable tests because of GTester's rejection of duplicate test
-     ;; names, which wasn't addressed in this version of QEMU.
-     `(#:tests? #f
-       ,@(substitute-keyword-arguments (package-arguments qemu-minimal)
-           ((#:phases phases)
-            ;; We disable the tests so we skip the phase disabling the qga test.
-            `(modify-phases ,phases (delete 'disable-test-qga))))))))
-
 (define-public american-fuzzy-lop
   (let ((machine (match (or (%current-target-system)
                             (%current-system))
@@ -177,7 +165,7 @@ tools that process C/C++ code.")
                    (_                "UNSUPPORTED"))))
     (package
       (name "american-fuzzy-lop")
-      (version "2.49b")             ;It seems all releases have the 'b' suffix
+      (version "2.52b")             ;It seems all releases have the 'b' suffix
       (source
        (origin
          (method url-fetch)
@@ -185,22 +173,22 @@ tools that process C/C++ code.")
                              "afl-" version ".tgz"))
          (sha256
           (base32
-           "1lc8mpwlbyb1iil9961yfysp8l2l4nw0s07781m1haiz4jq2rigp"))))
+           "0ig0ij4n1pwry5dw1hk4q88801jzzy2cric6y2gd6560j55lnqa3"))))
       (build-system gnu-build-system)
       (inputs
        `(("custom-qemu"
-          ;; The afl-qemu tool builds qemu 2.3.0 with a few patches applied.
-          ,(package (inherit qemu-2.3.0)
+          ;; The afl-qemu tool builds qemu 2.10.0 with a few patches applied.
+          ,(package (inherit qemu-minimal-2.10)
              (name "afl-qemu")
              (inputs
               `(("afl-src" ,source)
-                ,@(package-inputs qemu-2.3.0)))
+                ,@(package-inputs qemu-minimal)))
              ;; afl only supports using a single afl-qemu-trace executable, so
              ;; we only build qemu for the native target.
              (arguments
               `(#:modules ((srfi srfi-1)
                            ,@%gnu-build-system-modules)
-                ,@(substitute-keyword-arguments (package-arguments qemu-2.3.0)
+                ,@(substitute-keyword-arguments (package-arguments qemu-minimal)
                     ((#:configure-flags config-flags)
                      ``(,(string-append "--target-list=" ,machine "-linux-user")
                         ,@(remove (λ (f) (string-prefix? "--target-list=" f))
@@ -214,10 +202,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")
                                            ".")
@@ -230,11 +216,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")
@@ -277,21 +264,21 @@ down the road.")
       (license asl2.0))))
 
 (define-public stress-make
-  (let ((commit "506e6cfd98d165f22bee91c408b7c20117a682c4")
-        (revision "0"))                 ;No official source distribution
+  (let ((commit "9e92dff8f0157f012aaf31de5b8b8112ad720100")
+        (revision "1"))                 ;No official source distribution
     (package
       (name "stress-make")
-      (version (string-append "1.0-" revision "." (string-take commit 7)))
+      (version (git-version "1.0" revision commit))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
-               (url "https://github.com/losalamos/stress-make.git")
+               (url "https://github.com/lanl/stress-make.git")
                (commit commit)))
-         (file-name (string-append name "-" version "-checkout"))
+         (file-name (git-file-name name version))
          (sha256
           (base32
-           "1j330yqhc7plwin04qxbh8afpg5nfnw1xvnmh8rk6mmqg9w6ik70"))))
+           "1z1yiwnqyzv3v6152fnjbfh2lr8q8fi5xxfdclnr8l8sd4c1rasp"))))
       (build-system gnu-build-system)
       (native-inputs
        `(("autoconf" ,autoconf)
@@ -305,12 +292,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)
@@ -320,14 +308,15 @@ down the road.")
                             (which "sh"))))))
              (add-before 'configure 'repack-make
                (lambda _
-                 (zero? (system* "tar" "cJf" "./make.tar.xz" ,make-dir))))
-             (add-after 'unpack 'bootstrap
-               (lambda _
-                 (zero? (system* "autoreconf" "-vfi"))))))))
-      (home-page "https://github.com/losalamos/stress-make")
+                 (invoke "tar" "cJf" "./make.tar.xz" ,make-dir)))
+             (add-before 'build 'setup-go
+               ;; The Go cache is required starting in Go 1.12, and it needs
+               ;; to be writable.
+               (lambda _ (setenv "GOCACHE" "/tmp/go-cache") #t))))))
+      (home-page "https://github.com/lanl/stress-make")
       (synopsis "Expose race conditions in Makefiles")
       (description
-       "Stress Make is a customized GNU Make that explicitely manages the order
+       "Stress Make is a customized GNU Make that explicitly manages the order
 in which concurrent jobs are run to provoke erroneous behavior into becoming
 manifest.  It can run jobs in the order in which they're launched, in backwards
 order, or in random order.  The thought is that if code builds correctly with
@@ -335,8 +324,8 @@ Stress Make, then it is likely that the @code{Makefile} contains no race
 conditions.")
       ;; stress-make wrapper is under BSD-3-modifications-must-be-indicated,
       ;; and patched GNU Make is under its own license.
-      (license (list (non-copyleft "COPYING.md")
-                     (package-license gnu-make))))))
+      (license (list (non-copyleft "LICENSE.md")
+                     gpl3+)))))
 
 (define-public zzuf
   (package
@@ -359,3 +348,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+))))