projects/guix·blob rename-kernel-team · refs

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