gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / code.scm
CommitLineData
23153c90 1;;; GNU Guix --- Functional package management for GNU
dda0ada3 2;;; Copyright © 2013, 2015, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
99e64a6e 3;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4bfd8579 4;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net>
683910e9 5;;; Copyright © 2016, 2017, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
ba7cd0fd 6;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
8af20b99 7;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
f7fc9667 8;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
4b3070f7 9;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
4715f92e 10;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
c1e5109b 11;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
e470abf8
LC
12;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
13;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
62b8ae1a 14;;; Copyright © 2019 Hartmut Goebel <h.goebel@goebel-consult.de>
d8ccff83 15;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
58056d5b 16;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
89c9e647 17;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
23153c90
LC
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)
59bd4b90 36 #:use-module (guix utils)
23153c90 37 #:use-module (guix download)
ad8a4d6d 38 #:use-module (guix git-download)
d13586bf 39 #:use-module ((guix licenses) #:prefix license:)
23153c90 40 #:use-module (guix build-system gnu)
76e14638 41 #:use-module (guix build-system cmake)
830ea727 42 #:use-module (guix build-system python)
dc993847 43 #:use-module (guix build-system trivial)
457fc22d 44 #:use-module (gnu packages)
ad8a4d6d
FT
45 #:use-module (gnu packages autogen)
46 #:use-module (gnu packages autotools)
76e14638 47 #:use-module (gnu packages base)
ad8a4d6d 48 #:use-module (gnu packages bash)
58056d5b 49 #:use-module (gnu packages c)
d13586bf 50 #:use-module (gnu packages compression)
457fc22d 51 #:use-module (gnu packages cpp)
89c9e647
JL
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages elf)
99e64a6e 54 #:use-module (gnu packages emacs)
76e14638 55 #:use-module (gnu packages gcc)
906dcb20 56 #:use-module (gnu packages graphviz)
1b8c7d12 57 #:use-module (gnu packages llvm)
58056d5b 58 #:use-module (gnu packages linux)
1b8c7d12
MB
59 #:use-module (gnu packages lua)
60 #:use-module (gnu packages ncurses)
d13586bf 61 #:use-module (gnu packages pcre)
99e64a6e 62 #:use-module (gnu packages perl)
d8ccff83 63 #:use-module (gnu packages perl-compression)
ad8a4d6d
FT
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages python)
cd0322a3 66 #:use-module (gnu packages sqlite)
58056d5b
MB
67 #:use-module (gnu packages texinfo)
68 #:use-module (gnu packages web)
69 #:use-module (gnu packages xml))
23153c90
LC
70
71;;; Tools to deal with source code: metrics, cross-references, etc.
72
99e64a6e
LC
73(define-public cflow
74 (package
75 (name "cflow")
cfae5382 76 (version "1.6")
99e64a6e
LC
77 (source (origin
78 (method url-fetch)
79 (uri (string-append "mirror://gnu/cflow/cflow-"
80 version ".tar.bz2"))
81 (sha256
82 (base32
cfae5382 83 "1mzd3yf0dfv8h2av5vsxxlhpk21nw064h91b2kgfrdz92r0pnj1l"))))
99e64a6e
LC
84 (build-system gnu-build-system)
85
86 ;; Needed to have cflow-mode.el installed.
b8fc3622 87 (native-inputs `(("emacs" ,emacs-minimal)))
65d98906
OP
88 (arguments
89 '(#:configure-flags (list (string-append "CPPFLAGS="
90 "-D" "CFLOW_PREPROC=\\\""
91 (assoc-ref %build-inputs "gcc")
92 "/bin/cpp\\\""))))
6fd52309 93 (home-page "https://www.gnu.org/software/cflow/")
99e64a6e
LC
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
97control flow of the program. It can output the graph in several styles and
e881752c 98in either the POSIX format or in an extended GNU format. cflow also includes
99e64a6e 99a major mode for Emacs for examining the flowcharts that it produces.")
d13586bf 100 (license license:gpl3+)))
99e64a6e
LC
101
102(define-public complexity
103 (package
104 (name "complexity")
1e42d8b8 105 (version "1.10")
99e64a6e
LC
106 (source (origin
107 (method url-fetch)
108 (uri (string-append "mirror://gnu/complexity/complexity-"
1e42d8b8 109 version ".tar.xz"))
99e64a6e
LC
110 (sha256
111 (base32
1e42d8b8 112 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
99e64a6e
LC
113 (build-system gnu-build-system)
114 (native-inputs
115 `(("texinfo" ,texinfo)
116 ("autogen" ,autogen)))
6fd52309 117 (home-page "https://www.gnu.org/software/complexity/")
99e64a6e
LC
118 (synopsis "Analyze complexity of C functions")
119 (description
120 "GNU complexity provides tools for finding procedures that are
121convoluted, overly long or otherwise difficult to understand. This
122may help in learning or reviewing unfamiliar code or perhaps
123highlighting your own code that seemed comprehensible when you wrote it.")
d13586bf 124 (license license:gpl3+)))
99e64a6e
LC
125
126(define-public global ; a global variable
127 (package
128 (name "global")
8b92be32 129 (version "6.6.5")
99e64a6e
LC
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "mirror://gnu/global/global-"
133 version ".tar.gz"))
134 (sha256
135 (base32
8b92be32 136 "10vvsgx8v54whb4j9mk5qqyb5h3rdd9da0il3wir8pcpksyk0dww"))))
99e64a6e
LC
137 (build-system gnu-build-system)
138 (inputs `(("ncurses" ,ncurses)
e1ac691d 139 ("libltdl" ,libltdl)
2e59a63b 140 ("sqlite" ,sqlite)
141 ("python-wrapper" ,python-wrapper)))
99e64a6e
LC
142 (arguments
143 `(#:configure-flags
144 (list (string-append "--with-ncurses="
e1ac691d
LC
145 (assoc-ref %build-inputs "ncurses"))
146 (string-append "--with-sqlite3="
ecd297a1
EF
147 (assoc-ref %build-inputs "sqlite"))
148 "--disable-static")
99e64a6e 149
9d9951d6
EF
150 #:phases
151 (modify-phases %standard-phases
152 (add-after 'install 'post-install
153 (lambda* (#:key outputs #:allow-other-keys)
683910e9 154 ;; Install the plugin files in the right place.
9d9951d6
EF
155 (let* ((out (assoc-ref outputs "out"))
156 (data (string-append out "/share/gtags"))
683910e9 157 (vim (string-append out "/share/vim/vimfiles/plugin"))
9d9951d6 158 (lisp (string-append out "/share/emacs/site-lisp")))
683910e9
EF
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"))
9d9951d6 167 #t))))))
6fd52309 168 (home-page "https://www.gnu.org/software/global/")
99e64a6e
LC
169 (synopsis "Cross-environment source code tag system")
170 (description
254a8819
CL
171 "GNU GLOBAL is a source code tagging system that functions in the same
172way across a wide array of environments, such as different text editors,
173shells and web browsers. The resulting tags are useful for quickly moving
174around in a large, deeply nested project.")
d13586bf 175 (license license:gpl3+)))
99e64a6e 176
23153c90
LC
177(define-public sloccount
178 (package
179 (name "sloccount")
180 (version "2.26")
181 (source (origin
182 (method url-fetch)
dda0ada3 183 (uri (string-append "https://dwheeler.com/sloccount/sloccount-"
23153c90
LC
184 version ".tar.gz"))
185 (sha256
186 (base32
187 "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs"))))
188 (build-system gnu-build-system)
189 (arguments
190 '(#:phases (modify-phases %standard-phases
f8503e2b
LC
191 (delete 'configure)
192 (add-before 'build 'make-dotl-files-older
23153c90
LC
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))
f8503e2b 204 (add-before 'install 'make-target-directories
23153c90
LC
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
e99b4772
RW
211 "/share/doc"))
212 #t)))
f8503e2b 213 (replace 'check
23153c90
LC
214 (lambda _
215 (setenv "HOME" (getcwd))
216 (setenv "PATH"
217 (string-append (getcwd) ":"
218 (getenv "PATH")))
e99b4772 219 (invoke "make" "test"))))
23153c90
LC
220
221 #:make-flags (list (string-append "PREFIX="
222 (assoc-ref %outputs "out")))))
223 (inputs `(("perl" ,perl)))
dda0ada3 224 (home-page "https://dwheeler.com/sloccount/")
23153c90
LC
225 (synopsis "Count physical source lines of code (SLOC)")
226 (description
227 "SLOCCount is a set of the programs for counting source lines of
228code (SLOC) in large software systems. It can automatically identify and
229measure a wide range of programming languages. It automatically estimates the
230effort, time, and money it would take to develop the software, using the
231COCOMO model or user-provided parameters.")
d13586bf
232 (license license:gpl2+)))
233
f7fc9667
AW
234(define-public cloc
235 (package
236 (name "cloc")
bfc0a2ff 237 (version "1.88")
f7fc9667
AW
238 (source
239 (origin
38878020
TGR
240 (method git-fetch)
241 (uri (git-reference
b0e7b699 242 (url "https://github.com/AlDanial/cloc")
38878020
TGR
243 (commit version)))
244 (file-name (git-file-name name version))
f7fc9667 245 (sha256
bfc0a2ff 246 (base32 "1ixgswzbzv63bl50gb2kgaqr0jcicjz6w610hi9fal1i7744zraw"))))
f7fc9667
AW
247 (build-system gnu-build-system)
248 (inputs
249 `(("coreutils" ,coreutils)
250 ("perl" ,perl)
251 ("perl-algorithm-diff" ,perl-algorithm-diff)
95943ed7
TGR
252 ("perl-digest-md5" ,perl-digest-md5)
253 ("perl-parallel-forkmanager" ,perl-parallel-forkmanager)
254 ("perl-regexp-common" ,perl-regexp-common)))
f7fc9667
AW
255 (arguments
256 `(#:phases (modify-phases %standard-phases
295fc415
TGR
257 (delete 'configure) ; nothing to configure
258 (delete 'build) ; nothing to build
f7fc9667
AW
259 (replace 'install
260 (lambda* (#:key inputs outputs #:allow-other-keys)
261 (let* ((out (assoc-ref outputs "out")))
53244d1f
TGR
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)))
f7fc9667
AW
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
282of source code in many programming languages. Given two versions of a code
283base, cloc can compute differences in blank, comment, and source lines.
284
285cloc contains code from David Wheeler's SLOCCount. Compared to SLOCCount,
e0f49664 286cloc can handle a greater variety of programming languages.")
f7fc9667
AW
287 (license license:gpl2+)))
288
d13586bf
289(define-public the-silver-searcher
290 (package
291 (name "the-silver-searcher")
ffa82227 292 (version "2.2.0")
d13586bf
293 (source (origin
294 (method url-fetch)
295 (uri (string-append
422a6cd4 296 "https://geoff.greer.fm/ag/releases/the_silver_searcher-"
d13586bf
297 version ".tar.gz"))
298 (sha256
299 (base32
ffa82227 300 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
d13586bf
301 (build-system gnu-build-system)
302 (native-inputs
392f3266 303 `(("pkg-config" ,pkg-config)))
d13586bf
304 (inputs
305 `(("pcre" ,pcre)
306 ("xz" ,xz)
307 ("zlib" ,zlib)))
422a6cd4 308 (home-page "https://geoff.greer.fm/ag/")
d13586bf
309 (synopsis "Fast code searching tool")
310 (description
6acff0f9
TGR
311 "The Silver Searcher (@command{ag}) is a tool for quickly searching large
312numbers of files. It's intended primarily for source code repositories, and
313respects files like @file{.gitignore} and @file{.hgignore}. It's also an order
314of magnitude faster than its inspiration, @command{ack}, and less specialised
315tools such as @command{grep}.")
d13586bf 316 (license license:asl2.0)))
76e14638 317
a4e6356e
RW
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)
e819fc02 330 (home-page "https://daniel.haxx.se/projects/trio/")
a4e6356e
RW
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
334applications with a focus on portability or with the need for additional
335features 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
58056d5b 341(define-public universal-ctags
0658cc83
MB
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
f8eaeea8
MB
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
0658cc83
MB
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
58056d5b
MB
423found in source files for many popular programming languages. This index
424makes it easy for text editors and other tools to locate the indexed items.
425Universal Ctags improves on traditional ctags because of its multilanguage
426support, its ability for the user to define new languages searched by regular
427expressions, and its ability to generate emacs-style TAGS files.")
0658cc83 428 (license license:gpl2+)))
58056d5b 429
76e14638
RW
430(define-public withershins
431 (package
432 (name "withershins")
433 (version "0.1")
3dd14ea7
TGR
434 (source
435 (origin
436 (method git-fetch)
437 (uri (git-reference
b0e7b699 438 (url "https://github.com/cameronwhite/withershins")
3dd14ea7
TGR
439 (commit (string-append "v" version))))
440 (file-name (git-file-name name version))
441 (sha256
442 (base32 "1cviqvbbcwljm1zx12j6511hazr3kscwrvcyifrkfi4fpy5z985m"))))
76e14638
RW
443 (build-system cmake-build-system)
444 (arguments
445 `(#:out-of-source? #f
66c2df9e
TGR
446 #:configure-flags
447 ;; XXX A (justified!) misleading-indentation error breaks the build.
448 (list "-DENABLE_WERROR=OFF")
76e14638
RW
449 #:phases
450 (modify-phases %standard-phases
451 (add-after
452 'unpack 'find-libiberty
453 (lambda _
25734108 454 (let ((libiberty (assoc-ref %build-inputs "libiberty")))
76e14638 455 (substitute* "cmake/FindIberty.cmake"
25734108
RW
456 (("/usr/include") (string-append libiberty "/include"))
457 (("libiberty.a iberty")
458 (string-append "NAMES libiberty.a iberty\nPATHS \""
459 libiberty "/lib" "\"")))
76e14638
RW
460 #t)))
461 (replace
462 'install
463 (lambda* (#:key outputs #:allow-other-keys)
f3860753
TGR
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))
76e14638
RW
471 #t)))))
472 (home-page "https://github.com/cameronwhite/withershins")
473 (inputs
25734108 474 `(("libiberty" ,libiberty)
76e14638
RW
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
480stack 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+)))
0084aaf3
LC
484
485(define-public lcov
adbcc3ed
TGR
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
0084aaf3
LC
527GNU@tie{}Binutils, which provides information about what parts of a program
528are actually executed (i.e., \"covered\") while running a particular test
529case. The extension consists of a set of Perl scripts which build on the
530textual @command{gcov} output to implement the following enhanced
531functionality such as HTML output.")
adbcc3ed 532 (license license:gpl2+)))
4b3070f7 533
830ea727
LC
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
550in the lcov format to the XML format of
551@uref{http://cobertura.github.io/cobertura/, Cobertura}, a Java code coverage
552tool. It allows continuous integration servers like Jenkins to aggregate
553results and determine build stability.")
554 (license license:asl2.0)))
555
89c9e647
JL
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
590languages, Python and Bash. Kcov was originally a fork of Bcov, but has since
591evolved to support a large feature set in addition to that of Bcov.
592
593Kcov uses DWARF debugging information for compiled programs to make it
594possible to collect coverage information without special compiler switches.")
595 (license license:gpl2+)))
596
4b3070f7
FT
597(define-public rtags
598 (package
599 (name "rtags")
af147cdd 600 (version "2.18")
457fc22d
FT
601 (source
602 (origin
84ae0e29
TGR
603 (method git-fetch)
604 (uri (git-reference
b0e7b699 605 (url "https://github.com/Andersbakken/rtags")
84ae0e29
TGR
606 (commit (string-append "v" version))))
607 (file-name (git-file-name name version))
457fc22d
FT
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)
6cbee49d
MW
618 (string-append "#include <rct/" header ">")))
619 #t)))
457fc22d
FT
620 (sha256
621 (base32
84ae0e29 622 "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0"))))
4b3070f7
FT
623 (build-system cmake-build-system)
624 (arguments
3def739d
TGR
625 '(#:build-type "RelWithDebInfo"
626 #:configure-flags
457fc22d 627 '("-DRTAGS_NO_ELISP_FILES=1"
457fc22d 628 "-DBUILD_TESTING=FALSE")
4b3070f7 629 #:tests? #f))
457fc22d
FT
630 (native-inputs
631 `(("pkg-config" ,pkg-config)))
4b3070f7 632 (inputs
457fc22d
FT
633 `(("bash-completion" ,bash-completion)
634 ("clang" ,clang)
4b3070f7 635 ("llvm" ,llvm)
457fc22d
FT
636 ("lua" ,lua)
637 ("rct" ,rct)
638 ("selene" ,selene)))
84ae0e29 639 (home-page "https://github.com/Andersbakken/rtags")
4b3070f7
FT
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
643persistent file-based database of references, declarations, definitions,
644symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you
645to find symbols by name (including nested class and namespace scope). Most
646importantly we give you proper follow-symbol and find-references support.")
647 (license license:gpl3+)))
dc993847
OP
648
649(define-public colormake
650 (package
651 (name "colormake")
652 (version "0.9.20140503")
653 (source
654 (origin
213c32e4
TGR
655 (method git-fetch)
656 (uri (git-reference
b0e7b699 657 (url "https://github.com/pagekite/Colormake")
213c32e4
TGR
658 (commit version)))
659 (file-name (git-file-name name version))
dc993847 660 (sha256
213c32e4 661 (base32 "1f9v5s0viq4yc9iv6701h3pv7j21zz1ckl37lpp9hsnliiizv03p"))))
dc993847
OP
662 (build-system trivial-build-system)
663 (native-inputs
664 `(("bash" ,bash)
213c32e4 665 ("perl" ,perl)))
dc993847
OP
666 (arguments
667 `(#:modules ((guix build utils))
668 #:builder
669 (begin
670 (use-modules (guix build utils))
213c32e4
TGR
671 (copy-recursively (assoc-ref %build-inputs "source") "source")
672 (chdir "source")
dc993847
OP
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")
e3cfef22
MW
691 bin)
692 #t))))
0e564b5e 693 (home-page "https://bre.klaki.net/programs/colormake/")
dc993847
OP
694 (synopsis "Wrapper around @command{make} to produce colored output")
695 (description "This package provides a wrapper around @command{make} to
696produce colored output.")
697 (license license:gpl2+)))
906dcb20
CB
698
699(define-public makefile2graph
700 (package
701 (name "makefile2graph")
702 (version "1.5.0")
104264cd
TGR
703 (source
704 (origin
705 (method git-fetch)
706 (uri (git-reference
b0e7b699 707 (url "https://github.com/lindenb/makefile2graph")
104264cd
TGR
708 (commit (string-append "v" version))))
709 (file-name (git-file-name name version))
710 (sha256
711 (base32 "1gjfk3d8qg3cla7qd2y7r9s03whlfwy83q8k76xfcnqrjjfavdgk"))))
906dcb20
CB
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
725output is a graphviz-dot file, a Gexf-XML file or a list of the deepest
726independent targets.")
727 (license license:expat)))
9c4dcfaf
PN
728
729(define-public uncrustify
730 (package
731 (name "uncrustify")
ae5de93a 732 (version "0.69.0")
9c4dcfaf 733 (source (origin
b5944fcb
PN
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))
9c4dcfaf
PN
739 (sha256
740 (base32
ae5de93a 741 "0sqrg13kp8fwymq40976bq380bzw40g4ss7ihlbq45d0f90ifa1k"))))
9c4dcfaf
PN
742 (build-system cmake-build-system)
743 (native-inputs
34843fe9
PN
744 `(("unzip" ,unzip)
745 ("python" ,python-wrapper)))
9c4dcfaf
PN
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#,
762Objective@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+)))
c1e5109b
LC
772
773(define-public astyle
774 (package
775 (name "astyle")
4bfd8579 776 (version "3.1")
c1e5109b
LC
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
4bfd8579 784 "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b"))))
c1e5109b
LC
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")
62b8ae1a
HG
791 #:modules ((guix build gnu-build-system) ;; FIXME use %default-modules
792 (guix build utils)
793 (ice-9 regex))
c1e5109b
LC
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)
0c6ab522 800 ;; Libraries and includes are not installed by default
c1e5109b 801 (let* ((output (assoc-ref outputs "out"))
0c6ab522 802 (incdir (string-append output "/include"))
c1e5109b 803 (libdir (string-append output "/lib")))
62b8ae1a
HG
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)))
0c6ab522
HG
810 (mkdir-p incdir)
811 (copy-file "../../src/astyle.h"
812 (string-append incdir "/astyle.h"))
62b8ae1a
HG
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\\..*")))
c1e5109b
LC
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
828the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
829 (license license:lgpl3+)))
e470abf8
LC
830
831(define-public indent
832 (package
833 (name "indent")
7fe6dcf7 834 (version "2.2.12")
e470abf8
LC
835 (source (origin
836 (method url-fetch)
837 (uri (string-append "mirror://gnu/indent/indent-" version
838 ".tar.gz"))
7fe6dcf7
MB
839 (sha256
840 (base32 "12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7"))))
e470abf8
LC
841 (build-system gnu-build-system)
842 (arguments
9d10a634
MW
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"))
59bd4b90
MO
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")))
9d10a634 866 #t)))))
7fe6dcf7 867 (native-inputs
59bd4b90
MO
868 `(("texinfo" ,texinfo)
869 ("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
e470abf8
LC
870 (synopsis "Code reformatter")
871 (description
872 "Indent is a program that makes source code easier to read by
873reformatting it in a consistent style. It can change the style to one of
874several different styles such as GNU, BSD or K&R. It has some flexibility to
875deal with incomplete or malformed syntax. GNU indent offers several
876extensions over the standard utility.")
877 (license license:gpl3+)
878 (home-page "https://www.gnu.org/software/indent/")))
ad8a4d6d
FT
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
923source and header amalgamation in projects.")
924 (license license:bsd-3))))