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