gnu: Add texlive-times.
[jackhill/guix/guix.git] / gnu / packages / code.scm
CommitLineData
23153c90 1;;; GNU Guix --- Functional package management for GNU
4b3070f7 2;;; Copyright © 2013, 2015, 2018 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>
c65bfc65 5;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
8fadbc4b 6;;; Copyright © 2017, 2018, 2019 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>
23153c90
LC
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages code)
31 #:use-module (guix packages)
32 #:use-module (guix download)
ad8a4d6d 33 #:use-module (guix git-download)
d13586bf 34 #:use-module ((guix licenses) #:prefix license:)
23153c90 35 #:use-module (guix build-system gnu)
76e14638 36 #:use-module (guix build-system cmake)
dc993847 37 #:use-module (guix build-system trivial)
457fc22d 38 #:use-module (gnu packages)
ad8a4d6d
FT
39 #:use-module (gnu packages autogen)
40 #:use-module (gnu packages autotools)
76e14638 41 #:use-module (gnu packages base)
ad8a4d6d 42 #:use-module (gnu packages bash)
d13586bf 43 #:use-module (gnu packages compression)
457fc22d 44 #:use-module (gnu packages cpp)
99e64a6e 45 #:use-module (gnu packages emacs)
76e14638 46 #:use-module (gnu packages gcc)
906dcb20 47 #:use-module (gnu packages graphviz)
d13586bf 48 #:use-module (gnu packages pcre)
99e64a6e 49 #:use-module (gnu packages perl)
ad8a4d6d
FT
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
cd0322a3 52 #:use-module (gnu packages sqlite)
99e64a6e 53 #:use-module (gnu packages texinfo)
99e64a6e 54 #:use-module (gnu packages ncurses)
4b3070f7 55 #:use-module (gnu packages llvm)
ad8a4d6d 56 #:use-module (gnu packages lua))
23153c90
LC
57
58;;; Tools to deal with source code: metrics, cross-references, etc.
59
99e64a6e
LC
60(define-public cflow
61 (package
62 (name "cflow")
cfae5382 63 (version "1.6")
99e64a6e
LC
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "mirror://gnu/cflow/cflow-"
67 version ".tar.bz2"))
68 (sha256
69 (base32
cfae5382 70 "1mzd3yf0dfv8h2av5vsxxlhpk21nw064h91b2kgfrdz92r0pnj1l"))))
99e64a6e
LC
71 (build-system gnu-build-system)
72
73 ;; Needed to have cflow-mode.el installed.
b8fc3622 74 (native-inputs `(("emacs" ,emacs-minimal)))
65d98906
OP
75 (arguments
76 '(#:configure-flags (list (string-append "CPPFLAGS="
77 "-D" "CFLOW_PREPROC=\\\""
78 (assoc-ref %build-inputs "gcc")
79 "/bin/cpp\\\""))))
6fd52309 80 (home-page "https://www.gnu.org/software/cflow/")
99e64a6e
LC
81 (synopsis "Create a graph of control flow within a program")
82 (description
83 "GNU cflow analyzes C source files and produces a graph charting the
84control flow of the program. It can output the graph in several styles and
e881752c 85in either the POSIX format or in an extended GNU format. cflow also includes
99e64a6e 86a major mode for Emacs for examining the flowcharts that it produces.")
d13586bf 87 (license license:gpl3+)))
99e64a6e
LC
88
89(define-public complexity
90 (package
91 (name "complexity")
1e42d8b8 92 (version "1.10")
99e64a6e
LC
93 (source (origin
94 (method url-fetch)
95 (uri (string-append "mirror://gnu/complexity/complexity-"
1e42d8b8 96 version ".tar.xz"))
99e64a6e
LC
97 (sha256
98 (base32
1e42d8b8 99 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
99e64a6e
LC
100 (build-system gnu-build-system)
101 (native-inputs
102 `(("texinfo" ,texinfo)
103 ("autogen" ,autogen)))
6fd52309 104 (home-page "https://www.gnu.org/software/complexity/")
99e64a6e
LC
105 (synopsis "Analyze complexity of C functions")
106 (description
107 "GNU complexity provides tools for finding procedures that are
108convoluted, overly long or otherwise difficult to understand. This
109may help in learning or reviewing unfamiliar code or perhaps
110highlighting your own code that seemed comprehensible when you wrote it.")
d13586bf 111 (license license:gpl3+)))
99e64a6e
LC
112
113(define-public global ; a global variable
114 (package
115 (name "global")
c65bfc65 116 (version "6.6.3")
99e64a6e
LC
117 (source (origin
118 (method url-fetch)
119 (uri (string-append "mirror://gnu/global/global-"
120 version ".tar.gz"))
121 (sha256
122 (base32
c65bfc65 123 "0735pj47dnspf20n0j1px24p59nwjinlmlb2n32ln1hvdkprivnb"))))
99e64a6e
LC
124 (build-system gnu-build-system)
125 (inputs `(("ncurses" ,ncurses)
e1ac691d
LC
126 ("libltdl" ,libltdl)
127 ("sqlite" ,sqlite)))
99e64a6e
LC
128 (arguments
129 `(#:configure-flags
130 (list (string-append "--with-ncurses="
e1ac691d
LC
131 (assoc-ref %build-inputs "ncurses"))
132 (string-append "--with-sqlite3="
133 (assoc-ref %build-inputs "sqlite")))
99e64a6e 134
9d9951d6
EF
135 #:phases
136 (modify-phases %standard-phases
137 (add-after 'install 'post-install
138 (lambda* (#:key outputs #:allow-other-keys)
139 ;; Install the Emacs Lisp file in the right place.
140 (let* ((out (assoc-ref outputs "out"))
141 (data (string-append out "/share/gtags"))
142 (lisp (string-append out "/share/emacs/site-lisp")))
143 (install-file (string-append data "/gtags.el") lisp)
144 (delete-file (string-append data "/gtags.el"))
145 #t))))))
6fd52309 146 (home-page "https://www.gnu.org/software/global/")
99e64a6e
LC
147 (synopsis "Cross-environment source code tag system")
148 (description
254a8819
CL
149 "GNU GLOBAL is a source code tagging system that functions in the same
150way across a wide array of environments, such as different text editors,
151shells and web browsers. The resulting tags are useful for quickly moving
152around in a large, deeply nested project.")
d13586bf 153 (license license:gpl3+)))
99e64a6e 154
23153c90
LC
155(define-public sloccount
156 (package
157 (name "sloccount")
158 (version "2.26")
159 (source (origin
160 (method url-fetch)
161 (uri (string-append "http://www.dwheeler.com/sloccount/sloccount-"
162 version ".tar.gz"))
163 (sha256
164 (base32
165 "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs"))))
166 (build-system gnu-build-system)
167 (arguments
168 '(#:phases (modify-phases %standard-phases
f8503e2b
LC
169 (delete 'configure)
170 (add-before 'build 'make-dotl-files-older
23153c90
LC
171 (lambda _
172 ;; Make the '.l' files as old as the '.c'
173 ;; files to avoid triggering the rule that
174 ;; requires Flex.
175 (define ref
176 (stat "README"))
177
178 (for-each (lambda (file)
179 (set-file-time file ref))
180 (find-files "." "\\.[chl]$"))
181 #t))
f8503e2b 182 (add-before 'install 'make-target-directories
23153c90
LC
183 (lambda* (#:key outputs #:allow-other-keys)
184 (let ((out (assoc-ref outputs "out")))
185 (mkdir-p (string-append out "/bin"))
186 (mkdir-p (string-append out
187 "/share/man/man1"))
188 (mkdir-p (string-append out
e99b4772
RW
189 "/share/doc"))
190 #t)))
f8503e2b 191 (replace 'check
23153c90
LC
192 (lambda _
193 (setenv "HOME" (getcwd))
194 (setenv "PATH"
195 (string-append (getcwd) ":"
196 (getenv "PATH")))
e99b4772 197 (invoke "make" "test"))))
23153c90
LC
198
199 #:make-flags (list (string-append "PREFIX="
200 (assoc-ref %outputs "out")))))
201 (inputs `(("perl" ,perl)))
202 (home-page "http://www.dwheeler.com/sloccount/")
203 (synopsis "Count physical source lines of code (SLOC)")
204 (description
205 "SLOCCount is a set of the programs for counting source lines of
206code (SLOC) in large software systems. It can automatically identify and
207measure a wide range of programming languages. It automatically estimates the
208effort, time, and money it would take to develop the software, using the
209COCOMO model or user-provided parameters.")
d13586bf
210 (license license:gpl2+)))
211
f7fc9667
AW
212(define-public cloc
213 (package
214 (name "cloc")
38878020 215 (version "1.82")
f7fc9667
AW
216 (source
217 (origin
38878020
TGR
218 (method git-fetch)
219 (uri (git-reference
220 (url "https://github.com/AlDanial/cloc.git")
221 (commit version)))
222 (file-name (git-file-name name version))
f7fc9667 223 (sha256
38878020 224 (base32 "0fsz07z0slfg58512fmnlj8pnxkc360bgf7fclg60v9clvcjbjsw"))))
f7fc9667
AW
225 (build-system gnu-build-system)
226 (inputs
227 `(("coreutils" ,coreutils)
228 ("perl" ,perl)
229 ("perl-algorithm-diff" ,perl-algorithm-diff)
95943ed7
TGR
230 ("perl-digest-md5" ,perl-digest-md5)
231 ("perl-parallel-forkmanager" ,perl-parallel-forkmanager)
232 ("perl-regexp-common" ,perl-regexp-common)))
f7fc9667
AW
233 (arguments
234 `(#:phases (modify-phases %standard-phases
295fc415
TGR
235 (delete 'configure) ; nothing to configure
236 (delete 'build) ; nothing to build
f7fc9667
AW
237 (replace 'install
238 (lambda* (#:key inputs outputs #:allow-other-keys)
239 (let* ((out (assoc-ref outputs "out")))
53244d1f
TGR
240 (invoke "make" "-C" "Unix"
241 (string-append "prefix=" out)
242 (string-append "INSTALL="
243 (assoc-ref inputs "coreutils")
244 "/bin/install")
245 "install")
246 #t)))
f7fc9667
AW
247 (add-after 'install 'wrap-program
248 (lambda* (#:key inputs outputs #:allow-other-keys)
249 (let ((out (assoc-ref outputs "out")))
250 (wrap-program (string-append out "/bin/cloc")
251 `("PERL5LIB" ":" =
252 ,(string-split (getenv "PERL5LIB") #\:)))
253 #t))))
254 #:out-of-source? #t
255 ;; Tests require some other packages.
256 #:tests? #f))
257 (home-page "https://github.com/AlDanial/cloc")
258 (synopsis "Count source lines of code (SLOC) and other source code metrics")
259 (description "cloc counts blank lines, comment lines, and physical lines
260of source code in many programming languages. Given two versions of a code
261base, cloc can compute differences in blank, comment, and source lines.
262
263cloc contains code from David Wheeler's SLOCCount. Compared to SLOCCount,
e0f49664 264cloc can handle a greater variety of programming languages.")
f7fc9667
AW
265 (license license:gpl2+)))
266
d13586bf
267(define-public the-silver-searcher
268 (package
269 (name "the-silver-searcher")
ffa82227 270 (version "2.2.0")
d13586bf
271 (source (origin
272 (method url-fetch)
273 (uri (string-append
422a6cd4 274 "https://geoff.greer.fm/ag/releases/the_silver_searcher-"
d13586bf
275 version ".tar.gz"))
276 (sha256
277 (base32
ffa82227 278 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
d13586bf
279 (build-system gnu-build-system)
280 (native-inputs
392f3266 281 `(("pkg-config" ,pkg-config)))
d13586bf
282 (inputs
283 `(("pcre" ,pcre)
284 ("xz" ,xz)
285 ("zlib" ,zlib)))
422a6cd4 286 (home-page "https://geoff.greer.fm/ag/")
d13586bf
287 (synopsis "Fast code searching tool")
288 (description
6acff0f9
TGR
289 "The Silver Searcher (@command{ag}) is a tool for quickly searching large
290numbers of files. It's intended primarily for source code repositories, and
291respects files like @file{.gitignore} and @file{.hgignore}. It's also an order
292of magnitude faster than its inspiration, @command{ack}, and less specialised
293tools such as @command{grep}.")
d13586bf 294 (license license:asl2.0)))
76e14638 295
a4e6356e
RW
296(define-public trio
297 (package
298 (name "trio")
299 (version "1.16")
300 (source (origin
301 (method url-fetch)
302 (uri (string-append "mirror://sourceforge/ctrio/trio/trio-"
303 version ".tar.gz"))
304 (sha256
305 (base32
306 "02pwd5m5vq7hbrffgm2na1dfc249z50yyr5jv73vdw15bd7ygl44"))))
307 (build-system gnu-build-system)
308 (home-page "http://daniel.haxx.se/projects/trio/")
309 (synopsis "Portable and extendable printf and string functions")
310 (description
311 "Trio is a set of @code{printf} and string functions designed be used by
312applications with a focus on portability or with the need for additional
313features that are not supported by the standard @code{stdio} implementation.")
314 ;; This license is very similar to the ISC license, but the wording is
315 ;; slightly different.
316 (license (license:non-copyleft
317 "http://sourceforge.net/p/ctrio/git/ci/master/tree/README"))))
318
76e14638
RW
319(define-public withershins
320 (package
321 (name "withershins")
322 (version "0.1")
323 (source (origin
324 (method url-fetch)
325 (uri (string-append
326 "https://github.com/cameronwhite/withershins/archive/v"
327 version ".tar.gz"))
328 (file-name (string-append name "-" version ".tar.gz"))
329 (sha256
330 (base32
331 "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh"))))
332 (build-system cmake-build-system)
333 (arguments
334 `(#:out-of-source? #f
76e14638
RW
335 #:phases
336 (modify-phases %standard-phases
337 (add-after
338 'unpack 'find-libiberty
339 (lambda _
25734108 340 (let ((libiberty (assoc-ref %build-inputs "libiberty")))
76e14638 341 (substitute* "cmake/FindIberty.cmake"
25734108
RW
342 (("/usr/include") (string-append libiberty "/include"))
343 (("libiberty.a iberty")
344 (string-append "NAMES libiberty.a iberty\nPATHS \""
345 libiberty "/lib" "\"")))
76e14638
RW
346 #t)))
347 (replace
348 'install
349 (lambda* (#:key outputs #:allow-other-keys)
f3860753
TGR
350 (let* ((out (assoc-ref outputs "out"))
351 (include (string-append out "/include"))
352 (lib (string-append out "/lib")))
353 (mkdir-p include)
354 (install-file "src/withershins.hpp" include)
355 (mkdir-p lib)
356 (install-file "src/libwithershins.a" lib))
76e14638
RW
357 #t)))))
358 (home-page "https://github.com/cameronwhite/withershins")
359 (inputs
25734108 360 `(("libiberty" ,libiberty)
76e14638
RW
361 ("binutils" ,binutils) ;for libbfd
362 ("zlib" ,zlib)))
363 (synopsis "C++11 library for generating stack traces")
364 (description
365 "Withershins is a simple cross-platform C++11 library for generating
366stack traces.")
367 ;; Sources are released under Expat license, but since BFD is licensed
368 ;; under the GPLv3+ the combined work is GPLv3+ as well.
369 (license license:gpl3+)))
0084aaf3
LC
370
371(define-public lcov
372 (package
373 (name "lcov")
8fadbc4b 374 (version "1.14")
0084aaf3
LC
375 (source (origin
376 (method url-fetch)
de67e922
LF
377 (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis"
378 "/LCOV-" version "/lcov-" version ".tar.gz"))
0084aaf3
LC
379 (sha256
380 (base32
8fadbc4b 381 "06h7ixyznf6vz1qvksjgy5f3q2nw9akf6zx59npf0h3l32cmd68l"))))
0084aaf3
LC
382 (build-system gnu-build-system)
383 (arguments
b15af0ce
TGR
384 '(#:make-flags
385 (let ((out (assoc-ref %outputs "out")))
386 (list (string-append "PREFIX=" out)))
387 #:phases
388 (modify-phases %standard-phases
389 (delete 'configure)) ; no configure script
390 #:tests? #f)) ; no 'check' target
0084aaf3
LC
391 (inputs `(("perl" ,perl)))
392 (home-page "http://ltp.sourceforge.net/coverage/lcov.php")
393 (synopsis "Code coverage tool that enhances GNU gcov")
394 (description
395 "LCOV is an extension of @command{gcov}, a tool part of the
396GNU@tie{}Binutils, which provides information about what parts of a program
397are actually executed (i.e., \"covered\") while running a particular test
398case. The extension consists of a set of Perl scripts which build on the
399textual @command{gcov} output to implement the following enhanced
400functionality such as HTML output.")
401 (license license:gpl2+)))
4b3070f7
FT
402
403(define-public rtags
404 (package
405 (name "rtags")
af147cdd 406 (version "2.18")
457fc22d
FT
407 (source
408 (origin
84ae0e29
TGR
409 (method git-fetch)
410 (uri (git-reference
411 (url "https://github.com/Andersbakken/rtags.git")
412 (commit (string-append "v" version))))
413 (file-name (git-file-name name version))
457fc22d
FT
414 (patches (search-patches "rtags-separate-rct.patch"))
415 (modules '((guix build utils)))
416 (snippet
417 ;; Part of spliting rct with rtags.
418 ;; Substitute #include "rct/header.h" with #include <rct/header.h>.
419 '(with-directory-excursion "src"
420 (delete-file-recursively "rct") ;remove bundled copy
421 (let ((files (find-files "." ".*\\.cpp|.*\\.h")))
422 (substitute* files
423 (("#include ?\"rct/(.*.h)\"" all header)
6cbee49d
MW
424 (string-append "#include <rct/" header ">")))
425 #t)))
457fc22d
FT
426 (sha256
427 (base32
84ae0e29 428 "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0"))))
4b3070f7
FT
429 (build-system cmake-build-system)
430 (arguments
3def739d
TGR
431 '(#:build-type "RelWithDebInfo"
432 #:configure-flags
457fc22d 433 '("-DRTAGS_NO_ELISP_FILES=1"
457fc22d
FT
434 "-DCMAKE_CXX_FLAGS=-std=c++11"
435 "-DBUILD_TESTING=FALSE")
4b3070f7 436 #:tests? #f))
457fc22d
FT
437 (native-inputs
438 `(("pkg-config" ,pkg-config)))
4b3070f7 439 (inputs
457fc22d
FT
440 `(("bash-completion" ,bash-completion)
441 ("clang" ,clang)
4b3070f7 442 ("llvm" ,llvm)
457fc22d
FT
443 ("lua" ,lua)
444 ("rct" ,rct)
445 ("selene" ,selene)))
84ae0e29 446 (home-page "https://github.com/Andersbakken/rtags")
4b3070f7
FT
447 (synopsis "Indexer for the C language family with Emacs integration")
448 (description
449 "RTags is a client/server application that indexes C/C++ code and keeps a
450persistent file-based database of references, declarations, definitions,
451symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you
452to find symbols by name (including nested class and namespace scope). Most
453importantly we give you proper follow-symbol and find-references support.")
454 (license license:gpl3+)))
dc993847
OP
455
456(define-public colormake
457 (package
458 (name "colormake")
459 (version "0.9.20140503")
460 (source
461 (origin
462 (method url-fetch)
463 (uri (string-append "https://github.com/pagekite/Colormake/archive/"
464 version ".tar.gz"))
465 (file-name (string-append name "-" version ".tar.gz"))
466 (sha256
467 (base32
468 "08ldss9zd8ls6bjahvxhffpsjcysifr720yf3jz9db2mlklzmyd3"))))
469 (build-system trivial-build-system)
470 (native-inputs
471 `(("bash" ,bash)
472 ("gzip" ,gzip)
473 ("perl" ,perl)
474 ("tar" ,tar)))
475 (arguments
476 `(#:modules ((guix build utils))
477 #:builder
478 (begin
479 (use-modules (guix build utils))
480 ;; bootstrap
481 (setenv "PATH" (string-append
482 (assoc-ref %build-inputs "tar") "/bin" ":"
483 (assoc-ref %build-inputs "gzip") "/bin"))
484 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
485 (chdir (string-append (string-capitalize ,name) "-" ,version))
486 (patch-shebang "colormake.pl"
487 (list (string-append (assoc-ref %build-inputs "perl")
488 "/bin")))
489 (let* ((out (assoc-ref %outputs "out"))
490 (bin (string-append out "/bin"))
491 (doc (string-append out "/share/doc"))
492 (install-files (lambda (files directory)
493 (for-each (lambda (file)
494 (install-file file directory))
495 files))))
496 (substitute* "colormake"
497 (("colormake\\.pl") (string-append bin "/colormake.pl"))
498 (("/bin/bash")
499 (string-append (assoc-ref %build-inputs "bash") "/bin/sh")))
500 (install-file "colormake.1" (string-append doc "/man/man1"))
501 (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc)
502 (install-files '("colormake" "colormake-short" "clmake"
503 "clmake-short" "colormake.pl")
e3cfef22
MW
504 bin)
505 #t))))
dc993847
OP
506 (home-page "http://bre.klaki.net/programs/colormake/")
507 (synopsis "Wrapper around @command{make} to produce colored output")
508 (description "This package provides a wrapper around @command{make} to
509produce colored output.")
510 (license license:gpl2+)))
906dcb20
CB
511
512(define-public makefile2graph
513 (package
514 (name "makefile2graph")
515 (version "1.5.0")
516 (source (origin
517 (method url-fetch)
518 (uri (string-append "https://github.com/lindenb/" name
519 "/archive/v" version ".tar.gz"))
520 (sha256
521 (base32
522 "0h1vchkpmm9h6s87p5nf0ksjxcmsxpx8k62a508w428n570wcr4l"))
523 (file-name (string-append name "-" version ".tar.gz"))))
524 (build-system gnu-build-system)
525 (arguments
526 '(#:test-target "test"
527 #:make-flags (list "CC=gcc" (string-append "prefix=" %output))
528 #:phases
529 (modify-phases %standard-phases
530 (delete 'configure))))
531 (native-inputs
532 `(("graphviz" ,graphviz)))
533 (home-page "https://github.com/lindenb/makefile2graph")
534 (synopsis "Creates a graph of dependencies from GNU Make")
535 (description
536 "@code{make2graph} creates a graph of dependencies from GNU Make. The
537output is a graphviz-dot file, a Gexf-XML file or a list of the deepest
538independent targets.")
539 (license license:expat)))
9c4dcfaf
PN
540
541(define-public uncrustify
542 (package
543 (name "uncrustify")
ae5de93a 544 (version "0.69.0")
9c4dcfaf 545 (source (origin
b5944fcb
PN
546 (method git-fetch)
547 (uri (git-reference
548 (url "https://github.com/uncrustify/uncrustify/")
549 (commit (string-append name "-" version))))
550 (file-name (git-file-name name version))
9c4dcfaf
PN
551 (sha256
552 (base32
ae5de93a 553 "0sqrg13kp8fwymq40976bq380bzw40g4ss7ihlbq45d0f90ifa1k"))))
9c4dcfaf
PN
554 (build-system cmake-build-system)
555 (native-inputs
34843fe9
PN
556 `(("unzip" ,unzip)
557 ("python" ,python-wrapper)))
9c4dcfaf
PN
558 (arguments
559 `(#:phases
560 (modify-phases %standard-phases
561 (add-after 'unpack 'unpack-etc
562 (lambda* (#:key inputs outputs #:allow-other-keys)
563 ;; Configuration samples are not installed by default.
564 (let* ((output (assoc-ref outputs "out"))
565 (etcdir (string-append output "/etc")))
566 (for-each (lambda (l)
567 (install-file l etcdir))
568 (find-files "etc" "\\.cfg$")))
569 #t)))))
570 (home-page "http://uncrustify.sourceforge.net/")
571 (synopsis "Code formatter for C and other related languages")
572 (description
573 "Beautify source code in many languages of the C family (C, C++, C#,
574Objective@tie{}C, D, Java, Pawn, and Vala). Features:
575@itemize
576@item Indent and align code.
577@item Reformat comments (a little bit).
578@item Fix inter-character spacing.
579@item Add or remove parens / braces.
580@item Supports embedded SQL @code{EXEC SQL} stuff.
581@item Highly configurable - More than 600 configurable options.
582@end itemize\n")
583 (license license:gpl2+)))
c1e5109b
LC
584
585(define-public astyle
586 (package
587 (name "astyle")
4bfd8579 588 (version "3.1")
c1e5109b
LC
589 (source
590 (origin
591 (method url-fetch)
592 (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
593 version "/astyle_" version "_linux.tar.gz"))
594 (sha256
595 (base32
4bfd8579 596 "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b"))))
c1e5109b
LC
597 (build-system gnu-build-system)
598 (arguments
599 `(#:tests? #f ;no tests
600 #:make-flags (list (string-append "prefix=" %output)
601 "INSTALL=install"
602 "all")
603 #:phases
604 (modify-phases %standard-phases
605 (replace 'configure
606 (lambda _ (chdir "build/gcc") #t))
607 (add-after 'install 'install-libs
608 (lambda* (#:key outputs #:allow-other-keys)
609 ;; Libraries are not installed by default
610 (let* ((output (assoc-ref outputs "out"))
611 (libdir (string-append output "/lib")))
612 (begin
613 (mkdir-p libdir)
614 (for-each (lambda (l)
615 (copy-file
616 l (string-append libdir "/" (basename l))))
617 (find-files "bin" "lib*"))))
618 #t)))))
619 (home-page "http://astyle.sourceforge.net/")
620 (synopsis "Source code indenter, formatter, and beautifier")
621 (description
622 "Artistic Style is a source code indenter, formatter, and beautifier for
623the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
624 (license license:lgpl3+)))
e470abf8
LC
625
626(define-public indent
627 (package
628 (name "indent")
629 (version "2.2.10")
630 (source (origin
631 (method url-fetch)
632 (uri (string-append "mirror://gnu/indent/indent-" version
633 ".tar.gz"))
634 (sha256 (base32
635 "0f9655vqdvfwbxvs1gpa7py8k1z71aqh8hp73f65vazwbfz436wa"))))
636 (build-system gnu-build-system)
637 (arguments
9d10a634
MW
638 `(#:phases
639 (modify-phases %standard-phases
640 (add-after 'unpack 'fix-docdir
641 (lambda _
642 ;; Although indent uses a modern autoconf in which docdir
643 ;; defaults to PREFIX/share/doc, the doc/Makefile.am
644 ;; overrides this to be in PREFIX/doc. Fix this.
645 (substitute* "doc/Makefile.in"
646 (("^docdir = .*$") "docdir = @docdir@\n"))
647 #t)))))
e470abf8
LC
648 (synopsis "Code reformatter")
649 (description
650 "Indent is a program that makes source code easier to read by
651reformatting it in a consistent style. It can change the style to one of
652several different styles such as GNU, BSD or K&R. It has some flexibility to
653deal with incomplete or malformed syntax. GNU indent offers several
654extensions over the standard utility.")
655 (license license:gpl3+)
656 (home-page "https://www.gnu.org/software/indent/")))
ad8a4d6d 657
afdd1555
LC
658(define-public indent-2.2.12
659 (package
660 (inherit indent)
661 (version "2.2.12")
662 (source (origin
663 (method url-fetch)
664 (uri (string-append "mirror://gnu/indent/indent-" version
665 ".tar.gz"))
666 (sha256
667 (base32
668 "12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7"))))
669 (native-inputs `(("texinfo" ,texinfo)))))
670
ad8a4d6d
FT
671(define-public amalgamate
672 (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208")
673 (revision "0")
674 (version (git-version "1.1.1" revision commit)))
675 (package
676 (name "amalgamate")
677 (version version)
678 (home-page "https://github.com/edlund/amalgamate")
679 (source
680 (origin
681 (method git-fetch)
682 (uri (git-reference
683 (url home-page)
684 (commit commit)))
685 (sha256
686 (base32
687 "0cllaraw8mxs8q2nr28nhgzkb417gj2wcklqg59w84f4lc78k3yb"))
688 (file-name (git-file-name name version))
689 (modules '((guix build utils)))
690 (snippet
691 '(substitute* "test.sh"
692 (("test_command \"cc -Wall -Wextra -o source.out source.c\"" all)
693 "test_command \"gcc -Wall -Wextra -o source.out source.c\"")))))
694 (build-system gnu-build-system)
695 (inputs
696 `(("python" ,python-wrapper)))
697 (arguments
698 `(#:phases
699 (modify-phases %standard-phases
700 (delete 'configure)
701 (delete 'build)
702 (replace 'install
703 (lambda* (#:key outputs #:allow-other-keys)
704 (let* ((out (assoc-ref outputs "out"))
705 (bin (string-append out "/bin")))
706 (install-file "amalgamate.py" bin))))
707 (replace 'check
708 (lambda _
709 (invoke "./test.sh"))))))
710 (synopsis "Tool for amalgamating C source and header files")
711 ;; The package is indeed a script file, and the term "amalgamate.py" is
712 ;; used by upstream.
713 (description "amalgamate.py aims to make it easy to use SQLite-style C
714source and header amalgamation in projects.")
715 (license license:bsd-3))))