projects/guix·blob astro-update · refs

1143 lines · 47.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2013, 2015, 2018, 2020, 2021, 2023, 2025 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013, 2015 Andreas Enge <[email protected]>
4;;; Copyright © 2015, 2018 Ricardo Wurmus <[email protected]>
5;;; Copyright © 2016, 2017, 2018, 2019-2024 Efraim Flashner <[email protected]>
6;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2017, 2018 Clément Lassieur <[email protected]>
8;;; Copyright © 2017 Andy Wingo <[email protected]>
9;;; Copyright © 2018 Fis Trivial <[email protected]>
10;;; Copyright © 2018 Pierre Neidhardt <[email protected]>
11;;; Copyright © 2014 Eric Bavier <[email protected]>
12;;; Copyright © 2014 Mark H Weaver <[email protected]>
13;;; Copyright © 2019 Hartmut Goebel <[email protected]>
14;;; Copyright © 2020, 2022 Maxim Cournoyer <[email protected]>
15;;; Copyright © 2020, 2021, 2023 Marius Bakke <[email protected]>
16;;; Copyright © 2020 Julien Lepiller <[email protected]>
17;;; Copyright © 2021 lu hui <[email protected]>
18;;; Copyright © 2022 Michael Rohleder <[email protected]>
19;;; Copyright © 2023 Fries <[email protected]>
20;;; Copyright © 2023 Zheng Junjie <[email protected]>
21;;; Copyright © 2024 Sharlatan Hellseher <[email protected]>
22;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
23;;; Copyright © 2024 Jordan Moore <[email protected]>
24;;; Copyright © 2025 Nicolas Graves <[email protected]>
25;;; Copyright © 2025 Ada Stevenson <[email protected]>
26;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
27;;; Copyright © 2026 Luca Kredel <[email protected]>
28;;;
29;;; This file is part of GNU Guix.
30;;;
31;;; GNU Guix is free software; you can redistribute it and/or modify it
32;;; under the terms of the GNU General Public License as published by
33;;; the Free Software Foundation; either version 3 of the License, or (at
34;;; your option) any later version.
35;;;
36;;; GNU Guix is distributed in the hope that it will be useful, but
37;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39;;; GNU General Public License for more details.
40;;;
41;;; You should have received a copy of the GNU General Public License
42;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43
44(define-module (gnu packages code)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix gexp)
47 #:use-module (guix packages)
48 #:use-module (guix utils)
49 #:use-module (guix download)
50 #:use-module (guix git-download)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system pyproject)
54 #:use-module (guix build-system trivial)
55 #:use-module (guix build-system go)
56 #:use-module (gnu packages)
57 #:use-module (gnu packages autogen)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages bash)
61 #:use-module (gnu packages bison)
62 #:use-module (gnu packages boost)
63 #:use-module (gnu packages c)
64 #:use-module (gnu packages check)
65 #:use-module (gnu packages compression)
66 #:use-module (gnu packages cpp)
67 #:use-module (gnu packages curl)
68 #:use-module (gnu packages elf)
69 #:use-module (gnu packages emacs)
70 #:use-module (gnu packages compiler-tools)
71 #:use-module (gnu packages gcc)
72 #:use-module (gnu packages gettext)
73 #:use-module (gnu packages golang-build)
74 #:use-module (gnu packages golang-crypto)
75 #:use-module (gnu packages golang-web)
76 #:use-module (gnu packages golang-xyz)
77 #:use-module (gnu packages graphviz)
78 #:use-module (gnu packages linux)
79 #:use-module (gnu packages llvm)
80 #:use-module (gnu packages logging)
81 #:use-module (gnu packages lua)
82 #:use-module (gnu packages ncurses)
83 #:use-module (gnu packages pcre)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages perl-compression)
86 #:use-module (gnu packages pkg-config)
87 #:use-module (gnu packages pretty-print)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages python-build)
90 #:use-module (gnu packages python-web)
91 #:use-module (gnu packages python-xyz)
92 #:use-module (gnu packages qt)
93 #:use-module (gnu packages readline)
94 #:use-module (gnu packages regex)
95 #:use-module (gnu packages serialization)
96 #:use-module (gnu packages sqlite)
97 #:use-module (gnu packages texinfo)
98 #:use-module (gnu packages tls)
99 #:use-module (gnu packages web)
100 #:use-module (gnu packages xml)
101 #:use-module (srfi srfi-1))
102
103;;; Tools to deal with source code: metrics, cross-references, etc.
104
105(define-public amalgamate
106 (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208")
107 (revision "0")
108 (version (git-version "1.1.1" revision commit)))
109 (package
110 (name "amalgamate")
111 (version version)
112 (home-page "https://github.com/edlund/amalgamate")
113 (source
114 (origin
115 (method git-fetch)
116 (uri (git-reference
117 (url home-page)
118 (commit commit)))
119 (sha256
120 (base32
121 "0cllaraw8mxs8q2nr28nhgzkb417gj2wcklqg59w84f4lc78k3yb"))
122 (file-name (git-file-name name version))
123 (modules '((guix build utils)))
124 (snippet
125 '(substitute* "test.sh"
126 (("test_command \"cc -Wall -Wextra -o source.out source.c\"" all)
127 "test_command \"gcc -Wall -Wextra -o source.out source.c\"")))))
128 (build-system gnu-build-system)
129 (inputs (list python-wrapper))
130 (arguments
131 `(#:phases
132 (modify-phases %standard-phases
133 (delete 'configure)
134 (delete 'build)
135 (replace 'install
136 (lambda* (#:key outputs #:allow-other-keys)
137 (let* ((out (assoc-ref outputs "out"))
138 (bin (string-append out "/bin")))
139 (install-file "amalgamate.py" bin))))
140 (replace 'check
141 (lambda _
142 (invoke "./test.sh"))))))
143 (synopsis "Tool for amalgamating C source and header files")
144 ;; The package is indeed a script file, and the term "amalgamate.py" is
145 ;; used by upstream.
146 (description "amalgamate.py aims to make it easy to use SQLite-style C
147source and header amalgamation in projects.")
148 (license license:bsd-3))))
149
150(define-public automatic-component-toolkit
151 (package
152 (name "automatic-component-toolkit")
153 (version "1.6.0")
154 (home-page "https://github.com/Autodesk/AutomaticComponentToolkit")
155 (source (origin
156 (method git-fetch)
157 (uri (git-reference (url home-page)
158 (commit (string-append "v" version))))
159 (file-name (git-file-name name version))
160 (sha256
161 (base32
162 "1r0sbw82cf9dbcj3vgnbd4sc1lklzvijic2z5wgkvs21azcm0yzh"))))
163 (build-system go-build-system)
164 (arguments
165 (list
166 #:tests? #f ;no tests
167 #:install-source? #f
168 #:import-path "github.com/Autodesk/AutomaticComponentToolkit/cmd/act"
169 #:unpack-path "github.com/Autodesk/AutomaticComponentToolkit/"
170 #:phases
171 #~(modify-phases %standard-phases
172 ;; Golang produces the final binary based on the current directory
173 ;; name if -o options is not provided, utilize this assumption to
174 ;; completely relay on go-build-system.
175 (add-before 'build 'pretend-cmd-act
176 (lambda* (#:key unpack-path #:allow-other-keys)
177 (let ((act (string-append "src/" unpack-path "/cmd/act"))
178 (source (string-append "src/" unpack-path "/Source")))
179 (mkdir-p act)
180 (copy-recursively source act)))))))
181 (synopsis "Automatically generate software components")
182 (description
183 "The Automatic Component Toolkit (@dfn{ACT}) is a code generator that
184takes an instance of an Interface Description Language (@dfn{IDL}) file and
185generates a thin C89-API, implementation stubs, and language bindings of your
186desired software component.")
187 (license license:bsd-2)))
188
189(define-public cflow
190 (package
191 (name "cflow")
192 (version "1.8")
193 (source (origin
194 (method url-fetch)
195 (uri (string-append "mirror://gnu/cflow/cflow-"
196 version ".tar.bz2"))
197 (sha256
198 (base32
199 "1f4s979phyjz8qss10d0fqa4paa6z3wwdz23d9zqgixnamxn48c3"))))
200 (build-system gnu-build-system)
201
202 ;; Needed to have cflow-mode.el installed.
203 (native-inputs
204 (list emacs-minimal))
205 (arguments
206 '(#:configure-flags (list (string-append "CPPFLAGS="
207 "-D" "CFLOW_PREPROC=\\\""
208 (assoc-ref %build-inputs "gcc")
209 "/bin/cpp\\\""))))
210 (home-page "https://www.gnu.org/software/cflow/")
211 (synopsis "Create a graph of control flow within a program")
212 (description
213 "GNU cflow analyzes C source files and produces a graph charting the
214control flow of the program. It can output the graph in several styles and
215in either the POSIX format or in an extended GNU format. cflow also includes
216a major mode for Emacs for examining the flowcharts that it produces.")
217 (license license:gpl3+)))
218
219(define-public complexity
220 (package
221 (name "complexity")
222 (version "1.10")
223 (source (origin
224 (method url-fetch)
225 (uri (string-append "mirror://gnu/complexity/complexity-"
226 version ".tar.xz"))
227 (sha256
228 (base32
229 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
230 (build-system gnu-build-system)
231 (arguments
232 (list #:phases
233 #~(modify-phases %standard-phases
234 (add-before 'build 'set-man-page-date
235 ;; Avoid embedding the current date for reproducible builds
236 (lambda _
237 (setenv "MAN_PAGE_DATE" "2012-04-18"))))))
238 (native-inputs
239 (list texinfo autogen))
240 (home-page "https://www.gnu.org/software/complexity/")
241 (synopsis "Analyze complexity of C functions")
242 (description
243 "GNU complexity provides tools for finding procedures that are
244convoluted, overly long or otherwise difficult to understand. This
245may help in learning or reviewing unfamiliar code or perhaps
246highlighting your own code that seemed comprehensible when you wrote it.")
247 (license license:gpl3+)))
248
249(define-public cscope
250 (package
251 (name "cscope")
252 (version "15.9")
253 (source
254 (origin
255 (method url-fetch)
256 (uri (string-append "mirror://sourceforge/cscope/cscope/"
257 "v" version "/cscope-" version ".tar.gz"))
258 (sha256
259 (base32 "0ngiv4aj3rr35k3q3wjx0y19gh7i1ydqa0cqip6sjwd8fph5ll65"))))
260 (build-system gnu-build-system)
261 (inputs (list ncurses))
262 (arguments
263 `(#:configure-flags
264 ;; Specify the correct ncurses directory to prevent incorrect fallback
265 ;; on SysV curses.
266 (list (string-append "--with-ncurses="
267 (assoc-ref %build-inputs "ncurses")))))
268 (home-page "https://cscope.sourceforge.net")
269 (synopsis "Tool for browsing source code")
270 (description
271 "Cscope is a text screen based source browsing tool. Although it is
272primarily designed to search C code (including lex and yacc files), it can
273also be used for C++ code.
274
275Using cscope, you can easily search for where symbols are used and defined.")
276 (license license:bsd-3)))
277
278(define-public global ; a global variable
279 (package
280 (name "global")
281 (version "6.7")
282 (source (origin
283 (method url-fetch)
284 (uri (string-append "mirror://gnu/global/global-"
285 version ".tar.gz"))
286 (sha256
287 (base32
288 "1xwbbhm5yydhpfdspsywwid5kj62c1z1ricrbvanhbfskc65kazx"))))
289 (build-system gnu-build-system)
290 (arguments
291 (list #:configure-flags
292 #~(list (string-append "--with-ncurses="
293 #$(this-package-input "ncurses"))
294 (string-append "--with-sqlite3="
295 #$(this-package-input "sqlite"))
296 (string-append "--with-universal-ctags="
297 #$(this-package-input "universal-ctags")
298 "/bin/ctags")
299 ;; Otherwise this gets overridden in the 'configure phase.
300 (string-append "--with-python-interpreter="
301 #$(this-package-input "python-wrapper")
302 "/bin/python")
303 (string-append "--sysconfdir="
304 #$output "/share/gtags")
305 "--localstatedir=/var" ; This needs to be a writable location.
306 "--disable-static")
307
308 #:phases
309 #~(modify-phases %standard-phases
310 (add-after 'unpack 'fix-globash
311 (lambda* (#:key inputs #:allow-other-keys)
312 (substitute* "globash/globash.in"
313 (("/bin/echo")
314 (search-input-file inputs "bin/echo")))))
315 (add-after 'install 'post-install
316 (lambda _
317 ;; Install the plugin files in the right place.
318 (let* ((data (string-append #$output "/share/gtags"))
319 (vim (string-append
320 #$output
321 "/share/vim/vimfiles/pack/guix/start/global/plugin"))
322 (lisp (string-append #$output "/share/emacs/site-lisp/"
323 #$(package-name this-package) "-"
324 #$(package-version this-package))))
325 (mkdir-p lisp)
326 (mkdir-p vim)
327 (rename-file (string-append data "/gtags.el")
328 (string-append lisp "/gtags.el"))
329 (rename-file (string-append data "/gtags.vim")
330 (string-append vim "/gtags.vim"))
331 (rename-file (string-append data "/gtags-cscope.vim")
332 (string-append vim "/gtags-cscope.vim")))))
333 (add-after 'post-install 'install-plugins
334 (lambda _
335 (with-directory-excursion "plugin-factory"
336 (invoke "make" "install"))))
337 (add-before 'install 'dont-install-to-/var
338 (lambda _
339 (substitute* "gozilla/Makefile"
340 (("DESTDIR\\)\\$\\{localstatedir\\}")
341 "TMPDIR)"))))
342 (add-after 'install-plugins 'wrap-program
343 (lambda _
344 (wrap-program
345 (string-append #$output
346 "/share/gtags/script/pygments_parser.py")
347 `("GUIX_PYTHONPATH" ":" prefix
348 (,(getenv "GUIX_PYTHONPATH")))))))))
349 (inputs
350 (list bash-minimal ; for wrap-program
351 coreutils
352 universal-ctags
353 libltdl
354 ncurses
355 python-pygments
356 python-wrapper
357 sqlite))
358 (home-page "https://www.gnu.org/software/global/")
359 (synopsis "Cross-environment source code tag system")
360 (description
361 "GNU GLOBAL is a source code tagging system that functions in the same
362way across a wide array of environments, such as different text editors,
363shells and web browsers. The resulting tags are useful for quickly moving
364around in a large, deeply nested project.")
365 (license license:gpl3+)))
366
367(define-public sloccount
368 (package
369 (name "sloccount")
370 (version "2.26")
371 (source (origin
372 (method url-fetch)
373 (uri (string-append "https://dwheeler.com/sloccount/sloccount-"
374 version ".tar.gz"))
375 (sha256
376 (base32
377 "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs"))))
378 (build-system gnu-build-system)
379 (arguments
380 '(#:phases (modify-phases %standard-phases
381 (delete 'configure)
382 (add-before 'build 'make-dotl-files-older
383 (lambda _
384 ;; Make the '.l' files as old as the '.c'
385 ;; files to avoid triggering the rule that
386 ;; requires Flex.
387 (define ref
388 (stat "README"))
389
390 (for-each (lambda (file)
391 (set-file-time file ref))
392 (find-files "." "\\.[chl]$"))
393 #t))
394 (add-before 'install 'make-target-directories
395 (lambda* (#:key outputs #:allow-other-keys)
396 (let ((out (assoc-ref outputs "out")))
397 (mkdir-p (string-append out "/bin"))
398 (mkdir-p (string-append out
399 "/share/man/man1"))
400 (mkdir-p (string-append out
401 "/share/doc"))
402 #t)))
403 (replace 'check
404 (lambda _
405 (setenv "HOME" (getcwd))
406 (setenv "PATH"
407 (string-append (getcwd) ":"
408 (getenv "PATH")))
409 (invoke "make" "test"))))
410
411 #:make-flags (list (string-append "PREFIX="
412 (assoc-ref %outputs "out")))))
413 (inputs (list perl))
414 (home-page "https://dwheeler.com/sloccount/")
415 (synopsis "Count physical source lines of code (SLOC)")
416 (description
417 "SLOCCount is a set of the programs for counting source lines of
418code (SLOC) in large software systems. It can automatically identify and
419measure a wide range of programming languages. It automatically estimates the
420effort, time, and money it would take to develop the software, using the
421COCOMO model or user-provided parameters.")
422 (license license:gpl2+)))
423
424(define-public cloc
425 (package
426 (name "cloc")
427 (version "2.10")
428 (source
429 (origin
430 (method git-fetch)
431 (uri (git-reference
432 (url "https://github.com/AlDanial/cloc")
433 (commit (string-append "v" version))))
434 (file-name (git-file-name name version))
435 (sha256
436 (base32 "03isq42ndgg7gr1wpmn8ax2hx7dh00nfx02xzfcya5grc7dn95q7"))))
437 (build-system gnu-build-system)
438 (inputs
439 (list bash-minimal
440 coreutils
441 perl
442 perl-algorithm-diff
443 perl-digest-md5
444 perl-parallel-forkmanager
445 perl-regexp-common))
446 (arguments
447 `(#:phases (modify-phases %standard-phases
448 (delete 'configure) ; nothing to configure
449 (delete 'build) ; nothing to build
450 (replace 'install
451 (lambda* (#:key inputs outputs #:allow-other-keys)
452 (let* ((out (assoc-ref outputs "out")))
453 (invoke "make" "-C" "Unix"
454 (string-append "prefix=" out)
455 (string-append "INSTALL="
456 (assoc-ref inputs "coreutils")
457 "/bin/install")
458 "install"))))
459 (add-after 'install 'wrap-program
460 (lambda* (#:key inputs outputs #:allow-other-keys)
461 (let ((out (assoc-ref outputs "out")))
462 (wrap-program (string-append out "/bin/cloc")
463 `("PERL5LIB" ":" =
464 ,(string-split (getenv "PERL5LIB") #\:)))))))
465 #:out-of-source? #t
466 ;; Tests require some other packages.
467 #:tests? #f))
468 (home-page "https://github.com/AlDanial/cloc")
469 (synopsis "Count source lines of code (SLOC) and other source code metrics")
470 (description "cloc counts blank lines, comment lines, and physical lines
471of source code in many programming languages. Given two versions of a code
472base, cloc can compute differences in blank, comment, and source lines.
473
474cloc contains code from David Wheeler's SLOCCount. Compared to SLOCCount,
475cloc can handle a greater variety of programming languages.")
476 (license license:gpl2+)))
477
478(define-public scc
479 (package
480 (name "scc")
481 (version "3.7.0")
482 (source
483 (origin
484 (method git-fetch)
485 (uri (git-reference
486 (url "https://github.com/boyter/scc")
487 (commit (string-append "v" version))))
488 (file-name (git-file-name name version))
489 (sha256
490 (base32 "1kybs8849whpl1rgbgnwcy0z9nb1jzcjdimba91n6zng9ksz9sl0"))))
491 (build-system go-build-system)
492 (arguments
493 (list
494 #:install-source? #f
495 #:import-path "github.com/boyter/scc"))
496 (native-inputs
497 (list go-github-com-agnivade-levenshtein
498 go-github-com-boyter-gocodewalker
499 go-github-com-boyter-simplecache
500 go-github-com-json-iterator-go
501 go-github-com-mattn-go-runewidth
502 go-github-com-rs-zerolog
503 go-github-com-spf13-cobra
504 go-github-com-spf13-pflag
505 go-go-yaml-in-yaml-v2
506 go-golang-org-x-crypto
507 go-golang-org-x-text))
508 (home-page "https://github.com/boyter/scc")
509 (synopsis "Fast code counter written in Go")
510 (description
511 "@command{scc} provides a lines-of-code counter similar to tools like
512@command{cloc} and @command{sloccount}. It aims to be fast as possible while
513supporting @acronym{COCOMO,Constructive Cost Model} calculation and code
514complexity estimation.")
515 (license license:expat)))
516
517(define-public the-silver-searcher
518 (package
519 (name "the-silver-searcher")
520 (version "2.2.0")
521 (source (origin
522 (method url-fetch)
523 (uri (string-append
524 "https://geoff.greer.fm/ag/releases/the_silver_searcher-"
525 version ".tar.gz"))
526 (sha256
527 (base32
528 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
529 (build-system gnu-build-system)
530 (arguments
531 ;; Required since GCC 10, see:
532 ;; https://gcc.gnu.org/gcc-10/porting_to.html.
533 `(#:configure-flags (list "CFLAGS=-fcommon")))
534 (native-inputs
535 (list pkg-config))
536 (inputs
537 (list pcre xz zlib))
538 (home-page "https://geoff.greer.fm/ag/")
539 (synopsis "Fast code searching tool")
540 (description
541 "The Silver Searcher (@command{ag}) is a tool for quickly searching large
542numbers of files. It's intended primarily for source code repositories, and
543respects files like @file{.gitignore} and @file{.hgignore}. It's also an order
544of magnitude faster than its inspiration, @command{ack}, and less specialised
545tools such as @command{grep}.")
546 (license license:asl2.0)))
547
548(define-public trio
549 (package
550 (name "trio")
551 (version "1.16")
552 (source (origin
553 (method url-fetch)
554 (uri (string-append "mirror://sourceforge/ctrio/trio/trio-"
555 version ".tar.gz"))
556 (sha256
557 (base32
558 "02pwd5m5vq7hbrffgm2na1dfc249z50yyr5jv73vdw15bd7ygl44"))))
559 (build-system gnu-build-system)
560 (home-page "https://daniel.haxx.se/projects/trio/")
561 (synopsis "Portable and extendable printf and string functions")
562 (description
563 "Trio is a set of @code{printf} and string functions designed be used by
564applications with a focus on portability or with the need for additional
565features that are not supported by the standard @code{stdio} implementation.")
566 ;; This license is very similar to the ISC license, but the wording is
567 ;; slightly different.
568 (license (license:non-copyleft
569 "http://sourceforge.net/p/ctrio/git/ci/master/tree/README"))))
570
571(define-public lcov
572 (package
573 (name "lcov")
574 (version "1.16")
575 (source
576 (origin
577 (method url-fetch)
578 (uri (string-append "https://github.com/linux-test-project/lcov"
579 "/releases/download/v" version
580 "/lcov-" version ".tar.gz"))
581 (sha256
582 (base32 "02r4wdl5d694aaxc5fgjw4nl3zmzq45khaxmsi3agj18annk2w4q"))))
583 (build-system gnu-build-system)
584 (arguments
585 '(#:test-target "test"
586 #:make-flags (list (string-append "PREFIX="
587 (assoc-ref %outputs "out")))
588 ;; This test suite has race conditions in its scripts which make it
589 ;; unreliable when run in parallel.
590 #:parallel-tests? #f
591 #:phases
592 (modify-phases %standard-phases
593 (add-after 'unpack 'patch-references-to-commands
594 (lambda* (#:key inputs #:allow-other-keys)
595 ;; Lift the requirement of having a shell and 'find' in PATH.
596 (substitute* "bin/geninfo"
597 (("qw/abs_path/")
598 "qw/abs_path getcwd/"))
599 (substitute* '("bin/lcov" "bin/geninfo")
600 (("`pwd`")
601 "getcwd()")
602 (("`find ")
603 (string-append "`"
604 (search-input-file inputs "/bin/find")
605 " ")))))
606 (delete 'configure) ;no configure script
607 (add-after 'install 'wrap
608 (lambda* (#:key outputs #:allow-other-keys)
609 (let ((out (assoc-ref outputs "out")))
610 (wrap-program (string-append out "/bin/geninfo")
611 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))))))))
612 (inputs (list bash-minimal perl perl-io-compress perl-json))
613 (home-page "https://ltp.sourceforge.net/coverage/lcov.php")
614 (synopsis "Code coverage tool that enhances GNU gcov")
615 (description "LCOV is an extension of @command{gcov}, a tool part of the
616GNU@tie{}Binutils, which provides information about what parts of a program
617are actually executed (i.e., \"covered\") while running a particular test
618case. The extension consists of a set of Perl scripts which build on the
619textual @command{gcov} output to implement the following enhanced
620functionality such as HTML output.")
621 (license license:gpl2+)))
622
623(define-public lcov-cobertura
624 (package
625 (name "lcov-cobertura")
626 (version "2.1.1")
627 (source
628 (origin
629 (method url-fetch)
630 (uri (pypi-uri "lcov_cobertura" version))
631 (sha256
632 (base32 "13xmr249c6qygm14gilb0icrsgb35ghsrr14a1zvppmxy9jf5a7g"))))
633 (build-system pyproject-build-system)
634 (arguments
635 (list
636 #:phases
637 #~(modify-phases %standard-phases
638 (add-after 'unpack 'patch-source
639 (lambda _
640 ;; Prevent setuptools.errors.InvalidConfigError:
641 ;; License classifiers have been superseded by license expressions
642 ;; (see https://peps.python.org/pep-0639/). Please remove:
643 ;; License :: OSI Approved :: Apache Software License
644 ;; Reported upstream:
645 ;; https://github.com/eriwen/lcov-to-cobertura-xml/pull/65
646 (substitute* "setup.cfg"
647 (("\tLicense :: OSI Approved :: Apache Software License\n")
648 "")))))))
649 (native-inputs
650 (list python-pytest
651 python-setuptools
652 python-setuptools-scm
653 python-wheel
654 python-xmldiff))
655 (home-page "https://eriwen.github.io/lcov-to-cobertura-xml/")
656 (synopsis "LCOV to Cobertura XML converter")
657 (description
658 "The lcov-to-cobertura Python module converts code coverage report files
659in the lcov format to the XML format of
660@uref{http://cobertura.github.io/cobertura/, Cobertura}, a Java code coverage
661tool. It allows continuous integration servers like Jenkins to aggregate
662results and determine build stability.")
663 (license license:asl2.0)))
664
665(define-public kcov
666 (package
667 (name "kcov")
668 (version "42")
669 (source (origin
670 (method git-fetch)
671 (uri (git-reference
672 (url "https://github.com/SimonKagstrom/kcov")
673 (commit (string-append "v" version))))
674 (file-name (git-file-name name version))
675 (sha256
676 (base32
677 "14pyahpgadh845q2p1gjw2yrlqcan4n870icrn2yqdpf33cprzgk"))))
678 (build-system cmake-build-system)
679 (arguments
680 `(#:tests? #f ; no test target
681 #:phases
682 (modify-phases %standard-phases
683 (add-after 'unpack 'fix-/bin/bash-references
684 (lambda* (#:key inputs #:allow-other-keys)
685 (substitute* (find-files "src" ".*\\.cc?$")
686 (("/bin/(bash|sh)" shell)
687 (search-input-file inputs shell))))))))
688 (inputs
689 (list curl elfutils libelf openssl zlib))
690 (native-inputs
691 (list python))
692 (home-page "https://github.com/SimonKagstrom/kcov")
693 (synopsis "Code coverage tester for compiled languages, Python and Bash")
694 (description "Kcov is a code coverage tester for compiled languages,
695Python and Bash. It was originally a fork of Bcov, but has since evolved to
696support a large feature set in addition to that of Bcov.
697
698Kcov uses DWARF debugging information for compiled programs to make it
699possible to collect coverage information without special compiler switches.")
700 (license license:gpl2+)))
701
702(define-public colormake
703 (package
704 (name "colormake")
705 (version "0.9.20140503")
706 (source
707 (origin
708 (method git-fetch)
709 (uri (git-reference
710 (url "https://github.com/pagekite/Colormake")
711 (commit version)))
712 (file-name (git-file-name name version))
713 (sha256
714 (base32 "1f9v5s0viq4yc9iv6701h3pv7j21zz1ckl37lpp9hsnliiizv03p"))))
715 (build-system trivial-build-system)
716 (native-inputs
717 (list bash perl))
718 (arguments
719 `(#:modules ((guix build utils))
720 #:builder
721 (begin
722 (use-modules (guix build utils))
723 (copy-recursively (assoc-ref %build-inputs "source") "source")
724 (chdir "source")
725 (patch-shebang "colormake.pl"
726 (list (string-append (assoc-ref %build-inputs "perl")
727 "/bin")))
728 (let* ((out (assoc-ref %outputs "out"))
729 (bin (string-append out "/bin"))
730 (doc (string-append out "/share/doc"))
731 (install-files (lambda (files directory)
732 (for-each (lambda (file)
733 (install-file file directory))
734 files))))
735 (substitute* "colormake"
736 (("colormake\\.pl") (string-append bin "/colormake.pl"))
737 (("/bin/bash")
738 (search-input-file %build-inputs "/bin/sh")))
739 (install-file "colormake.1" (string-append doc "/man/man1"))
740 (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc)
741 (install-files '("colormake" "colormake-short" "clmake"
742 "clmake-short" "colormake.pl")
743 bin)
744 #t))))
745 (home-page "https://bre.klaki.net/programs/colormake/")
746 (synopsis "Wrapper around @command{make} to produce colored output")
747 (description "This package provides a wrapper around @command{make} to
748produce colored output.")
749 (license license:gpl2+)))
750
751(define-public makefile2graph
752 (package
753 (name "makefile2graph")
754 (version "1.5.0")
755 (source
756 (origin
757 (method git-fetch)
758 (uri (git-reference
759 (url "https://github.com/lindenb/makefile2graph")
760 (commit (string-append "v" version))))
761 (file-name (git-file-name name version))
762 (sha256
763 (base32 "1gjfk3d8qg3cla7qd2y7r9s03whlfwy83q8k76xfcnqrjjfavdgk"))))
764 (build-system gnu-build-system)
765 (arguments
766 (list
767 #:test-target "test"
768 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
769 (string-append "prefix=" #$output))
770 #:phases
771 #~(modify-phases %standard-phases
772 (delete 'configure))))
773 (native-inputs
774 (list graphviz))
775 (home-page "https://github.com/lindenb/makefile2graph")
776 (synopsis "Creates a graph of dependencies from GNU Make")
777 (description
778 "@code{make2graph} creates a graph of dependencies from GNU Make. The
779output is a graphviz-dot file, a Gexf-XML file or a list of the deepest
780independent targets.")
781 (license license:expat)))
782
783(define-public uncrustify
784 (package
785 (name "uncrustify")
786 (version "0.80.1")
787 (source (origin
788 (method git-fetch)
789 (uri (git-reference
790 (url "https://github.com/uncrustify/uncrustify/")
791 (commit (string-append name "-" version))))
792 (file-name (git-file-name name version))
793 (sha256
794 (base32
795 "1n7ifr4i35ii5zaia61jdd61virbygc00anhc9iq3p5gzjlfxhsa"))))
796 (build-system cmake-build-system)
797 (native-inputs (list python-wrapper))
798 (arguments
799 (list #:phases
800 #~(modify-phases %standard-phases
801 (add-after 'unpack 'unpack-etc
802 (lambda* (#:key inputs outputs #:allow-other-keys)
803 ;; Configuration samples are not installed by default.
804 (let* ((output (assoc-ref outputs "out"))
805 (etcdir (string-append output "/etc")))
806 (for-each (lambda (l)
807 (install-file l etcdir))
808 (find-files "etc" "\\.cfg$"))))))))
809 (home-page "https://uncrustify.sourceforge.net/")
810 (synopsis "Code formatter for C and other related languages")
811 (description
812 "Beautify source code in many languages of the C family (C, C++, C#,
813Objective@tie{}C, D, Java, Pawn, and Vala). Features:
814@itemize
815@item Indent and align code.
816@item Reformat comments (a little bit).
817@item Fix inter-character spacing.
818@item Add or remove parens / braces.
819@item Supports embedded SQL @code{EXEC SQL} stuff.
820@item Highly configurable - More than 600 configurable options.
821@end itemize\n")
822 (license license:gpl2+)))
823
824(define-public astyle
825 (package
826 (name "astyle")
827 (version "3.5")
828 (source
829 (origin
830 (method url-fetch)
831 (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
832 version "/astyle-" version ".tar.bz2"))
833 (sha256
834 (base32 "0g4jyp47iz97ld9ac4wb5k59j4cs8dbw4dp8f32bwqx8pyvirz6y"))))
835 (build-system gnu-build-system)
836 (arguments
837 (list
838 #:tests? #f ;no tests
839 #:make-flags
840 #~(list (string-append "prefix=" #$output)
841 "INSTALL=install"
842 "release" "shared")
843 #:phases
844 #~(modify-phases %standard-phases
845 (add-after 'unpack 'patch-makefile
846 (lambda _
847 (substitute* "build/gcc/Makefile"
848 (("CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c\\+\\+11")
849 "CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c++17"))))
850 (replace 'configure
851 (lambda _
852 (chdir "build/gcc")))
853 (add-after 'install 'install-more
854 (lambda* (#:key outputs #:allow-other-keys)
855 ;; Libraries and headers aren't installed by default.
856 (let ((include (string-append #$output "/include"))
857 (lib (string-append #$output "/lib")))
858 (mkdir-p include)
859 (copy-file "../../src/astyle.h"
860 (string-append include "/astyle.h"))
861 (mkdir-p lib)
862 (for-each (lambda (l)
863 (copy-file
864 l (string-append lib "/" (basename l))))
865 (find-files "bin" "^lib.*\\.so"))))))))
866 (home-page "https://astyle.sourceforge.net/")
867 (synopsis "Source code indenter, formatter, and beautifier")
868 (description
869 "Artistic Style is a source code indenter, formatter, and beautifier for
870the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
871 (license license:lgpl3+)))
872
873(define-public idutils
874 (package
875 (name "idutils")
876 (version "4.6")
877 (source
878 (origin
879 (method url-fetch)
880 (uri (string-append "mirror://gnu/idutils/idutils-" version ".tar.xz"))
881 (sha256
882 (base32 "1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c1"))
883 (modules '((guix build utils)))
884 (snippet
885 '(begin
886 (substitute* (find-files "lib" "\\.c$")
887 (("#if defined _IO_ftrylockfile")
888 "#if defined _IO_EOF_SEEN"))
889 (substitute* "lib/stdio-impl.h"
890 (("^/\\* BSD stdio derived implementations")
891 (string-append
892 "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN" "\n"
893 "# define _IO_IN_BACKUP 0x100\n" "#endif\n\n"
894 "/* BSD stdio derived implementations")))
895
896 ;; 'gets' is deprecated in glibc 2.33 and its declaration is
897 ;; no longer visible by default from <stdio.h>.
898 (substitute* "lib/stdio.in.h"
899 (("_GL_WARN_ON_USE \\(gets.*")
900 ""))))))
901 (build-system gnu-build-system)
902 (native-inputs (list emacs-minimal))
903 (home-page "https://www.gnu.org/software/idutils/")
904 (synopsis "Identifier database utilities")
905 (description
906 "The GNU idutils package includes tools to create an index of textual
907tokens used in a list of file names and then to query that index. Thus, it
908allows the user to, for example, find all the uses of a particular function
909in a large programming project. In addition to handling textual tokens, it
910can also handle numeric constants and the contents of character strings.")
911 (license license:gpl3+)))
912
913(define-public indent
914 ;; XXX: Not released anymore, but some patches fix CVEs.
915 (let ((commit "1737c929cbe2ec8a181107df9742894a44c57f71")
916 (revision "0"))
917 (package
918 (name "indent")
919 (version (git-version "2.2.13" revision commit))
920 (source
921 (origin
922 (method git-fetch)
923 (uri (git-reference
924 (url "https://git.savannah.gnu.org/git/indent")
925 (commit commit)))
926 (file-name (git-file-name name version))
927 (sha256
928 (base32 "138bqlwvfjv3w1plw2zzf0nqw38lhgimzx1gic6p8r5kizjp9123"))))
929 (build-system gnu-build-system)
930 (arguments
931 (list #:phases
932 #~(modify-phases %standard-phases
933 (add-after 'unpack 'patch-bootstrap
934 (lambda _
935 (substitute* "bootstrap"
936 (("^(wget|\\./configure|rm)" all)
937 (string-append "#" all)))
938 (call-with-output-file "doc/version.texi"
939 (lambda (port)
940 (format port "\
941@set UPDATED
942@set EDITION ~a
943@set VERSION ~a"
944 #$version
945 #$version))))))))
946 (native-inputs
947 (list autoconf-2.71 automake gettext-minimal texinfo))
948 (home-page "https://www.gnu.org/software/indent/")
949 (synopsis "Code reformatter")
950 (description
951 "Indent is a program that makes source code easier to read by
952reformatting it in a consistent style. It can change the style to one of
953several different styles such as GNU, BSD or K&R. It has some flexibility to
954deal with incomplete or malformed syntax. GNU indent offers several
955extensions over the standard utility.")
956 (license license:gpl3+)
957 (properties '((lint-hidden-cves . ("CVE-2023-40305"
958 "CVE-2024-0911")))))))
959
960(define-public sourcetrail
961 (package
962 (name "sourcetrail")
963 (version "2.1.0")
964 (source
965 (origin
966 (method git-fetch)
967 (uri (git-reference
968 (url "https://github.com/OpenSourceSourceTrail/Sourcetrail")
969 (commit version)
970 (recursive? #t)))
971 (patches (search-patches "sourcetrail-fix-cmakelists-and-paths.patch"))
972 (file-name (git-file-name name version))
973 (sha256
974 "0ya737byp1204sc5l11zi7fn7fgvqmcwyq84lbdxhyjvyfhb8598")
975 (modules '((guix build utils)))
976 (snippet #~(begin
977 (for-each delete-file-recursively
978 '(".conan" ".devcontainer"
979 ".github"
980 "conanfile.txt"
981 "scripts"
982 "bin/app/data/install"
983 "bin/app/user/log"))))))
984 (build-system cmake-build-system)
985 (arguments
986 (let* ((split-version (string-split version
987 (lambda (c)
988 (or (eqv? c #\.)
989 (eqv? c #\-)))))
990 (major-version (first split-version))
991 (minor-version (second split-version))
992 (version-patch (third split-version)))
993 (list #:configure-flags #~(list "-DENABLE_UNIT_TEST=true"
994 "-DENABLE_GUI_TEST=true"
995 "-DENABLE_INTERGRATION_TEST=true"
996 (string-append "-DVERSION_MAJOR="
997 #$major-version)
998 (string-append "-DVERSION_MINOR="
999 #$minor-version)
1000 (string-append "-DVERSION_PATCH="
1001 #$version-patch)
1002 "-DLLVM_ENABLE_PROJECTS:STRING=clang"
1003 "-DLLVM_ENABLE_RTTI:BOOL=ON"
1004 "-DCLANG_LINK_CLANG_DYLIB:BOOL=ON"
1005 "-DLLVM_LINK_LLVM_DYLIB:BOOL=ON"
1006 "-DLLVM_TARGETS_TO_BUILD=host"
1007 "-DBUILD_CXX_LANGUAGE_PACKAGE=ON"
1008 (string-append "-DClang_DIR="
1009 #$clang-19
1010 "/lib/cmake/clang"))
1011 #:phases #~(modify-phases %standard-phases
1012 (add-after 'unpack 'fix-paths
1013 (lambda* (#:key inputs #:allow-other-keys)
1014 (substitute* "src/lib_gui/tests/utilityAppTestSuite.cpp"
1015 (("/usr/bin/bash")
1016 (search-input-file inputs "/bin/bash")))
1017 (substitute* "CMakeLists.txt"
1018 (("@OUTPUT_DIR@")
1019 #$output))))
1020 (add-after 'install 'install-projects
1021 (lambda _
1022 (let ((src (string-append #$output
1023 "/share/sourcetrail/user/projects"))
1024 (dst (string-append #$output:projects
1025 "/share/sourcetrail/user/projects")))
1026 (copy-recursively src dst)
1027 (delete-file-recursively src))))))))
1028 (inputs (list boost-1.83
1029 clang-19
1030 expected-lite
1031 qt5compat
1032 qtbase
1033 qtnetworkauth
1034 qtsvg
1035 qtwayland
1036 range-v3
1037 spdlog
1038 sqlite
1039 tinyxml))
1040 (native-inputs (list googletest))
1041 (home-page "https://github.com/OpenSourceSourceTrail/Sourcetrail")
1042 (synopsis "Graphical cross-platform source code browser for C/C++")
1043 (description
1044 "Sourcetrail is a free and open-source cross-platform source explorer
1045that helps you get productive on unfamiliar source code. It includes support
1046for C/C++, providing a graphical means for discovering symbols and their place
1047in a project.")
1048 (license license:gpl3)))
1049
1050(define-public universal-ctags
1051 (package
1052 (name "universal-ctags")
1053 (version "6.2.1")
1054 (source
1055 (origin
1056 (method git-fetch)
1057 (uri (git-reference
1058 (url "https://github.com/universal-ctags/ctags")
1059 (commit (string-append "v" version))))
1060 (file-name (git-file-name name version))
1061 (sha256
1062 (base32
1063 "04i9fhhifs82d39z2dskscp7v2885g7isjn9r9zm4wsl6dcnb5n7"))
1064 (modules '((guix build utils)))
1065 (snippet
1066 '(begin
1067 ;; Remove the bundled PackCC and associated build rules.
1068 (substitute* "Makefile.am"
1069 (("^PACKCC = .*")
1070 "PACKCC = packcc\n")
1071 (("\\$\\(PACKCC_FILES\\)")
1072 "")
1073 (("\\$\\(PEG_SRCS\\) \\$\\(PEG_HEADS\\): \\$\\(PACKCC\\)")
1074 "$(PEG_SRCS) $(PEG_HEADS):"))
1075 (delete-file-recursively "misc/packcc")
1076 (delete-file "autogen.sh")))))
1077 (build-system gnu-build-system)
1078 (arguments
1079 '(;; Don't use the build-time TMPDIR (/tmp/guix-build-...) at runtime.
1080 #:configure-flags '("--enable-tmpdir=/tmp")
1081 #:test-target "units"
1082 #:phases (modify-phases %standard-phases
1083 (add-after 'unpack 'make-files-writable
1084 (lambda _
1085 (for-each make-file-writable (find-files "."))))
1086 (add-before 'bootstrap 'patch-misc
1087 (lambda _
1088 ;; The autogen.sh script calls out to these scripts, so
1089 ;; we cannot wait for the patch-source-shebangs phase.
1090 (for-each patch-shebang (find-files "misc"))))
1091 (add-before 'check 'patch-tests
1092 (lambda _
1093 (substitute* "misc/units"
1094 (("SHELL=/bin/sh")
1095 (string-append "SHELL=" (which "sh"))))
1096 (substitute* "Tmain/utils.sh"
1097 (("/bin/echo") (which "echo"))))))))
1098 (native-inputs
1099 (list autoconf automake packcc perl pkg-config python-docutils))
1100 (inputs
1101 (list jansson libseccomp libxml2 libyaml pcre2))
1102 (home-page "https://ctags.io/")
1103 (synopsis "Generate tag files for source code")
1104 (description
1105 "Universal Ctags generates an index (or tag) file of language objects
1106found in source files for many popular programming languages. This index
1107makes it easy for text editors and other tools to locate the indexed items.
1108Universal Ctags improves on traditional ctags because of its multilanguage
1109support, its ability for the user to define new languages searched by regular
1110expressions, and its ability to generate emacs-style TAGS files.")
1111 (license license:gpl2+)))
1112
1113(define-public xenon
1114 (package
1115 (name "xenon")
1116 (version "0.9.3")
1117 (source
1118 (origin
1119 (method url-fetch)
1120 (uri (pypi-uri "xenon" version))
1121 (sha256
1122 (base32
1123 "1yj31bqz2bphvvyb0jkas7bxc2rw76rf1csz0mwmvah8pbc3hxaa"))))
1124 (build-system pyproject-build-system)
1125 ;; Test suite not shipped with the PyPI archive; tests in Git require
1126 ;; network access.
1127 (arguments (list #:tests? #f))
1128 (native-inputs
1129 (list python-setuptools))
1130 (inputs
1131 (list python-pyyaml
1132 python-radon
1133 python-requests))
1134 (home-page "https://xenon.readthedocs.org/")
1135 (synopsis "Monitor code metrics for Python on your CI server")
1136 (description
1137 "Xenon is a monitoring tool based on Radon. It monitors code complexity.
1138Ideally, @code{xenon} is run every time code is committed. Through command
1139line options, various thresholds can be set for the complexity of code. It
1140will fail (i.e., it will exit with a non-zero exit code) when any of these
1141requirements is not met.")
1142 (properties '((lint-hidden-cpe-vendors . ("vmware"))))
1143 (license license:expat)))