gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / code.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016, 2017, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
8 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
9 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
10 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
11 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
12 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
13 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
14 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@goebel-consult.de>
15 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
16 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
17 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages code)
35 #:use-module (guix packages)
36 #:use-module (guix utils)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system python)
43 #:use-module (guix build-system trivial)
44 #:use-module (gnu packages)
45 #:use-module (gnu packages autogen)
46 #:use-module (gnu packages autotools)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages bash)
49 #:use-module (gnu packages c)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages cpp)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages elf)
54 #:use-module (gnu packages emacs)
55 #:use-module (gnu packages gcc)
56 #:use-module (gnu packages graphviz)
57 #:use-module (gnu packages llvm)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages lua)
60 #:use-module (gnu packages ncurses)
61 #:use-module (gnu packages pcre)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages perl-compression)
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages python)
66 #:use-module (gnu packages sqlite)
67 #:use-module (gnu packages texinfo)
68 #:use-module (gnu packages web)
69 #:use-module (gnu packages xml))
70
71 ;;; Tools to deal with source code: metrics, cross-references, etc.
72
73 (define-public cflow
74 (package
75 (name "cflow")
76 (version "1.6")
77 (source (origin
78 (method url-fetch)
79 (uri (string-append "mirror://gnu/cflow/cflow-"
80 version ".tar.bz2"))
81 (sha256
82 (base32
83 "1mzd3yf0dfv8h2av5vsxxlhpk21nw064h91b2kgfrdz92r0pnj1l"))))
84 (build-system gnu-build-system)
85
86 ;; Needed to have cflow-mode.el installed.
87 (native-inputs `(("emacs" ,emacs-minimal)))
88 (arguments
89 '(#:configure-flags (list (string-append "CPPFLAGS="
90 "-D" "CFLOW_PREPROC=\\\""
91 (assoc-ref %build-inputs "gcc")
92 "/bin/cpp\\\""))))
93 (home-page "https://www.gnu.org/software/cflow/")
94 (synopsis "Create a graph of control flow within a program")
95 (description
96 "GNU cflow analyzes C source files and produces a graph charting the
97 control flow of the program. It can output the graph in several styles and
98 in either the POSIX format or in an extended GNU format. cflow also includes
99 a major mode for Emacs for examining the flowcharts that it produces.")
100 (license license:gpl3+)))
101
102 (define-public complexity
103 (package
104 (name "complexity")
105 (version "1.10")
106 (source (origin
107 (method url-fetch)
108 (uri (string-append "mirror://gnu/complexity/complexity-"
109 version ".tar.xz"))
110 (sha256
111 (base32
112 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
113 (build-system gnu-build-system)
114 (native-inputs
115 `(("texinfo" ,texinfo)
116 ("autogen" ,autogen)))
117 (home-page "https://www.gnu.org/software/complexity/")
118 (synopsis "Analyze complexity of C functions")
119 (description
120 "GNU complexity provides tools for finding procedures that are
121 convoluted, overly long or otherwise difficult to understand. This
122 may help in learning or reviewing unfamiliar code or perhaps
123 highlighting your own code that seemed comprehensible when you wrote it.")
124 (license license:gpl3+)))
125
126 (define-public global ; a global variable
127 (package
128 (name "global")
129 (version "6.6.5")
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "mirror://gnu/global/global-"
133 version ".tar.gz"))
134 (sha256
135 (base32
136 "10vvsgx8v54whb4j9mk5qqyb5h3rdd9da0il3wir8pcpksyk0dww"))))
137 (build-system gnu-build-system)
138 (inputs `(("ncurses" ,ncurses)
139 ("libltdl" ,libltdl)
140 ("sqlite" ,sqlite)
141 ("python-wrapper" ,python-wrapper)))
142 (arguments
143 `(#:configure-flags
144 (list (string-append "--with-ncurses="
145 (assoc-ref %build-inputs "ncurses"))
146 (string-append "--with-sqlite3="
147 (assoc-ref %build-inputs "sqlite"))
148 "--disable-static")
149
150 #:phases
151 (modify-phases %standard-phases
152 (add-after 'install 'post-install
153 (lambda* (#:key outputs #:allow-other-keys)
154 ;; Install the plugin files in the right place.
155 (let* ((out (assoc-ref outputs "out"))
156 (data (string-append out "/share/gtags"))
157 (vim (string-append out "/share/vim/vimfiles/plugin"))
158 (lisp (string-append out "/share/emacs/site-lisp")))
159 (mkdir-p lisp)
160 (mkdir-p vim)
161 (rename-file (string-append data "/gtags.el")
162 (string-append lisp "/gtags.el"))
163 (rename-file (string-append data "/gtags.vim")
164 (string-append vim "/gtags.vim"))
165 (rename-file (string-append data "/gtags-cscope.vim")
166 (string-append vim "/gtags-cscope.vim"))
167 #t))))))
168 (home-page "https://www.gnu.org/software/global/")
169 (synopsis "Cross-environment source code tag system")
170 (description
171 "GNU GLOBAL is a source code tagging system that functions in the same
172 way across a wide array of environments, such as different text editors,
173 shells and web browsers. The resulting tags are useful for quickly moving
174 around in a large, deeply nested project.")
175 (license license:gpl3+)))
176
177 (define-public sloccount
178 (package
179 (name "sloccount")
180 (version "2.26")
181 (source (origin
182 (method url-fetch)
183 (uri (string-append "https://dwheeler.com/sloccount/sloccount-"
184 version ".tar.gz"))
185 (sha256
186 (base32
187 "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs"))))
188 (build-system gnu-build-system)
189 (arguments
190 '(#:phases (modify-phases %standard-phases
191 (delete 'configure)
192 (add-before 'build 'make-dotl-files-older
193 (lambda _
194 ;; Make the '.l' files as old as the '.c'
195 ;; files to avoid triggering the rule that
196 ;; requires Flex.
197 (define ref
198 (stat "README"))
199
200 (for-each (lambda (file)
201 (set-file-time file ref))
202 (find-files "." "\\.[chl]$"))
203 #t))
204 (add-before 'install 'make-target-directories
205 (lambda* (#:key outputs #:allow-other-keys)
206 (let ((out (assoc-ref outputs "out")))
207 (mkdir-p (string-append out "/bin"))
208 (mkdir-p (string-append out
209 "/share/man/man1"))
210 (mkdir-p (string-append out
211 "/share/doc"))
212 #t)))
213 (replace 'check
214 (lambda _
215 (setenv "HOME" (getcwd))
216 (setenv "PATH"
217 (string-append (getcwd) ":"
218 (getenv "PATH")))
219 (invoke "make" "test"))))
220
221 #:make-flags (list (string-append "PREFIX="
222 (assoc-ref %outputs "out")))))
223 (inputs `(("perl" ,perl)))
224 (home-page "https://dwheeler.com/sloccount/")
225 (synopsis "Count physical source lines of code (SLOC)")
226 (description
227 "SLOCCount is a set of the programs for counting source lines of
228 code (SLOC) in large software systems. It can automatically identify and
229 measure a wide range of programming languages. It automatically estimates the
230 effort, time, and money it would take to develop the software, using the
231 COCOMO model or user-provided parameters.")
232 (license license:gpl2+)))
233
234 (define-public cloc
235 (package
236 (name "cloc")
237 (version "1.88")
238 (source
239 (origin
240 (method git-fetch)
241 (uri (git-reference
242 (url "https://github.com/AlDanial/cloc")
243 (commit version)))
244 (file-name (git-file-name name version))
245 (sha256
246 (base32 "1ixgswzbzv63bl50gb2kgaqr0jcicjz6w610hi9fal1i7744zraw"))))
247 (build-system gnu-build-system)
248 (inputs
249 `(("coreutils" ,coreutils)
250 ("perl" ,perl)
251 ("perl-algorithm-diff" ,perl-algorithm-diff)
252 ("perl-digest-md5" ,perl-digest-md5)
253 ("perl-parallel-forkmanager" ,perl-parallel-forkmanager)
254 ("perl-regexp-common" ,perl-regexp-common)))
255 (arguments
256 `(#:phases (modify-phases %standard-phases
257 (delete 'configure) ; nothing to configure
258 (delete 'build) ; nothing to build
259 (replace 'install
260 (lambda* (#:key inputs outputs #:allow-other-keys)
261 (let* ((out (assoc-ref outputs "out")))
262 (invoke "make" "-C" "Unix"
263 (string-append "prefix=" out)
264 (string-append "INSTALL="
265 (assoc-ref inputs "coreutils")
266 "/bin/install")
267 "install")
268 #t)))
269 (add-after 'install 'wrap-program
270 (lambda* (#:key inputs outputs #:allow-other-keys)
271 (let ((out (assoc-ref outputs "out")))
272 (wrap-program (string-append out "/bin/cloc")
273 `("PERL5LIB" ":" =
274 ,(string-split (getenv "PERL5LIB") #\:)))
275 #t))))
276 #:out-of-source? #t
277 ;; Tests require some other packages.
278 #:tests? #f))
279 (home-page "https://github.com/AlDanial/cloc")
280 (synopsis "Count source lines of code (SLOC) and other source code metrics")
281 (description "cloc counts blank lines, comment lines, and physical lines
282 of source code in many programming languages. Given two versions of a code
283 base, cloc can compute differences in blank, comment, and source lines.
284
285 cloc contains code from David Wheeler's SLOCCount. Compared to SLOCCount,
286 cloc can handle a greater variety of programming languages.")
287 (license license:gpl2+)))
288
289 (define-public the-silver-searcher
290 (package
291 (name "the-silver-searcher")
292 (version "2.2.0")
293 (source (origin
294 (method url-fetch)
295 (uri (string-append
296 "https://geoff.greer.fm/ag/releases/the_silver_searcher-"
297 version ".tar.gz"))
298 (sha256
299 (base32
300 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
301 (build-system gnu-build-system)
302 (native-inputs
303 `(("pkg-config" ,pkg-config)))
304 (inputs
305 `(("pcre" ,pcre)
306 ("xz" ,xz)
307 ("zlib" ,zlib)))
308 (home-page "https://geoff.greer.fm/ag/")
309 (synopsis "Fast code searching tool")
310 (description
311 "The Silver Searcher (@command{ag}) is a tool for quickly searching large
312 numbers of files. It's intended primarily for source code repositories, and
313 respects files like @file{.gitignore} and @file{.hgignore}. It's also an order
314 of magnitude faster than its inspiration, @command{ack}, and less specialised
315 tools such as @command{grep}.")
316 (license license:asl2.0)))
317
318 (define-public trio
319 (package
320 (name "trio")
321 (version "1.16")
322 (source (origin
323 (method url-fetch)
324 (uri (string-append "mirror://sourceforge/ctrio/trio/trio-"
325 version ".tar.gz"))
326 (sha256
327 (base32
328 "02pwd5m5vq7hbrffgm2na1dfc249z50yyr5jv73vdw15bd7ygl44"))))
329 (build-system gnu-build-system)
330 (home-page "https://daniel.haxx.se/projects/trio/")
331 (synopsis "Portable and extendable printf and string functions")
332 (description
333 "Trio is a set of @code{printf} and string functions designed be used by
334 applications with a focus on portability or with the need for additional
335 features that are not supported by the standard @code{stdio} implementation.")
336 ;; This license is very similar to the ISC license, but the wording is
337 ;; slightly different.
338 (license (license:non-copyleft
339 "http://sourceforge.net/p/ctrio/git/ci/master/tree/README"))))
340
341 (define-public universal-ctags
342 (package
343 (name "universal-ctags")
344 (version "5.9.20201018.0")
345 (source
346 (origin
347 (method git-fetch)
348 (uri (git-reference
349 (url "https://github.com/universal-ctags/ctags")
350 (commit (string-append "p" version))))
351 (file-name (git-file-name name version))
352 (sha256
353 (base32
354 "174p1w20pl25k996hfw61inw4mqhskmmic1lyw2m65firmkyvs7x"))
355 (modules '((guix build utils)))
356 (snippet
357 '(begin
358 ;; Remove the bundled PackCC and associated build rules.
359 (substitute* "Makefile.am"
360 (("\\$\\(packcc_verbose\\)\\$\\(PACKCC\\)")
361 "packcc")
362 (("\\$\\(PEG_SRCS\\) \\$\\(PEG_HEADS\\): packcc\\$\\(EXEEXT\\)")
363 "$(PEG_SRCS) $(PEG_HEADS):")
364 (("noinst_PROGRAMS \\+= packcc")
365 ""))
366 (delete-file-recursively "misc/packcc")
367 #t))))
368 (build-system gnu-build-system)
369 (arguments
370 '(;; Don't use the build-time TMPDIR (/tmp/guix-build-...) at runtime.
371 #:configure-flags '("--enable-tmpdir=/tmp")
372 #:phases (modify-phases %standard-phases
373 (add-after 'unpack 'make-files-writable
374 (lambda _
375 (for-each make-file-writable (find-files "."))
376 #t))
377 (add-before 'bootstrap 'patch-optlib2c
378 (lambda _
379 ;; The autogen.sh script calls out to optlib2c to
380 ;; generate translations, so we can not wait for the
381 ;; patch-source-shebangs phase.
382 (patch-shebang "misc/optlib2c")
383 #t))
384 (add-before 'check 'patch-tests
385 (lambda _
386 (substitute* "misc/units"
387 (("SHELL=/bin/sh")
388 (string-append "SHELL=" (which "sh"))))
389 (substitute* "Tmain/utils.sh"
390 (("/bin/echo") (which "echo")))
391 #t)))))
392 (native-inputs
393 `(("autoconf" ,autoconf)
394 ("automake" ,automake)
395 ;; XXX: Use ctags' own packcc fork even though we meticolously unbundle
396 ;; it above. Mainly for historical reasons, and perhaps their changes
397 ;; get upstreamed in the future.
398 ("packcc"
399 ,(let ((commit "03402b79505dc0024f90d5bebfd7e5d3fb62da9a"))
400 (package
401 (inherit packcc)
402 (source (origin
403 (method git-fetch)
404 (uri (git-reference
405 (url "https://github.com/universal-ctags/packcc")
406 (commit commit)))
407 (file-name (git-file-name "packcc-for-ctags"
408 (string-take commit 7)))
409 (sha256
410 (base32
411 "0vxpdk9l2lf7f32nx1p3b3xmw2kw2wp95vnf9bc4lyqrg69pblm0")))))))
412 ("perl" ,perl)
413 ("pkg-config" ,pkg-config)))
414 (inputs
415 `(("jansson" ,jansson)
416 ("libseccomp" ,libseccomp)
417 ("libxml2" ,libxml2)
418 ("libyaml" ,libyaml)))
419 (home-page "https://ctags.io/")
420 (synopsis "Generate tag files for source code")
421 (description
422 "Universal Ctags generates an index (or tag) file of language objects
423 found in source files for many popular programming languages. This index
424 makes it easy for text editors and other tools to locate the indexed items.
425 Universal Ctags improves on traditional ctags because of its multilanguage
426 support, its ability for the user to define new languages searched by regular
427 expressions, and its ability to generate emacs-style TAGS files.")
428 (license license:gpl2+)))
429
430 (define-public withershins
431 (package
432 (name "withershins")
433 (version "0.1")
434 (source
435 (origin
436 (method git-fetch)
437 (uri (git-reference
438 (url "https://github.com/cameronwhite/withershins")
439 (commit (string-append "v" version))))
440 (file-name (git-file-name name version))
441 (sha256
442 (base32 "1cviqvbbcwljm1zx12j6511hazr3kscwrvcyifrkfi4fpy5z985m"))))
443 (build-system cmake-build-system)
444 (arguments
445 `(#:out-of-source? #f
446 #:configure-flags
447 ;; XXX A (justified!) misleading-indentation error breaks the build.
448 (list "-DENABLE_WERROR=OFF")
449 #:phases
450 (modify-phases %standard-phases
451 (add-after
452 'unpack 'find-libiberty
453 (lambda _
454 (let ((libiberty (assoc-ref %build-inputs "libiberty")))
455 (substitute* "cmake/FindIberty.cmake"
456 (("/usr/include") (string-append libiberty "/include"))
457 (("libiberty.a iberty")
458 (string-append "NAMES libiberty.a iberty\nPATHS \""
459 libiberty "/lib" "\"")))
460 #t)))
461 (replace
462 'install
463 (lambda* (#:key outputs #:allow-other-keys)
464 (let* ((out (assoc-ref outputs "out"))
465 (include (string-append out "/include"))
466 (lib (string-append out "/lib")))
467 (mkdir-p include)
468 (install-file "src/withershins.hpp" include)
469 (mkdir-p lib)
470 (install-file "src/libwithershins.a" lib))
471 #t)))))
472 (home-page "https://github.com/cameronwhite/withershins")
473 (inputs
474 `(("libiberty" ,libiberty)
475 ("binutils" ,binutils) ;for libbfd
476 ("zlib" ,zlib)))
477 (synopsis "C++11 library for generating stack traces")
478 (description
479 "Withershins is a simple cross-platform C++11 library for generating
480 stack traces.")
481 ;; Sources are released under Expat license, but since BFD is licensed
482 ;; under the GPLv3+ the combined work is GPLv3+ as well.
483 (license license:gpl3+)))
484
485 (define-public lcov
486 (package
487 (name "lcov")
488 (version "1.15")
489 (source
490 (origin
491 (method url-fetch)
492 (uri (string-append "https://github.com/linux-test-project/lcov"
493 "/releases/download/v" version
494 "/lcov-" version ".tar.gz"))
495 (sha256
496 (base32 "0fh5z0q5wg2jxr2nn5w7321y0zg9rwk75j3k5hnamjdy6gxa5kf1"))))
497 (build-system gnu-build-system)
498 (arguments
499 '(#:test-target "test"
500 #:make-flags (list (string-append "PREFIX="
501 (assoc-ref %outputs "out")))
502 #:phases
503 (modify-phases %standard-phases
504 (add-after 'unpack 'patch-pwd
505 ;; Lift the requirement of having a shell in PATH.
506 (lambda _
507 (substitute* "bin/geninfo"
508 (("qw/abs_path/")
509 "qw/abs_path getcwd/"))
510 (substitute* '("bin/lcov" "bin/geninfo")
511 (("`pwd`")
512 "getcwd()"))
513 #t))
514 (delete 'configure) ;no configure script
515 (add-after 'install 'wrap
516 (lambda* (#:key outputs #:allow-other-keys)
517 (let ((out (assoc-ref outputs "out")))
518 (wrap-program (string-append out "/bin/geninfo")
519 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB")))))
520 #t)))))
521 (inputs `(("perl" ,perl)
522 ("perl-io-compress" ,perl-io-compress)
523 ("perl-json" ,perl-json)))
524 (home-page "http://ltp.sourceforge.net/coverage/lcov.php")
525 (synopsis "Code coverage tool that enhances GNU gcov")
526 (description "LCOV is an extension of @command{gcov}, a tool part of the
527 GNU@tie{}Binutils, which provides information about what parts of a program
528 are actually executed (i.e., \"covered\") while running a particular test
529 case. The extension consists of a set of Perl scripts which build on the
530 textual @command{gcov} output to implement the following enhanced
531 functionality such as HTML output.")
532 (license license:gpl2+)))
533
534 (define-public lcov-cobertura
535 (package
536 (name "python-lcov-cobertura")
537 (version "1.6")
538 (source
539 (origin
540 (method url-fetch)
541 (uri (pypi-uri "lcov_cobertura" version))
542 (sha256
543 (base32
544 "02ar6yjazlxq4p64cz9gag08bvakmzjrp147jara9wlnlbc96j8g"))))
545 (build-system python-build-system)
546 (home-page "https://eriwen.github.io/lcov-to-cobertura-xml/")
547 (synopsis "LCOV to Cobertura XML converter")
548 (description
549 "The lcov-to-cobertura Python module converts code coverage report files
550 in the lcov format to the XML format of
551 @uref{http://cobertura.github.io/cobertura/, Cobertura}, a Java code coverage
552 tool. It allows continuous integration servers like Jenkins to aggregate
553 results and determine build stability.")
554 (license license:asl2.0)))
555
556 (define-public kcov
557 (package
558 (name "kcov")
559 (version "38")
560 (source (origin
561 (method git-fetch)
562 (uri (git-reference
563 (url "https://github.com/SimonKagstrom/kcov")
564 (commit version)))
565 (file-name (git-file-name name version))
566 (sha256
567 (base32
568 "0zqg21xwivi16csl6a5wby6679ny01bjaw4am3y4qcgjdyihifp8"))))
569 (build-system cmake-build-system)
570 (arguments
571 `(#:tests? #f ;no test target
572 #:phases
573 (modify-phases %standard-phases
574 (add-after 'unpack 'fix-/bin/bash-references
575 (lambda _
576 (substitute* (find-files "src" ".*\\.cc?$")
577 (("/bin/bash") (which "bash"))
578 (("/bin/sh") (which "sh")))
579 #t)))))
580 (inputs
581 `(("curl" ,curl)
582 ("elfutils" ,elfutils)
583 ("libelf" ,libelf)
584 ("zlib" ,zlib)))
585 (native-inputs
586 `(("python" ,python)))
587 (home-page "https://github.com/SimonKagstrom/kcov")
588 (synopsis "Code coverage tester for compiled languages, Python and Bash")
589 (description "Kcov is a FreeBSD/Linux/OSX code coverage tester for compiled
590 languages, Python and Bash. Kcov was originally a fork of Bcov, but has since
591 evolved to support a large feature set in addition to that of Bcov.
592
593 Kcov uses DWARF debugging information for compiled programs to make it
594 possible to collect coverage information without special compiler switches.")
595 (license license:gpl2+)))
596
597 (define-public rtags
598 (package
599 (name "rtags")
600 (version "2.18")
601 (source
602 (origin
603 (method git-fetch)
604 (uri (git-reference
605 (url "https://github.com/Andersbakken/rtags")
606 (commit (string-append "v" version))))
607 (file-name (git-file-name name version))
608 (patches (search-patches "rtags-separate-rct.patch"))
609 (modules '((guix build utils)))
610 (snippet
611 ;; Part of spliting rct with rtags.
612 ;; Substitute #include "rct/header.h" with #include <rct/header.h>.
613 '(with-directory-excursion "src"
614 (delete-file-recursively "rct") ;remove bundled copy
615 (let ((files (find-files "." ".*\\.cpp|.*\\.h")))
616 (substitute* files
617 (("#include ?\"rct/(.*.h)\"" all header)
618 (string-append "#include <rct/" header ">")))
619 #t)))
620 (sha256
621 (base32
622 "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0"))))
623 (build-system cmake-build-system)
624 (arguments
625 '(#:build-type "RelWithDebInfo"
626 #:configure-flags
627 '("-DRTAGS_NO_ELISP_FILES=1"
628 "-DBUILD_TESTING=FALSE")
629 #:tests? #f))
630 (native-inputs
631 `(("pkg-config" ,pkg-config)))
632 (inputs
633 `(("bash-completion" ,bash-completion)
634 ("clang" ,clang)
635 ("llvm" ,llvm)
636 ("lua" ,lua)
637 ("rct" ,rct)
638 ("selene" ,selene)))
639 (home-page "https://github.com/Andersbakken/rtags")
640 (synopsis "Indexer for the C language family with Emacs integration")
641 (description
642 "RTags is a client/server application that indexes C/C++ code and keeps a
643 persistent file-based database of references, declarations, definitions,
644 symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you
645 to find symbols by name (including nested class and namespace scope). Most
646 importantly we give you proper follow-symbol and find-references support.")
647 (license license:gpl3+)))
648
649 (define-public colormake
650 (package
651 (name "colormake")
652 (version "0.9.20140503")
653 (source
654 (origin
655 (method git-fetch)
656 (uri (git-reference
657 (url "https://github.com/pagekite/Colormake")
658 (commit version)))
659 (file-name (git-file-name name version))
660 (sha256
661 (base32 "1f9v5s0viq4yc9iv6701h3pv7j21zz1ckl37lpp9hsnliiizv03p"))))
662 (build-system trivial-build-system)
663 (native-inputs
664 `(("bash" ,bash)
665 ("perl" ,perl)))
666 (arguments
667 `(#:modules ((guix build utils))
668 #:builder
669 (begin
670 (use-modules (guix build utils))
671 (copy-recursively (assoc-ref %build-inputs "source") "source")
672 (chdir "source")
673 (patch-shebang "colormake.pl"
674 (list (string-append (assoc-ref %build-inputs "perl")
675 "/bin")))
676 (let* ((out (assoc-ref %outputs "out"))
677 (bin (string-append out "/bin"))
678 (doc (string-append out "/share/doc"))
679 (install-files (lambda (files directory)
680 (for-each (lambda (file)
681 (install-file file directory))
682 files))))
683 (substitute* "colormake"
684 (("colormake\\.pl") (string-append bin "/colormake.pl"))
685 (("/bin/bash")
686 (string-append (assoc-ref %build-inputs "bash") "/bin/sh")))
687 (install-file "colormake.1" (string-append doc "/man/man1"))
688 (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc)
689 (install-files '("colormake" "colormake-short" "clmake"
690 "clmake-short" "colormake.pl")
691 bin)
692 #t))))
693 (home-page "https://bre.klaki.net/programs/colormake/")
694 (synopsis "Wrapper around @command{make} to produce colored output")
695 (description "This package provides a wrapper around @command{make} to
696 produce colored output.")
697 (license license:gpl2+)))
698
699 (define-public makefile2graph
700 (package
701 (name "makefile2graph")
702 (version "1.5.0")
703 (source
704 (origin
705 (method git-fetch)
706 (uri (git-reference
707 (url "https://github.com/lindenb/makefile2graph")
708 (commit (string-append "v" version))))
709 (file-name (git-file-name name version))
710 (sha256
711 (base32 "1gjfk3d8qg3cla7qd2y7r9s03whlfwy83q8k76xfcnqrjjfavdgk"))))
712 (build-system gnu-build-system)
713 (arguments
714 '(#:test-target "test"
715 #:make-flags (list "CC=gcc" (string-append "prefix=" %output))
716 #:phases
717 (modify-phases %standard-phases
718 (delete 'configure))))
719 (native-inputs
720 `(("graphviz" ,graphviz)))
721 (home-page "https://github.com/lindenb/makefile2graph")
722 (synopsis "Creates a graph of dependencies from GNU Make")
723 (description
724 "@code{make2graph} creates a graph of dependencies from GNU Make. The
725 output is a graphviz-dot file, a Gexf-XML file or a list of the deepest
726 independent targets.")
727 (license license:expat)))
728
729 (define-public uncrustify
730 (package
731 (name "uncrustify")
732 (version "0.69.0")
733 (source (origin
734 (method git-fetch)
735 (uri (git-reference
736 (url "https://github.com/uncrustify/uncrustify/")
737 (commit (string-append name "-" version))))
738 (file-name (git-file-name name version))
739 (sha256
740 (base32
741 "0sqrg13kp8fwymq40976bq380bzw40g4ss7ihlbq45d0f90ifa1k"))))
742 (build-system cmake-build-system)
743 (native-inputs
744 `(("unzip" ,unzip)
745 ("python" ,python-wrapper)))
746 (arguments
747 `(#:phases
748 (modify-phases %standard-phases
749 (add-after 'unpack 'unpack-etc
750 (lambda* (#:key inputs outputs #:allow-other-keys)
751 ;; Configuration samples are not installed by default.
752 (let* ((output (assoc-ref outputs "out"))
753 (etcdir (string-append output "/etc")))
754 (for-each (lambda (l)
755 (install-file l etcdir))
756 (find-files "etc" "\\.cfg$")))
757 #t)))))
758 (home-page "http://uncrustify.sourceforge.net/")
759 (synopsis "Code formatter for C and other related languages")
760 (description
761 "Beautify source code in many languages of the C family (C, C++, C#,
762 Objective@tie{}C, D, Java, Pawn, and Vala). Features:
763 @itemize
764 @item Indent and align code.
765 @item Reformat comments (a little bit).
766 @item Fix inter-character spacing.
767 @item Add or remove parens / braces.
768 @item Supports embedded SQL @code{EXEC SQL} stuff.
769 @item Highly configurable - More than 600 configurable options.
770 @end itemize\n")
771 (license license:gpl2+)))
772
773 (define-public astyle
774 (package
775 (name "astyle")
776 (version "3.1")
777 (source
778 (origin
779 (method url-fetch)
780 (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
781 version "/astyle_" version "_linux.tar.gz"))
782 (sha256
783 (base32
784 "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b"))))
785 (build-system gnu-build-system)
786 (arguments
787 `(#:tests? #f ;no tests
788 #:make-flags (list (string-append "prefix=" %output)
789 "INSTALL=install"
790 "all")
791 #:modules ((guix build gnu-build-system) ;; FIXME use %default-modules
792 (guix build utils)
793 (ice-9 regex))
794 #:phases
795 (modify-phases %standard-phases
796 (replace 'configure
797 (lambda _ (chdir "build/gcc") #t))
798 (add-after 'install 'install-libs
799 (lambda* (#:key outputs #:allow-other-keys)
800 ;; Libraries and includes are not installed by default
801 (let* ((output (assoc-ref outputs "out"))
802 (incdir (string-append output "/include"))
803 (libdir (string-append output "/lib")))
804 (define (make-so-link sofile strip-pattern)
805 (symlink
806 (basename sofile)
807 (regexp-substitute #f
808 (string-match strip-pattern sofile)
809 'pre)))
810 (mkdir-p incdir)
811 (copy-file "../../src/astyle.h"
812 (string-append incdir "/astyle.h"))
813 (mkdir-p libdir)
814 (for-each (lambda (l)
815 (copy-file
816 l (string-append libdir "/" (basename l))))
817 (find-files "bin" "lib*"))
818 (for-each
819 (lambda (sofile)
820 (make-so-link sofile "(\\.[0-9]){3}$") ;; link .so
821 (make-so-link sofile "(\\.[0-9]){2}$")) ;; link .so.3
822 (find-files libdir "lib.*\\.so\\..*")))
823 #t)))))
824 (home-page "http://astyle.sourceforge.net/")
825 (synopsis "Source code indenter, formatter, and beautifier")
826 (description
827 "Artistic Style is a source code indenter, formatter, and beautifier for
828 the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
829 (license license:lgpl3+)))
830
831 (define-public indent
832 (package
833 (name "indent")
834 (version "2.2.12")
835 (source (origin
836 (method url-fetch)
837 (uri (string-append "mirror://gnu/indent/indent-" version
838 ".tar.gz"))
839 (sha256
840 (base32 "12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7"))))
841 (build-system gnu-build-system)
842 (arguments
843 `(#:phases
844 (modify-phases %standard-phases
845 (add-after 'unpack 'fix-docdir
846 (lambda _
847 ;; Although indent uses a modern autoconf in which docdir
848 ;; defaults to PREFIX/share/doc, the doc/Makefile.am
849 ;; overrides this to be in PREFIX/doc. Fix this.
850 (substitute* "doc/Makefile.in"
851 (("^docdir = .*$") "docdir = @docdir@\n"))
852 #t))
853 (add-after 'unpack 'fix-configure
854 (lambda* (#:key inputs native-inputs #:allow-other-keys)
855 ;; Replace outdated config.sub and config.guess:
856 (with-directory-excursion "config"
857 (for-each (lambda (file)
858 (install-file
859 (string-append (assoc-ref
860 (or native-inputs inputs) "automake")
861 "/share/automake-"
862 ,(version-major+minor
863 (package-version automake))
864 "/" file) "."))
865 '("config.sub" "config.guess")))
866 #t)))))
867 (native-inputs
868 `(("texinfo" ,texinfo)
869 ("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
870 (synopsis "Code reformatter")
871 (description
872 "Indent is a program that makes source code easier to read by
873 reformatting it in a consistent style. It can change the style to one of
874 several different styles such as GNU, BSD or K&R. It has some flexibility to
875 deal with incomplete or malformed syntax. GNU indent offers several
876 extensions over the standard utility.")
877 (license license:gpl3+)
878 (home-page "https://www.gnu.org/software/indent/")))
879
880 (define-public amalgamate
881 (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208")
882 (revision "0")
883 (version (git-version "1.1.1" revision commit)))
884 (package
885 (name "amalgamate")
886 (version version)
887 (home-page "https://github.com/edlund/amalgamate")
888 (source
889 (origin
890 (method git-fetch)
891 (uri (git-reference
892 (url home-page)
893 (commit commit)))
894 (sha256
895 (base32
896 "0cllaraw8mxs8q2nr28nhgzkb417gj2wcklqg59w84f4lc78k3yb"))
897 (file-name (git-file-name name version))
898 (modules '((guix build utils)))
899 (snippet
900 '(substitute* "test.sh"
901 (("test_command \"cc -Wall -Wextra -o source.out source.c\"" all)
902 "test_command \"gcc -Wall -Wextra -o source.out source.c\"")))))
903 (build-system gnu-build-system)
904 (inputs
905 `(("python" ,python-wrapper)))
906 (arguments
907 `(#:phases
908 (modify-phases %standard-phases
909 (delete 'configure)
910 (delete 'build)
911 (replace 'install
912 (lambda* (#:key outputs #:allow-other-keys)
913 (let* ((out (assoc-ref outputs "out"))
914 (bin (string-append out "/bin")))
915 (install-file "amalgamate.py" bin))))
916 (replace 'check
917 (lambda _
918 (invoke "./test.sh"))))))
919 (synopsis "Tool for amalgamating C source and header files")
920 ;; The package is indeed a script file, and the term "amalgamate.py" is
921 ;; used by upstream.
922 (description "amalgamate.py aims to make it easy to use SQLite-style C
923 source and header amalgamation in projects.")
924 (license license:bsd-3))))