summary refs log tree commit diff
path: root/gnu/packages/code.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/code.scm')
-rw-r--r--gnu/packages/code.scm283
1 files changed, 150 insertions, 133 deletions
diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index 7551b31e85..e96a55e5b0 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013, 2015, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2016, 2017, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
@@ -15,6 +15,7 @@
 ;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2021 lu hui <luhuins@163.com>
+;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,6 +33,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages code)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (guix download)
@@ -67,6 +69,7 @@
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml))
 
@@ -75,18 +78,19 @@
 (define-public cflow
   (package
     (name "cflow")
-    (version "1.6")
+    (version "1.7")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnu/cflow/cflow-"
                                   version ".tar.bz2"))
               (sha256
                (base32
-                "1mzd3yf0dfv8h2av5vsxxlhpk21nw064h91b2kgfrdz92r0pnj1l"))))
+                "11khr78090jjyqa2l26bdz0myjx6b212lz216dhjc7h0z754c4fh"))))
     (build-system gnu-build-system)
 
     ;; Needed to have cflow-mode.el installed.
-    (native-inputs `(("emacs" ,emacs-minimal)))
+    (native-inputs
+     (list emacs-minimal))
     (arguments
      '(#:configure-flags (list (string-append "CPPFLAGS="
                                               "-D" "CFLOW_PREPROC=\\\""
@@ -114,8 +118,7 @@ a major mode for Emacs for examining the flowcharts that it produces.")
                 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("texinfo" ,texinfo)
-       ("autogen" ,autogen)))
+     (list texinfo autogen))
     (home-page "https://www.gnu.org/software/complexity/")
     (synopsis "Analyze complexity of C functions")
     (description
@@ -128,77 +131,78 @@ highlighting your own code that seemed comprehensible when you wrote it.")
 (define-public global                             ; a global variable
   (package
     (name "global")
-    (version "6.6.7")
+    (version "6.6.8")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/global/global-"
                                  version ".tar.gz"))
              (sha256
               (base32
-               "0g4aslm2zajq605py11s4rs1wdnzcqhkh7bc2xl5az42adzzg839"))))
+               "1kaphc3gml89p8dpdgh2is8hj46wj05689kxj0bmh5q759rxk4vg"))))
     (build-system gnu-build-system)
-    (inputs
-      `(("bash" ,bash-minimal)                    ; for wrap-program
-        ("coreutils" ,coreutils)
-        ("ctags" ,universal-ctags)
-        ("libltdl" ,libltdl)
-        ("ncurses" ,ncurses)
-        ("python-pygments" ,python-pygments)
-        ("python-wrapper" ,python-wrapper)
-        ("sqlite" ,sqlite)))
     (arguments
-     `(#:configure-flags
-       (list (string-append "--with-ncurses="
-                            (assoc-ref %build-inputs "ncurses"))
-             (string-append "--with-sqlite3="
-                            (assoc-ref %build-inputs "sqlite"))
-             (string-append "--with-universal-ctags="
-                            (assoc-ref %build-inputs "ctags") "/bin/ctags")
-             (string-append "--sysconfdir="
-                            (assoc-ref %outputs "out") "/share/gtags")
-             "--localstatedir=/var"         ; This needs to be a writable location.
-             "--disable-static")
+     (list #:configure-flags
+           #~(list (string-append "--with-ncurses="
+                                  #$(this-package-input "ncurses"))
+                   (string-append "--with-sqlite3="
+                                  #$(this-package-input "sqlite"))
+                   (string-append "--with-universal-ctags="
+                                  #$(this-package-input "universal-ctags")
+                                  "/bin/ctags")
+                   (string-append "--sysconfdir="
+                                  #$output "/share/gtags")
+                   "--localstatedir=/var" ; This needs to be a writable location.
+                   "--disable-static")
 
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-globash
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((echo (string-append
-                           (assoc-ref inputs "coreutils") "/bin/echo")))
-               (substitute* "globash/globash.in"
-                 (("/bin/echo") echo)))))
-         (add-after 'post-install 'install-plugins
-           (lambda _
-             (with-directory-excursion "plugin-factory"
-               (invoke "make" "install"))))
-         (add-before 'install 'dont-install-to-/var
-           (lambda _
-             (substitute* "gozilla/Makefile"
-               (("DESTDIR\\)\\$\\{localstatedir\\}") "TMPDIR)"))))
-         (add-after 'install-plugins 'wrap-program
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (wrap-program
-               (string-append (assoc-ref outputs "out")
-                              "/share/gtags/script/pygments_parser.py")
-               `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))))
-        (add-after 'install 'post-install
-          (lambda* (#:key outputs #:allow-other-keys)
-            ;; Install the plugin files in the right place.
-            (let* ((out  (assoc-ref outputs "out"))
-                   (data (string-append out "/share/gtags"))
-                   (vim  (string-append out "/share/vim/vimfiles/plugin"))
-                   (lisp (string-append out "/share/emacs/site-lisp/"
-                                        ,(package-name this-package) "-"
-                                        ,(package-version this-package))))
-              (mkdir-p lisp)
-              (mkdir-p vim)
-              (rename-file (string-append data "/gtags.el")
-                           (string-append lisp "/gtags.el"))
-              (rename-file (string-append data "/gtags.vim")
-                           (string-append vim "/gtags.vim"))
-              (rename-file (string-append data "/gtags-cscope.vim")
-                           (string-append vim "/gtags-cscope.vim"))
-              #t))))))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'fix-globash
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "globash/globash.in"
+                     (("/bin/echo")
+                      (search-input-file inputs "bin/echo")))))
+               (add-after 'post-install 'install-plugins
+                 (lambda _
+                   (with-directory-excursion "plugin-factory"
+                     (invoke "make" "install"))))
+               (add-before 'install 'dont-install-to-/var
+                 (lambda _
+                   (substitute* "gozilla/Makefile"
+                     (("DESTDIR\\)\\$\\{localstatedir\\}")
+                      "TMPDIR)"))))
+               (add-after 'install-plugins 'wrap-program
+                 (lambda _
+                   (wrap-program
+                       (string-append #$output
+                                      "/share/gtags/script/pygments_parser.py")
+                     `("GUIX_PYTHONPATH" ":" prefix
+                       (,(getenv "GUIX_PYTHONPATH"))))))
+               (add-after 'install 'post-install
+                 (lambda _
+                   ;; Install the plugin files in the right place.
+                   (let* ((data (string-append #$output "/share/gtags"))
+                          (vim  (string-append #$output
+                                               "/share/vim/vimfiles/plugin"))
+                          (lisp (string-append #$output "/share/emacs/site-lisp/"
+                                               #$(package-name this-package) "-"
+                                               #$(package-version this-package))))
+                     (mkdir-p lisp)
+                     (mkdir-p vim)
+                     (rename-file (string-append data "/gtags.el")
+                                  (string-append lisp "/gtags.el"))
+                     (rename-file (string-append data "/gtags.vim")
+                                  (string-append vim  "/gtags.vim"))
+                     (rename-file (string-append data "/gtags-cscope.vim")
+                                  (string-append vim  "/gtags-cscope.vim"))))))))
+    (inputs
+      (list bash-minimal                ; for wrap-program
+            coreutils
+            universal-ctags
+            libltdl
+            ncurses
+            python-pygments
+            python-wrapper
+            sqlite))
     (home-page "https://www.gnu.org/software/global/")
     (synopsis "Cross-environment source code tag system")
     (description
@@ -254,7 +258,7 @@ around in a large, deeply nested project.")
 
         #:make-flags (list (string-append "PREFIX="
                                           (assoc-ref %outputs "out")))))
-    (inputs `(("perl" ,perl)))
+    (inputs (list perl))
     (home-page "https://dwheeler.com/sloccount/")
     (synopsis "Count physical source lines of code (SLOC)")
     (description
@@ -268,7 +272,7 @@ COCOMO model or user-provided parameters.")
 (define-public cloc
   (package
     (name "cloc")
-    (version "1.90")
+    (version "1.92")
     (source
      (origin
        (method git-fetch)
@@ -277,15 +281,15 @@ COCOMO model or user-provided parameters.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0ic9q6qqw5f1wafp9lpmhr0miasbdb9zr59c0jlymnzffdmnliyc"))))
+        (base32 "1hy1hskiw02b7xaxn2qz0v7znj14l49w1anx20z6rkcps7212l5l"))))
     (build-system gnu-build-system)
     (inputs
-     `(("coreutils" ,coreutils)
-       ("perl" ,perl)
-       ("perl-algorithm-diff" ,perl-algorithm-diff)
-       ("perl-digest-md5" ,perl-digest-md5)
-       ("perl-parallel-forkmanager" ,perl-parallel-forkmanager)
-       ("perl-regexp-common" ,perl-regexp-common)))
+     (list coreutils
+           perl
+           perl-algorithm-diff
+           perl-digest-md5
+           perl-parallel-forkmanager
+           perl-regexp-common))
     (arguments
      `(#:phases (modify-phases %standard-phases
                   (delete 'configure)   ; nothing to configure
@@ -298,15 +302,13 @@ COCOMO model or user-provided parameters.")
                                 (string-append "INSTALL="
                                                (assoc-ref inputs "coreutils")
                                                "/bin/install")
-                                "install")
-                        #t)))
+                                "install"))))
                   (add-after 'install 'wrap-program
                     (lambda* (#:key inputs outputs #:allow-other-keys)
                       (let ((out (assoc-ref outputs "out")))
                         (wrap-program (string-append out "/bin/cloc")
                           `("PERL5LIB" ":" =
-                            ,(string-split (getenv "PERL5LIB") #\:)))
-                        #t))))
+                            ,(string-split (getenv "PERL5LIB") #\:)))))))
        #:out-of-source? #t
        ;; Tests require some other packages.
        #:tests? #f))
@@ -333,12 +335,14 @@ cloc can handle a greater variety of programming languages.")
                (base32
                 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
     (build-system gnu-build-system)
+    (arguments
+     ;; Required since GCC 10, see:
+     ;; https://gcc.gnu.org/gcc-10/porting_to.html.
+     `(#:configure-flags (list "CFLAGS=-fcommon")))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     (list pkg-config))
     (inputs
-     `(("pcre" ,pcre)
-       ("xz" ,xz)
-       ("zlib" ,zlib)))
+     (list pcre xz zlib))
     (home-page "https://geoff.greer.fm/ag/")
     (synopsis "Fast code searching tool")
     (description
@@ -420,16 +424,9 @@ features that are not supported by the standard @code{stdio} implementation.")
                       (substitute* "Tmain/utils.sh"
                         (("/bin/echo") (which "echo"))))))))
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("packcc" ,packcc)
-       ("perl" ,perl)
-       ("pkg-config" ,pkg-config)))
+     (list autoconf automake packcc perl pkg-config))
     (inputs
-     `(("jansson" ,jansson)
-       ("libseccomp" ,libseccomp)
-       ("libxml2" ,libxml2)
-       ("libyaml" ,libyaml)))
+     (list jansson libseccomp libxml2 libyaml))
     (home-page "https://ctags.io/")
     (synopsis "Generate tag files for source code")
     (description
@@ -485,9 +482,8 @@ expressions, and its ability to generate emacs-style TAGS files.")
             #t)))))
     (home-page "https://github.com/cameronwhite/withershins")
     (inputs
-     `(("libiberty" ,libiberty)
-       ("binutils" ,binutils) ;for libbfd
-       ("zlib" ,zlib)))
+     (list libiberty binutils ;for libbfd
+           zlib))
     (synopsis "C++11 library for generating stack traces")
     (description
      "Withershins is a simple cross-platform C++11 library for generating
@@ -532,9 +528,7 @@ stack traces.")
                (wrap-program (string-append out "/bin/geninfo")
                  `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB")))))
              #t)))))
-    (inputs `(("perl" ,perl)
-              ("perl-io-compress" ,perl-io-compress)
-              ("perl-json" ,perl-json)))
+    (inputs (list perl perl-io-compress perl-json))
     (home-page "http://ltp.sourceforge.net/coverage/lcov.php")
     (synopsis "Code coverage tool that enhances GNU gcov")
     (description "LCOV is an extension of @command{gcov}, a tool part of the
@@ -570,39 +564,36 @@ results and determine build stability.")
 (define-public kcov
   (package
     (name "kcov")
-    (version "38")
+    (version "40")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/SimonKagstrom/kcov")
-                    (commit version)))
+                    (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0zqg21xwivi16csl6a5wby6679ny01bjaw4am3y4qcgjdyihifp8"))))
+                "0zayhmx6s377bxmkmvl9d9vjzfbpvh1k9ba6np4zdjvjjq327xag"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:tests? #f ;no test target
+     `(#:tests? #f                      ; no test target
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-/bin/bash-references
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((bash (assoc-ref inputs "bash")))
              (substitute* (find-files "src" ".*\\.cc?$")
-               (("/bin/bash") (which "bash"))
-               (("/bin/sh") (which "sh")))
-             #t)))))
+               (("/bin/(bash|sh)" shell)
+                (string-append (assoc-ref inputs "bash") shell)))))))))
     (inputs
-     `(("curl" ,curl)
-       ("elfutils" ,elfutils)
-       ("libelf" ,libelf)
-       ("zlib" ,zlib)))
+     (list curl elfutils libelf openssl zlib))
     (native-inputs
-     `(("python" ,python)))
+     (list python))
     (home-page "https://github.com/SimonKagstrom/kcov")
     (synopsis "Code coverage tester for compiled languages, Python and Bash")
-    (description "Kcov is a FreeBSD/Linux/OSX code coverage tester for compiled
-languages, Python and Bash.  Kcov was originally a fork of Bcov, but has since
-evolved to support a large feature set in addition to that of Bcov.
+    (description "Kcov is a code coverage tester for compiled languages,
+Python and Bash.  It was originally a fork of Bcov, but has since evolved to
+support a large feature set in addition to that of Bcov.
 
 Kcov uses DWARF debugging information for compiled programs to make it
 possible to collect coverage information without special compiler switches.")
@@ -642,14 +633,14 @@ possible to collect coverage information without special compiler switches.")
          "-DBUILD_TESTING=FALSE")
        #:tests? #f))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     (list pkg-config))
     (inputs
-     `(("bash-completion" ,bash-completion)
-       ("clang" ,clang)
-       ("llvm" ,llvm)
-       ("lua" ,lua)
-       ("rct" ,rct)
-       ("selene" ,selene)))
+     (list bash-completion
+           clang
+           llvm
+           lua
+           rct
+           selene))
     (home-page "https://github.com/Andersbakken/rtags")
     (synopsis "Indexer for the C language family with Emacs integration")
     (description
@@ -675,8 +666,7 @@ importantly we give you proper follow-symbol and find-references support.")
         (base32 "1f9v5s0viq4yc9iv6701h3pv7j21zz1ckl37lpp9hsnliiizv03p"))))
     (build-system trivial-build-system)
     (native-inputs
-     `(("bash" ,bash)
-       ("perl" ,perl)))
+     (list bash perl))
     (arguments
      `(#:modules ((guix build utils))
        #:builder
@@ -697,7 +687,7 @@ importantly we give you proper follow-symbol and find-references support.")
            (substitute* "colormake"
              (("colormake\\.pl") (string-append bin "/colormake.pl"))
              (("/bin/bash")
-              (string-append (assoc-ref %build-inputs "bash") "/bin/sh")))
+              (search-input-file %build-inputs "/bin/sh")))
            (install-file "colormake.1" (string-append doc "/man/man1"))
            (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc)
            (install-files '("colormake" "colormake-short" "clmake"
@@ -731,7 +721,7 @@ produce colored output.")
        (modify-phases %standard-phases
          (delete 'configure))))
     (native-inputs
-     `(("graphviz" ,graphviz)))
+     (list graphviz))
     (home-page "https://github.com/lindenb/makefile2graph")
     (synopsis "Creates a graph of dependencies from GNU Make")
     (description
@@ -743,7 +733,7 @@ independent targets.")
 (define-public uncrustify
   (package
     (name "uncrustify")
-    (version "0.69.0")
+    (version "0.74.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -752,11 +742,10 @@ independent targets.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0sqrg13kp8fwymq40976bq380bzw40g4ss7ihlbq45d0f90ifa1k"))))
+                "0v48vhmzxjzysbf0vhxzayl2pkassvbabvwg84xd6b8n5i74ijxd"))))
     (build-system cmake-build-system)
     (native-inputs
-     `(("unzip" ,unzip)
-       ("python" ,python-wrapper)))
+     `(("python" ,python-wrapper)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -879,8 +868,7 @@ the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
                         '("config.sub" "config.guess")))
             #t)))))
    (native-inputs
-    `(("texinfo" ,texinfo)
-      ("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
+    (list texinfo automake)) ; For up to date 'config.guess' and 'config.sub'.
    (synopsis "Code reformatter")
    (description
     "Indent is a program that makes source code easier to read by
@@ -936,3 +924,32 @@ extensions over the standard utility.")
       (description "amalgamate.py aims to make it easy to use SQLite-style C
 source and header amalgamation in projects.")
       (license license:bsd-3))))
+
+(define-public cscope
+  (package
+    (name "cscope")
+    (version "15.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/cscope/cscope/"
+                           "v" version "/cscope-" version ".tar.gz"))
+       (sha256
+        (base32 "0ngiv4aj3rr35k3q3wjx0y19gh7i1ydqa0cqip6sjwd8fph5ll65"))))
+    (build-system gnu-build-system)
+    (inputs (list ncurses))
+    (arguments
+     `(#:configure-flags
+       ;; Specify the correct ncurses directory to prevent incorrect fallback
+       ;; on SysV curses.
+       (list (string-append "--with-ncurses="
+                            (assoc-ref %build-inputs "ncurses")))))
+    (home-page "http://cscope.sourceforge.net")
+    (synopsis "Tool for browsing source code")
+    (description
+     "Cscope is a text screen based source browsing tool. Although it is
+primarily designed to search C code (including lex and yacc files), it can
+also be used for C++ code.
+
+Using cscope, you can easily search for where symbols are used and defined.")
+    (license license:bsd-3)))