gnu: sbcl-cl-webkit: Update repo owner to jmercouris.
[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>
cbf5eb84 5;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
b15af0ce 6;;; Copyright © 2017, 2018 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)
e1ac691d 45 #:use-module (gnu packages databases)
99e64a6e 46 #:use-module (gnu packages emacs)
76e14638 47 #:use-module (gnu packages gcc)
906dcb20 48 #:use-module (gnu packages graphviz)
d13586bf 49 #:use-module (gnu packages pcre)
99e64a6e 50 #:use-module (gnu packages perl)
ad8a4d6d
FT
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages python)
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")
cb307c08 63 (version "1.5")
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
cb307c08 70 "0yq33k5ap1zpnja64n89iai4zh018ffr72wki5a6mzczd880mr3g"))))
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")
0de57b44 116 (version "6.6.2")
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
0de57b44 123 "0zvi5vxwiq0dy8mq2cgs64m8harxs0fvkmsnvi0ayb0w608lgij3"))))
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
189 "/share/doc")))))
f8503e2b 190 (replace 'check
23153c90
LC
191 (lambda _
192 (setenv "HOME" (getcwd))
193 (setenv "PATH"
194 (string-append (getcwd) ":"
195 (getenv "PATH")))
196 (zero? (system* "make" "test")))))
197
198 #:make-flags (list (string-append "PREFIX="
199 (assoc-ref %outputs "out")))))
200 (inputs `(("perl" ,perl)))
201 (home-page "http://www.dwheeler.com/sloccount/")
202 (synopsis "Count physical source lines of code (SLOC)")
203 (description
204 "SLOCCount is a set of the programs for counting source lines of
205code (SLOC) in large software systems. It can automatically identify and
206measure a wide range of programming languages. It automatically estimates the
207effort, time, and money it would take to develop the software, using the
208COCOMO model or user-provided parameters.")
d13586bf
209 (license license:gpl2+)))
210
f7fc9667
AW
211(define-public cloc
212 (package
213 (name "cloc")
295fc415 214 (version "1.80")
f7fc9667
AW
215 (source
216 (origin
217 (method url-fetch)
218 (uri (string-append
295fc415 219 "https://github.com/AlDanial/cloc/releases/download/v" version
f7fc9667
AW
220 "/cloc-" version ".tar.gz"))
221 (sha256
222 (base32
295fc415 223 "0rqxnaskg5b736asyzfda1113zvpkajyqjf49vl9wgzf1r9m6bq8"))))
f7fc9667
AW
224 (build-system gnu-build-system)
225 (inputs
226 `(("coreutils" ,coreutils)
227 ("perl" ,perl)
228 ("perl-algorithm-diff" ,perl-algorithm-diff)
95943ed7
TGR
229 ("perl-digest-md5" ,perl-digest-md5)
230 ("perl-parallel-forkmanager" ,perl-parallel-forkmanager)
231 ("perl-regexp-common" ,perl-regexp-common)))
f7fc9667
AW
232 (arguments
233 `(#:phases (modify-phases %standard-phases
295fc415
TGR
234 (delete 'configure) ; nothing to configure
235 (delete 'build) ; nothing to build
f7fc9667
AW
236 (replace 'install
237 (lambda* (#:key inputs outputs #:allow-other-keys)
238 (let* ((out (assoc-ref outputs "out")))
53244d1f
TGR
239 (invoke "make" "-C" "Unix"
240 (string-append "prefix=" out)
241 (string-append "INSTALL="
242 (assoc-ref inputs "coreutils")
243 "/bin/install")
244 "install")
245 #t)))
f7fc9667
AW
246 (add-after 'install 'wrap-program
247 (lambda* (#:key inputs outputs #:allow-other-keys)
248 (let ((out (assoc-ref outputs "out")))
249 (wrap-program (string-append out "/bin/cloc")
250 `("PERL5LIB" ":" =
251 ,(string-split (getenv "PERL5LIB") #\:)))
252 #t))))
253 #:out-of-source? #t
254 ;; Tests require some other packages.
255 #:tests? #f))
256 (home-page "https://github.com/AlDanial/cloc")
257 (synopsis "Count source lines of code (SLOC) and other source code metrics")
258 (description "cloc counts blank lines, comment lines, and physical lines
259of source code in many programming languages. Given two versions of a code
260base, cloc can compute differences in blank, comment, and source lines.
261
262cloc contains code from David Wheeler's SLOCCount. Compared to SLOCCount,
e0f49664 263cloc can handle a greater variety of programming languages.")
f7fc9667
AW
264 (license license:gpl2+)))
265
d13586bf
266(define-public the-silver-searcher
267 (package
268 (name "the-silver-searcher")
ffa82227 269 (version "2.2.0")
d13586bf
270 (source (origin
271 (method url-fetch)
272 (uri (string-append
422a6cd4 273 "https://geoff.greer.fm/ag/releases/the_silver_searcher-"
d13586bf
274 version ".tar.gz"))
275 (sha256
276 (base32
ffa82227 277 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
d13586bf
278 (build-system gnu-build-system)
279 (native-inputs
392f3266 280 `(("pkg-config" ,pkg-config)))
d13586bf
281 (inputs
282 `(("pcre" ,pcre)
283 ("xz" ,xz)
284 ("zlib" ,zlib)))
422a6cd4 285 (home-page "https://geoff.greer.fm/ag/")
d13586bf
286 (synopsis "Fast code searching tool")
287 (description
6acff0f9
TGR
288 "The Silver Searcher (@command{ag}) is a tool for quickly searching large
289numbers of files. It's intended primarily for source code repositories, and
290respects files like @file{.gitignore} and @file{.hgignore}. It's also an order
291of magnitude faster than its inspiration, @command{ack}, and less specialised
292tools such as @command{grep}.")
d13586bf 293 (license license:asl2.0)))
76e14638 294
a4e6356e
RW
295(define-public trio
296 (package
297 (name "trio")
298 (version "1.16")
299 (source (origin
300 (method url-fetch)
301 (uri (string-append "mirror://sourceforge/ctrio/trio/trio-"
302 version ".tar.gz"))
303 (sha256
304 (base32
305 "02pwd5m5vq7hbrffgm2na1dfc249z50yyr5jv73vdw15bd7ygl44"))))
306 (build-system gnu-build-system)
307 (home-page "http://daniel.haxx.se/projects/trio/")
308 (synopsis "Portable and extendable printf and string functions")
309 (description
310 "Trio is a set of @code{printf} and string functions designed be used by
311applications with a focus on portability or with the need for additional
312features that are not supported by the standard @code{stdio} implementation.")
313 ;; This license is very similar to the ISC license, but the wording is
314 ;; slightly different.
315 (license (license:non-copyleft
316 "http://sourceforge.net/p/ctrio/git/ci/master/tree/README"))))
317
76e14638
RW
318(define-public withershins
319 (package
320 (name "withershins")
321 (version "0.1")
322 (source (origin
323 (method url-fetch)
324 (uri (string-append
325 "https://github.com/cameronwhite/withershins/archive/v"
326 version ".tar.gz"))
327 (file-name (string-append name "-" version ".tar.gz"))
328 (sha256
329 (base32
330 "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh"))))
331 (build-system cmake-build-system)
332 (arguments
333 `(#:out-of-source? #f
76e14638
RW
334 #:phases
335 (modify-phases %standard-phases
336 (add-after
337 'unpack 'find-libiberty
338 (lambda _
25734108 339 (let ((libiberty (assoc-ref %build-inputs "libiberty")))
76e14638 340 (substitute* "cmake/FindIberty.cmake"
25734108
RW
341 (("/usr/include") (string-append libiberty "/include"))
342 (("libiberty.a iberty")
343 (string-append "NAMES libiberty.a iberty\nPATHS \""
344 libiberty "/lib" "\"")))
76e14638
RW
345 #t)))
346 (replace
347 'install
348 (lambda* (#:key outputs #:allow-other-keys)
f3860753
TGR
349 (let* ((out (assoc-ref outputs "out"))
350 (include (string-append out "/include"))
351 (lib (string-append out "/lib")))
352 (mkdir-p include)
353 (install-file "src/withershins.hpp" include)
354 (mkdir-p lib)
355 (install-file "src/libwithershins.a" lib))
76e14638
RW
356 #t)))))
357 (home-page "https://github.com/cameronwhite/withershins")
358 (inputs
25734108 359 `(("libiberty" ,libiberty)
76e14638
RW
360 ("binutils" ,binutils) ;for libbfd
361 ("zlib" ,zlib)))
362 (synopsis "C++11 library for generating stack traces")
363 (description
364 "Withershins is a simple cross-platform C++11 library for generating
365stack traces.")
366 ;; Sources are released under Expat license, but since BFD is licensed
367 ;; under the GPLv3+ the combined work is GPLv3+ as well.
368 (license license:gpl3+)))
0084aaf3
LC
369
370(define-public lcov
371 (package
372 (name "lcov")
b15af0ce 373 (version "1.13")
0084aaf3
LC
374 (source (origin
375 (method url-fetch)
de67e922
LF
376 (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis"
377 "/LCOV-" version "/lcov-" version ".tar.gz"))
0084aaf3
LC
378 (sha256
379 (base32
b15af0ce 380 "08wabnb0gcjqk0qc65a6cgbbmz6b8lvam3p7byh0dk42hj3jr5s4"))))
0084aaf3
LC
381 (build-system gnu-build-system)
382 (arguments
b15af0ce
TGR
383 '(#:make-flags
384 (let ((out (assoc-ref %outputs "out")))
385 (list (string-append "PREFIX=" out)))
386 #:phases
387 (modify-phases %standard-phases
388 (delete 'configure)) ; no configure script
389 #:tests? #f)) ; no 'check' target
0084aaf3
LC
390 (inputs `(("perl" ,perl)))
391 (home-page "http://ltp.sourceforge.net/coverage/lcov.php")
392 (synopsis "Code coverage tool that enhances GNU gcov")
393 (description
394 "LCOV is an extension of @command{gcov}, a tool part of the
395GNU@tie{}Binutils, which provides information about what parts of a program
396are actually executed (i.e., \"covered\") while running a particular test
397case. The extension consists of a set of Perl scripts which build on the
398textual @command{gcov} output to implement the following enhanced
399functionality such as HTML output.")
400 (license license:gpl2+)))
4b3070f7
FT
401
402(define-public rtags
403 (package
404 (name "rtags")
af147cdd 405 (version "2.18")
457fc22d
FT
406 (source
407 (origin
84ae0e29
TGR
408 (method git-fetch)
409 (uri (git-reference
410 (url "https://github.com/Andersbakken/rtags.git")
411 (commit (string-append "v" version))))
412 (file-name (git-file-name name version))
457fc22d
FT
413 (patches (search-patches "rtags-separate-rct.patch"))
414 (modules '((guix build utils)))
415 (snippet
416 ;; Part of spliting rct with rtags.
417 ;; Substitute #include "rct/header.h" with #include <rct/header.h>.
418 '(with-directory-excursion "src"
419 (delete-file-recursively "rct") ;remove bundled copy
420 (let ((files (find-files "." ".*\\.cpp|.*\\.h")))
421 (substitute* files
422 (("#include ?\"rct/(.*.h)\"" all header)
6cbee49d
MW
423 (string-append "#include <rct/" header ">")))
424 #t)))
457fc22d
FT
425 (sha256
426 (base32
84ae0e29 427 "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0"))))
4b3070f7
FT
428 (build-system cmake-build-system)
429 (arguments
3def739d
TGR
430 '(#:build-type "RelWithDebInfo"
431 #:configure-flags
457fc22d 432 '("-DRTAGS_NO_ELISP_FILES=1"
457fc22d
FT
433 "-DCMAKE_CXX_FLAGS=-std=c++11"
434 "-DBUILD_TESTING=FALSE")
4b3070f7 435 #:tests? #f))
457fc22d
FT
436 (native-inputs
437 `(("pkg-config" ,pkg-config)))
4b3070f7 438 (inputs
457fc22d
FT
439 `(("bash-completion" ,bash-completion)
440 ("clang" ,clang)
4b3070f7 441 ("llvm" ,llvm)
457fc22d
FT
442 ("lua" ,lua)
443 ("rct" ,rct)
444 ("selene" ,selene)))
84ae0e29 445 (home-page "https://github.com/Andersbakken/rtags")
4b3070f7
FT
446 (synopsis "Indexer for the C language family with Emacs integration")
447 (description
448 "RTags is a client/server application that indexes C/C++ code and keeps a
449persistent file-based database of references, declarations, definitions,
450symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you
451to find symbols by name (including nested class and namespace scope). Most
452importantly we give you proper follow-symbol and find-references support.")
453 (license license:gpl3+)))
dc993847
OP
454
455(define-public colormake
456 (package
457 (name "colormake")
458 (version "0.9.20140503")
459 (source
460 (origin
461 (method url-fetch)
462 (uri (string-append "https://github.com/pagekite/Colormake/archive/"
463 version ".tar.gz"))
464 (file-name (string-append name "-" version ".tar.gz"))
465 (sha256
466 (base32
467 "08ldss9zd8ls6bjahvxhffpsjcysifr720yf3jz9db2mlklzmyd3"))))
468 (build-system trivial-build-system)
469 (native-inputs
470 `(("bash" ,bash)
471 ("gzip" ,gzip)
472 ("perl" ,perl)
473 ("tar" ,tar)))
474 (arguments
475 `(#:modules ((guix build utils))
476 #:builder
477 (begin
478 (use-modules (guix build utils))
479 ;; bootstrap
480 (setenv "PATH" (string-append
481 (assoc-ref %build-inputs "tar") "/bin" ":"
482 (assoc-ref %build-inputs "gzip") "/bin"))
483 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
484 (chdir (string-append (string-capitalize ,name) "-" ,version))
485 (patch-shebang "colormake.pl"
486 (list (string-append (assoc-ref %build-inputs "perl")
487 "/bin")))
488 (let* ((out (assoc-ref %outputs "out"))
489 (bin (string-append out "/bin"))
490 (doc (string-append out "/share/doc"))
491 (install-files (lambda (files directory)
492 (for-each (lambda (file)
493 (install-file file directory))
494 files))))
495 (substitute* "colormake"
496 (("colormake\\.pl") (string-append bin "/colormake.pl"))
497 (("/bin/bash")
498 (string-append (assoc-ref %build-inputs "bash") "/bin/sh")))
499 (install-file "colormake.1" (string-append doc "/man/man1"))
500 (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc)
501 (install-files '("colormake" "colormake-short" "clmake"
502 "clmake-short" "colormake.pl")
e3cfef22
MW
503 bin)
504 #t))))
dc993847
OP
505 (home-page "http://bre.klaki.net/programs/colormake/")
506 (synopsis "Wrapper around @command{make} to produce colored output")
507 (description "This package provides a wrapper around @command{make} to
508produce colored output.")
509 (license license:gpl2+)))
906dcb20
CB
510
511(define-public makefile2graph
512 (package
513 (name "makefile2graph")
514 (version "1.5.0")
515 (source (origin
516 (method url-fetch)
517 (uri (string-append "https://github.com/lindenb/" name
518 "/archive/v" version ".tar.gz"))
519 (sha256
520 (base32
521 "0h1vchkpmm9h6s87p5nf0ksjxcmsxpx8k62a508w428n570wcr4l"))
522 (file-name (string-append name "-" version ".tar.gz"))))
523 (build-system gnu-build-system)
524 (arguments
525 '(#:test-target "test"
526 #:make-flags (list "CC=gcc" (string-append "prefix=" %output))
527 #:phases
528 (modify-phases %standard-phases
529 (delete 'configure))))
530 (native-inputs
531 `(("graphviz" ,graphviz)))
532 (home-page "https://github.com/lindenb/makefile2graph")
533 (synopsis "Creates a graph of dependencies from GNU Make")
534 (description
535 "@code{make2graph} creates a graph of dependencies from GNU Make. The
536output is a graphviz-dot file, a Gexf-XML file or a list of the deepest
537independent targets.")
538 (license license:expat)))
9c4dcfaf
PN
539
540(define-public uncrustify
541 (package
542 (name "uncrustify")
34843fe9 543 (version "0.68.1")
9c4dcfaf
PN
544 (source (origin
545 (method url-fetch)
546 (uri (string-append
547 "https://github.com/uncrustify/uncrustify/archive/"
548 "uncrustify-" version ".zip"))
549 (sha256
550 (base32
34843fe9 551 "1jb3hmm11m2mgnypapak2lgyyvspnmx9bxd9dxis5swaja2ddxlg"))))
9c4dcfaf
PN
552 (build-system cmake-build-system)
553 (native-inputs
34843fe9
PN
554 `(("unzip" ,unzip)
555 ("python" ,python-wrapper)))
9c4dcfaf
PN
556 (arguments
557 `(#:phases
558 (modify-phases %standard-phases
559 (add-after 'unpack 'unpack-etc
560 (lambda* (#:key inputs outputs #:allow-other-keys)
561 ;; Configuration samples are not installed by default.
562 (let* ((output (assoc-ref outputs "out"))
563 (etcdir (string-append output "/etc")))
564 (for-each (lambda (l)
565 (install-file l etcdir))
566 (find-files "etc" "\\.cfg$")))
567 #t)))))
568 (home-page "http://uncrustify.sourceforge.net/")
569 (synopsis "Code formatter for C and other related languages")
570 (description
571 "Beautify source code in many languages of the C family (C, C++, C#,
572Objective@tie{}C, D, Java, Pawn, and Vala). Features:
573@itemize
574@item Indent and align code.
575@item Reformat comments (a little bit).
576@item Fix inter-character spacing.
577@item Add or remove parens / braces.
578@item Supports embedded SQL @code{EXEC SQL} stuff.
579@item Highly configurable - More than 600 configurable options.
580@end itemize\n")
581 (license license:gpl2+)))
c1e5109b
LC
582
583(define-public astyle
584 (package
585 (name "astyle")
4bfd8579 586 (version "3.1")
c1e5109b
LC
587 (source
588 (origin
589 (method url-fetch)
590 (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
591 version "/astyle_" version "_linux.tar.gz"))
592 (sha256
593 (base32
4bfd8579 594 "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b"))))
c1e5109b
LC
595 (build-system gnu-build-system)
596 (arguments
597 `(#:tests? #f ;no tests
598 #:make-flags (list (string-append "prefix=" %output)
599 "INSTALL=install"
600 "all")
601 #:phases
602 (modify-phases %standard-phases
603 (replace 'configure
604 (lambda _ (chdir "build/gcc") #t))
605 (add-after 'install 'install-libs
606 (lambda* (#:key outputs #:allow-other-keys)
607 ;; Libraries are not installed by default
608 (let* ((output (assoc-ref outputs "out"))
609 (libdir (string-append output "/lib")))
610 (begin
611 (mkdir-p libdir)
612 (for-each (lambda (l)
613 (copy-file
614 l (string-append libdir "/" (basename l))))
615 (find-files "bin" "lib*"))))
616 #t)))))
617 (home-page "http://astyle.sourceforge.net/")
618 (synopsis "Source code indenter, formatter, and beautifier")
619 (description
620 "Artistic Style is a source code indenter, formatter, and beautifier for
621the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
622 (license license:lgpl3+)))
e470abf8
LC
623
624(define-public indent
625 (package
626 (name "indent")
627 (version "2.2.10")
628 (source (origin
629 (method url-fetch)
630 (uri (string-append "mirror://gnu/indent/indent-" version
631 ".tar.gz"))
632 (sha256 (base32
633 "0f9655vqdvfwbxvs1gpa7py8k1z71aqh8hp73f65vazwbfz436wa"))))
634 (build-system gnu-build-system)
635 (arguments
9d10a634
MW
636 `(#:phases
637 (modify-phases %standard-phases
638 (add-after 'unpack 'fix-docdir
639 (lambda _
640 ;; Although indent uses a modern autoconf in which docdir
641 ;; defaults to PREFIX/share/doc, the doc/Makefile.am
642 ;; overrides this to be in PREFIX/doc. Fix this.
643 (substitute* "doc/Makefile.in"
644 (("^docdir = .*$") "docdir = @docdir@\n"))
645 #t)))))
e470abf8
LC
646 (synopsis "Code reformatter")
647 (description
648 "Indent is a program that makes source code easier to read by
649reformatting it in a consistent style. It can change the style to one of
650several different styles such as GNU, BSD or K&R. It has some flexibility to
651deal with incomplete or malformed syntax. GNU indent offers several
652extensions over the standard utility.")
653 (license license:gpl3+)
654 (home-page "https://www.gnu.org/software/indent/")))
ad8a4d6d 655
afdd1555
LC
656(define-public indent-2.2.12
657 (package
658 (inherit indent)
659 (version "2.2.12")
660 (source (origin
661 (method url-fetch)
662 (uri (string-append "mirror://gnu/indent/indent-" version
663 ".tar.gz"))
664 (sha256
665 (base32
666 "12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7"))))
667 (native-inputs `(("texinfo" ,texinfo)))))
668
ad8a4d6d
FT
669(define-public amalgamate
670 (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208")
671 (revision "0")
672 (version (git-version "1.1.1" revision commit)))
673 (package
674 (name "amalgamate")
675 (version version)
676 (home-page "https://github.com/edlund/amalgamate")
677 (source
678 (origin
679 (method git-fetch)
680 (uri (git-reference
681 (url home-page)
682 (commit commit)))
683 (sha256
684 (base32
685 "0cllaraw8mxs8q2nr28nhgzkb417gj2wcklqg59w84f4lc78k3yb"))
686 (file-name (git-file-name name version))
687 (modules '((guix build utils)))
688 (snippet
689 '(substitute* "test.sh"
690 (("test_command \"cc -Wall -Wextra -o source.out source.c\"" all)
691 "test_command \"gcc -Wall -Wextra -o source.out source.c\"")))))
692 (build-system gnu-build-system)
693 (inputs
694 `(("python" ,python-wrapper)))
695 (arguments
696 `(#:phases
697 (modify-phases %standard-phases
698 (delete 'configure)
699 (delete 'build)
700 (replace 'install
701 (lambda* (#:key outputs #:allow-other-keys)
702 (let* ((out (assoc-ref outputs "out"))
703 (bin (string-append out "/bin")))
704 (install-file "amalgamate.py" bin))))
705 (replace 'check
706 (lambda _
707 (invoke "./test.sh"))))))
708 (synopsis "Tool for amalgamating C source and header files")
709 ;; The package is indeed a script file, and the term "amalgamate.py" is
710 ;; used by upstream.
711 (description "amalgamate.py aims to make it easy to use SQLite-style C
712source and header amalgamation in projects.")
713 (license license:bsd-3))))