projects/guix·blob dexed · refs

1153 lines · 47.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2015, 2018, 2020, 2021, 2023 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, 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 python) #:select (pypi-uri))
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 flex)
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.6.14")
282 (source (origin
283 (method url-fetch)
284 (uri (string-append "mirror://gnu/global/global-"
285 version ".tar.gz"))
286 (sha256
287 (base32
288 "085kihqvl26q275dvp2a8b4xalb5mxmn31mnbgl95lmfd05zvrzn"))))
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.08")
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 "1pk4v9w2c8wzdjimk23gndrcrd3y6cxi0avds3a36yasd3mg45hm"))))
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.3.5")
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 "0fvp9ab65vwn3dn0wm8l63rrp5fz1gpymcxs8yr0h4s5zmrsg9zf"))))
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-dbaggerman-cuba
498 go-github-com-json-iterator-go
499 go-github-com-mattn-go-runewidth
500 go-github-com-minio-blake2b-simd
501 go-github-com-spf13-cobra
502 go-golang-org-x-text
503 go-gopkg-in-yaml-v2))
504 (home-page "https://github.com/boyter/scc")
505 (synopsis "Fast code counter written in Go")
506 (description
507 "@command{scc} provides a lines-of-code counter similar to tools like
508@command{cloc} and @command{sloccount}. It aims to be fast as possible while
509supporting @acronym{COCOMO,Constructive Cost Model} calculation and code
510complexity estimation.")
511 (license license:expat)))
512
513(define-public the-silver-searcher
514 (package
515 (name "the-silver-searcher")
516 (version "2.2.0")
517 (source (origin
518 (method url-fetch)
519 (uri (string-append
520 "https://geoff.greer.fm/ag/releases/the_silver_searcher-"
521 version ".tar.gz"))
522 (sha256
523 (base32
524 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
525 (build-system gnu-build-system)
526 (arguments
527 ;; Required since GCC 10, see:
528 ;; https://gcc.gnu.org/gcc-10/porting_to.html.
529 `(#:configure-flags (list "CFLAGS=-fcommon")))
530 (native-inputs
531 (list pkg-config))
532 (inputs
533 (list pcre xz zlib))
534 (home-page "https://geoff.greer.fm/ag/")
535 (synopsis "Fast code searching tool")
536 (description
537 "The Silver Searcher (@command{ag}) is a tool for quickly searching large
538numbers of files. It's intended primarily for source code repositories, and
539respects files like @file{.gitignore} and @file{.hgignore}. It's also an order
540of magnitude faster than its inspiration, @command{ack}, and less specialised
541tools such as @command{grep}.")
542 (license license:asl2.0)))
543
544(define-public trio
545 (package
546 (name "trio")
547 (version "1.16")
548 (source (origin
549 (method url-fetch)
550 (uri (string-append "mirror://sourceforge/ctrio/trio/trio-"
551 version ".tar.gz"))
552 (sha256
553 (base32
554 "02pwd5m5vq7hbrffgm2na1dfc249z50yyr5jv73vdw15bd7ygl44"))))
555 (build-system gnu-build-system)
556 (home-page "https://daniel.haxx.se/projects/trio/")
557 (synopsis "Portable and extendable printf and string functions")
558 (description
559 "Trio is a set of @code{printf} and string functions designed be used by
560applications with a focus on portability or with the need for additional
561features that are not supported by the standard @code{stdio} implementation.")
562 ;; This license is very similar to the ISC license, but the wording is
563 ;; slightly different.
564 (license (license:non-copyleft
565 "http://sourceforge.net/p/ctrio/git/ci/master/tree/README"))))
566
567(define-public lcov
568 (package
569 (name "lcov")
570 (version "1.16")
571 (source
572 (origin
573 (method url-fetch)
574 (uri (string-append "https://github.com/linux-test-project/lcov"
575 "/releases/download/v" version
576 "/lcov-" version ".tar.gz"))
577 (sha256
578 (base32 "02r4wdl5d694aaxc5fgjw4nl3zmzq45khaxmsi3agj18annk2w4q"))))
579 (build-system gnu-build-system)
580 (arguments
581 '(#:test-target "test"
582 #:make-flags (list (string-append "PREFIX="
583 (assoc-ref %outputs "out")))
584 ;; This test suite has race conditions in its scripts which make it
585 ;; unreliable when run in parallel.
586 #:parallel-tests? #f
587 #:phases
588 (modify-phases %standard-phases
589 (add-after 'unpack 'patch-references-to-commands
590 (lambda* (#:key inputs #:allow-other-keys)
591 ;; Lift the requirement of having a shell and 'find' in PATH.
592 (substitute* "bin/geninfo"
593 (("qw/abs_path/")
594 "qw/abs_path getcwd/"))
595 (substitute* '("bin/lcov" "bin/geninfo")
596 (("`pwd`")
597 "getcwd()")
598 (("`find ")
599 (string-append "`"
600 (search-input-file inputs "/bin/find")
601 " ")))))
602 (delete 'configure) ;no configure script
603 (add-after 'install 'wrap
604 (lambda* (#:key outputs #:allow-other-keys)
605 (let ((out (assoc-ref outputs "out")))
606 (wrap-program (string-append out "/bin/geninfo")
607 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))))))))
608 (inputs (list bash-minimal perl perl-io-compress perl-json))
609 (home-page "https://ltp.sourceforge.net/coverage/lcov.php")
610 (synopsis "Code coverage tool that enhances GNU gcov")
611 (description "LCOV is an extension of @command{gcov}, a tool part of the
612GNU@tie{}Binutils, which provides information about what parts of a program
613are actually executed (i.e., \"covered\") while running a particular test
614case. The extension consists of a set of Perl scripts which build on the
615textual @command{gcov} output to implement the following enhanced
616functionality such as HTML output.")
617 (license license:gpl2+)))
618
619(define-public lcov-cobertura
620 (package
621 (name "lcov-cobertura")
622 (version "2.1.1")
623 (source
624 (origin
625 (method url-fetch)
626 (uri (pypi-uri "lcov_cobertura" version))
627 (sha256
628 (base32 "13xmr249c6qygm14gilb0icrsgb35ghsrr14a1zvppmxy9jf5a7g"))))
629 (build-system pyproject-build-system)
630 (arguments
631 (list
632 #:phases
633 #~(modify-phases %standard-phases
634 (add-after 'unpack 'patch-source
635 (lambda _
636 ;; Prevent setuptools.errors.InvalidConfigError:
637 ;; License classifiers have been superseded by license expressions
638 ;; (see https://peps.python.org/pep-0639/). Please remove:
639 ;; License :: OSI Approved :: Apache Software License
640 ;; Reported upstream:
641 ;; https://github.com/eriwen/lcov-to-cobertura-xml/pull/65
642 (substitute* "setup.cfg"
643 (("\tLicense :: OSI Approved :: Apache Software License\n")
644 "")))))))
645 (native-inputs
646 (list python-pytest
647 python-setuptools
648 python-setuptools-scm
649 python-wheel
650 python-xmldiff))
651 (home-page "https://eriwen.github.io/lcov-to-cobertura-xml/")
652 (synopsis "LCOV to Cobertura XML converter")
653 (description
654 "The lcov-to-cobertura Python module converts code coverage report files
655in the lcov format to the XML format of
656@uref{http://cobertura.github.io/cobertura/, Cobertura}, a Java code coverage
657tool. It allows continuous integration servers like Jenkins to aggregate
658results and determine build stability.")
659 (license license:asl2.0)))
660
661(define-public kcov
662 (package
663 (name "kcov")
664 (version "42")
665 (source (origin
666 (method git-fetch)
667 (uri (git-reference
668 (url "https://github.com/SimonKagstrom/kcov")
669 (commit (string-append "v" version))))
670 (file-name (git-file-name name version))
671 (sha256
672 (base32
673 "14pyahpgadh845q2p1gjw2yrlqcan4n870icrn2yqdpf33cprzgk"))))
674 (build-system cmake-build-system)
675 (arguments
676 `(#:tests? #f ; no test target
677 #:phases
678 (modify-phases %standard-phases
679 (add-after 'unpack 'fix-/bin/bash-references
680 (lambda* (#:key inputs #:allow-other-keys)
681 (substitute* (find-files "src" ".*\\.cc?$")
682 (("/bin/(bash|sh)" shell)
683 (search-input-file inputs shell))))))))
684 (inputs
685 (list curl elfutils libelf openssl zlib))
686 (native-inputs
687 (list python))
688 (home-page "https://github.com/SimonKagstrom/kcov")
689 (synopsis "Code coverage tester for compiled languages, Python and Bash")
690 (description "Kcov is a code coverage tester for compiled languages,
691Python and Bash. It was originally a fork of Bcov, but has since evolved to
692support a large feature set in addition to that of Bcov.
693
694Kcov uses DWARF debugging information for compiled programs to make it
695possible to collect coverage information without special compiler switches.")
696 (license license:gpl2+)))
697
698(define-public rtags
699 (package
700 (name "rtags")
701 (version "2.18")
702 (source
703 (origin
704 (method git-fetch)
705 (uri (git-reference
706 (url "https://github.com/Andersbakken/rtags")
707 (commit (string-append "v" version))))
708 (file-name (git-file-name name version))
709 (patches (search-patches "rtags-separate-rct.patch"))
710 (modules '((guix build utils)))
711 (snippet
712 ;; Part of spliting rct with rtags.
713 ;; Substitute #include "rct/header.h" with #include <rct/header.h>.
714 '(with-directory-excursion "src"
715 (delete-file-recursively "rct") ;remove bundled copy
716 (let ((files (find-files "." ".*\\.cpp|.*\\.h")))
717 (substitute* files
718 (("#include ?\"rct/(.*.h)\"" all header)
719 (string-append "#include <rct/" header ">")))
720 #t)))
721 (sha256
722 (base32
723 "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0"))))
724 (build-system cmake-build-system)
725 (arguments
726 '(#:build-type "RelWithDebInfo"
727 #:configure-flags
728 '("-DRTAGS_NO_ELISP_FILES=1")
729 #:tests? #f))
730 (native-inputs
731 (list pkg-config))
732 (inputs
733 (list bash-completion
734 clang
735 llvm
736 lua
737 rct
738 selene))
739 (home-page "https://github.com/Andersbakken/rtags")
740 (synopsis "Indexer for the C language family with Emacs integration")
741 (description
742 "RTags is a client/server application that indexes C/C++ code and keeps a
743persistent file-based database of references, declarations, definitions,
744symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you
745to find symbols by name (including nested class and namespace scope). Most
746importantly we give you proper follow-symbol and find-references support.")
747 (license license:gpl3+)))
748
749(define-public colormake
750 (package
751 (name "colormake")
752 (version "0.9.20140503")
753 (source
754 (origin
755 (method git-fetch)
756 (uri (git-reference
757 (url "https://github.com/pagekite/Colormake")
758 (commit version)))
759 (file-name (git-file-name name version))
760 (sha256
761 (base32 "1f9v5s0viq4yc9iv6701h3pv7j21zz1ckl37lpp9hsnliiizv03p"))))
762 (build-system trivial-build-system)
763 (native-inputs
764 (list bash perl))
765 (arguments
766 `(#:modules ((guix build utils))
767 #:builder
768 (begin
769 (use-modules (guix build utils))
770 (copy-recursively (assoc-ref %build-inputs "source") "source")
771 (chdir "source")
772 (patch-shebang "colormake.pl"
773 (list (string-append (assoc-ref %build-inputs "perl")
774 "/bin")))
775 (let* ((out (assoc-ref %outputs "out"))
776 (bin (string-append out "/bin"))
777 (doc (string-append out "/share/doc"))
778 (install-files (lambda (files directory)
779 (for-each (lambda (file)
780 (install-file file directory))
781 files))))
782 (substitute* "colormake"
783 (("colormake\\.pl") (string-append bin "/colormake.pl"))
784 (("/bin/bash")
785 (search-input-file %build-inputs "/bin/sh")))
786 (install-file "colormake.1" (string-append doc "/man/man1"))
787 (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc)
788 (install-files '("colormake" "colormake-short" "clmake"
789 "clmake-short" "colormake.pl")
790 bin)
791 #t))))
792 (home-page "https://bre.klaki.net/programs/colormake/")
793 (synopsis "Wrapper around @command{make} to produce colored output")
794 (description "This package provides a wrapper around @command{make} to
795produce colored output.")
796 (license license:gpl2+)))
797
798(define-public makefile2graph
799 (package
800 (name "makefile2graph")
801 (version "1.5.0")
802 (source
803 (origin
804 (method git-fetch)
805 (uri (git-reference
806 (url "https://github.com/lindenb/makefile2graph")
807 (commit (string-append "v" version))))
808 (file-name (git-file-name name version))
809 (sha256
810 (base32 "1gjfk3d8qg3cla7qd2y7r9s03whlfwy83q8k76xfcnqrjjfavdgk"))))
811 (build-system gnu-build-system)
812 (arguments
813 (list
814 #:test-target "test"
815 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
816 (string-append "prefix=" #$output))
817 #:phases
818 #~(modify-phases %standard-phases
819 (delete 'configure))))
820 (native-inputs
821 (list graphviz))
822 (home-page "https://github.com/lindenb/makefile2graph")
823 (synopsis "Creates a graph of dependencies from GNU Make")
824 (description
825 "@code{make2graph} creates a graph of dependencies from GNU Make. The
826output is a graphviz-dot file, a Gexf-XML file or a list of the deepest
827independent targets.")
828 (license license:expat)))
829
830(define-public uncrustify
831 (package
832 (name "uncrustify")
833 (version "0.80.1")
834 (source (origin
835 (method git-fetch)
836 (uri (git-reference
837 (url "https://github.com/uncrustify/uncrustify/")
838 (commit (string-append name "-" version))))
839 (file-name (git-file-name name version))
840 (sha256
841 (base32
842 "1n7ifr4i35ii5zaia61jdd61virbygc00anhc9iq3p5gzjlfxhsa"))))
843 (build-system cmake-build-system)
844 (native-inputs (list python-wrapper))
845 (arguments
846 (list #:phases
847 #~(modify-phases %standard-phases
848 (add-after 'unpack 'unpack-etc
849 (lambda* (#:key inputs outputs #:allow-other-keys)
850 ;; Configuration samples are not installed by default.
851 (let* ((output (assoc-ref outputs "out"))
852 (etcdir (string-append output "/etc")))
853 (for-each (lambda (l)
854 (install-file l etcdir))
855 (find-files "etc" "\\.cfg$"))))))))
856 (home-page "https://uncrustify.sourceforge.net/")
857 (synopsis "Code formatter for C and other related languages")
858 (description
859 "Beautify source code in many languages of the C family (C, C++, C#,
860Objective@tie{}C, D, Java, Pawn, and Vala). Features:
861@itemize
862@item Indent and align code.
863@item Reformat comments (a little bit).
864@item Fix inter-character spacing.
865@item Add or remove parens / braces.
866@item Supports embedded SQL @code{EXEC SQL} stuff.
867@item Highly configurable - More than 600 configurable options.
868@end itemize\n")
869 (license license:gpl2+)))
870
871(define-public astyle
872 (package
873 (name "astyle")
874 (version "3.5")
875 (source
876 (origin
877 (method url-fetch)
878 (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
879 version "/astyle-" version ".tar.bz2"))
880 (sha256
881 (base32 "0g4jyp47iz97ld9ac4wb5k59j4cs8dbw4dp8f32bwqx8pyvirz6y"))))
882 (build-system gnu-build-system)
883 (arguments
884 (list
885 #:tests? #f ;no tests
886 #:make-flags
887 #~(list (string-append "prefix=" #$output)
888 "INSTALL=install"
889 "release" "shared")
890 #:phases
891 #~(modify-phases %standard-phases
892 (add-after 'unpack 'patch-makefile
893 (lambda _
894 (substitute* "build/gcc/Makefile"
895 (("CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c\\+\\+11")
896 "CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c++17"))))
897 (replace 'configure
898 (lambda _
899 (chdir "build/gcc")))
900 (add-after 'install 'install-more
901 (lambda* (#:key outputs #:allow-other-keys)
902 ;; Libraries and headers aren't installed by default.
903 (let ((include (string-append #$output "/include"))
904 (lib (string-append #$output "/lib")))
905 (mkdir-p include)
906 (copy-file "../../src/astyle.h"
907 (string-append include "/astyle.h"))
908 (mkdir-p lib)
909 (for-each (lambda (l)
910 (copy-file
911 l (string-append lib "/" (basename l))))
912 (find-files "bin" "^lib.*\\.so"))))))))
913 (home-page "https://astyle.sourceforge.net/")
914 (synopsis "Source code indenter, formatter, and beautifier")
915 (description
916 "Artistic Style is a source code indenter, formatter, and beautifier for
917the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
918 (license license:lgpl3+)))
919
920(define-public indent
921 ;; XXX: Not released anymore, but some patches fix CVEs.
922 (let ((commit "1737c929cbe2ec8a181107df9742894a44c57f71")
923 (revision "0"))
924 (package
925 (name "indent")
926 (version (git-version "2.2.13" revision commit))
927 (source
928 (origin
929 (method git-fetch)
930 (uri (git-reference
931 (url "https://git.savannah.gnu.org/git/indent")
932 (commit commit)))
933 (file-name (git-file-name name version))
934 (sha256
935 (base32 "138bqlwvfjv3w1plw2zzf0nqw38lhgimzx1gic6p8r5kizjp9123"))))
936 (build-system gnu-build-system)
937 (arguments
938 (list #:phases
939 #~(modify-phases %standard-phases
940 (add-after 'unpack 'patch-bootstrap
941 (lambda _
942 (substitute* "bootstrap"
943 (("^(wget|\\./configure|rm)" all)
944 (string-append "#" all)))
945 (call-with-output-file "doc/version.texi"
946 (lambda (port)
947 (format port "\
948@set UPDATED
949@set EDITION ~a
950@set VERSION ~a"
951 #$version
952 #$version))))))))
953 (native-inputs
954 (list autoconf-2.71 automake gettext-minimal texinfo))
955 (home-page "https://www.gnu.org/software/indent/")
956 (synopsis "Code reformatter")
957 (description
958 "Indent is a program that makes source code easier to read by
959reformatting it in a consistent style. It can change the style to one of
960several different styles such as GNU, BSD or K&R. It has some flexibility to
961deal with incomplete or malformed syntax. GNU indent offers several
962extensions over the standard utility.")
963 (license license:gpl3+)
964 (properties '((lint-hidden-cves . ("CVE-2023-40305"
965 "CVE-2024-0911")))))))
966
967(define-public sourcetrail
968 (package
969 (name "sourcetrail")
970 (version "2.0.0")
971 (source
972 (origin
973 (method git-fetch)
974 (uri (git-reference
975 (url "https://github.com/OpenSourceSourceTrail/Sourcetrail")
976 (commit version)
977 (recursive? #t)))
978 (patches (search-patches "sourcetrail-fix-cmakelists-and-paths.patch"))
979 (file-name (git-file-name name version))
980 (sha256
981 "06rp9ba9lkzwm8m7agzajg550h632kqb57bs9srvbgv411bkvgdd")
982 (modules '((guix build utils)))
983 (snippet #~(begin
984 (for-each delete-file-recursively
985 '(".conan" ".devcontainer"
986 ".github"
987 "conanfile.txt"
988 "scripts"
989 "bin/app/data/install"
990 "bin/app/user/log"))))))
991 (build-system cmake-build-system)
992 (arguments
993 (let* ((split-version (string-split version
994 (lambda (c)
995 (or (eqv? c #\.)
996 (eqv? c #\-)))))
997 (major-version (first split-version))
998 (minor-version (second split-version))
999 (version-patch (third split-version)))
1000 (list #:configure-flags #~(list "-DENABLE_UNIT_TEST=true"
1001 "-DENABLE_GUI_TEST=true"
1002 "-DENABLE_INTERGRATION_TEST=true"
1003 (string-append "-DVERSION_MAJOR="
1004 #$major-version)
1005 (string-append "-DVERSION_MINOR="
1006 #$minor-version)
1007 (string-append "-DVERSION_PATCH="
1008 #$version-patch)
1009 "-DLLVM_ENABLE_PROJECTS:STRING=clang"
1010 "-DLLVM_ENABLE_RTTI:BOOL=ON"
1011 "-DCLANG_LINK_CLANG_DYLIB:BOOL=ON"
1012 "-DLLVM_LINK_LLVM_DYLIB:BOOL=ON"
1013 "-DLLVM_TARGETS_TO_BUILD=host"
1014 "-DBUILD_CXX_LANGUAGE_PACKAGE=ON"
1015 (string-append "-DClang_DIR="
1016 #$clang-19
1017 "/lib/cmake/clang"))
1018 #:phases #~(modify-phases %standard-phases
1019 (add-after 'unpack 'fix-paths
1020 (lambda* (#:key inputs #:allow-other-keys)
1021 (substitute* "src/lib_gui/tests/utilityAppTestSuite.cpp"
1022 (("/usr/bin/bash")
1023 (search-input-file inputs "/bin/bash")))
1024 (substitute* "CMakeLists.txt"
1025 (("@OUTPUT_DIR@")
1026 #$output))))
1027 (add-after 'install 'install-projects
1028 (lambda _
1029 (let ((src (string-append #$output
1030 "/share/sourcetrail/user/projects"))
1031 (dst (string-append #$output:projects
1032 "/share/sourcetrail/user/projects")))
1033 (copy-recursively src dst)
1034 (delete-file-recursively src))))))))
1035 (inputs (list boost-1.83
1036 clang-19
1037 expected-lite
1038 qt5compat
1039 qtbase
1040 qtnetworkauth
1041 qtsvg
1042 qtwayland
1043 range-v3
1044 spdlog-1.13
1045 sqlite
1046 tinyxml))
1047 (native-inputs (list googletest))
1048 (home-page "https://github.com/OpenSourceSourceTrail/Sourcetrail")
1049 (synopsis "Graphical cross-platform source code browser for C/C++")
1050 (description
1051 "Sourcetrail is a free and open-source cross-platform source explorer
1052that helps you get productive on unfamiliar source code. It includes support
1053for C/C++, providing a graphical means for discovering symbols and their place
1054in a project.")
1055 (license license:gpl3)))
1056
1057(define-public universal-ctags
1058 (package
1059 (name "universal-ctags")
1060 (version "6.2.1")
1061 (source
1062 (origin
1063 (method git-fetch)
1064 (uri (git-reference
1065 (url "https://github.com/universal-ctags/ctags")
1066 (commit (string-append "v" version))))
1067 (file-name (git-file-name name version))
1068 (sha256
1069 (base32
1070 "04i9fhhifs82d39z2dskscp7v2885g7isjn9r9zm4wsl6dcnb5n7"))
1071 (modules '((guix build utils)))
1072 (snippet
1073 '(begin
1074 ;; Remove the bundled PackCC and associated build rules.
1075 (substitute* "Makefile.am"
1076 (("^PACKCC = .*")
1077 "PACKCC = packcc\n")
1078 (("\\$\\(PACKCC_FILES\\)")
1079 "")
1080 (("\\$\\(PEG_SRCS\\) \\$\\(PEG_HEADS\\): \\$\\(PACKCC\\)")
1081 "$(PEG_SRCS) $(PEG_HEADS):"))
1082 (delete-file-recursively "misc/packcc")
1083 (delete-file "autogen.sh")))))
1084 (build-system gnu-build-system)
1085 (arguments
1086 '(;; Don't use the build-time TMPDIR (/tmp/guix-build-...) at runtime.
1087 #:configure-flags '("--enable-tmpdir=/tmp")
1088 #:test-target "units"
1089 #:phases (modify-phases %standard-phases
1090 (add-after 'unpack 'make-files-writable
1091 (lambda _
1092 (for-each make-file-writable (find-files "."))))
1093 (add-before 'bootstrap 'patch-misc
1094 (lambda _
1095 ;; The autogen.sh script calls out to these scripts, so
1096 ;; we cannot wait for the patch-source-shebangs phase.
1097 (for-each patch-shebang (find-files "misc"))))
1098 (add-before 'check 'patch-tests
1099 (lambda _
1100 (substitute* "misc/units"
1101 (("SHELL=/bin/sh")
1102 (string-append "SHELL=" (which "sh"))))
1103 (substitute* "Tmain/utils.sh"
1104 (("/bin/echo") (which "echo"))))))))
1105 (native-inputs
1106 (list autoconf automake packcc perl pkg-config python-docutils))
1107 (inputs
1108 (list jansson libseccomp libxml2 libyaml pcre2))
1109 (home-page "https://ctags.io/")
1110 (synopsis "Generate tag files for source code")
1111 (description
1112 "Universal Ctags generates an index (or tag) file of language objects
1113found in source files for many popular programming languages. This index
1114makes it easy for text editors and other tools to locate the indexed items.
1115Universal Ctags improves on traditional ctags because of its multilanguage
1116support, its ability for the user to define new languages searched by regular
1117expressions, and its ability to generate emacs-style TAGS files.")
1118 (license license:gpl2+)))
1119
1120(define-public xenon
1121 (package
1122 (name "xenon")
1123 (version "0.9.3")
1124 (source
1125 (origin
1126 (method url-fetch)
1127 (uri (pypi-uri "xenon" version))
1128 (sha256
1129 (base32
1130 "1yj31bqz2bphvvyb0jkas7bxc2rw76rf1csz0mwmvah8pbc3hxaa"))))
1131 (build-system pyproject-build-system)
1132 ;; Test suite not shipped with the PyPI archive; tests in Git require
1133 ;; network access.
1134 (arguments (list #:tests? #f))
1135 (native-inputs
1136 (list python-setuptools))
1137 (inputs
1138 (list python-pyyaml
1139 python-radon
1140 python-requests))
1141 (home-page "https://xenon.readthedocs.org/")
1142 (synopsis "Monitor code metrics for Python on your CI server")
1143 (description
1144 "Xenon is a monitoring tool based on Radon. It monitors code complexity.
1145Ideally, @code{xenon} is run every time code is committed. Through command
1146line options, various thresholds can be set for the complexity of code. It
1147will fail (i.e., it will exit with a non-zero exit code) when any of these
1148requirements is not met.")
1149 (properties '((lint-hidden-cpe-vendors . ("vmware"))))
1150 (license license:expat)))
1151
1152(define-deprecated-package python-xenon
1153 xenon)