projects/guix·blob version-1.0.1 · refs

715 lines · 28.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2015, 2018 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Andreas Enge <[email protected]>
4;;; Copyright © 2015, 2018 Ricardo Wurmus <[email protected]>
5;;; Copyright © 2016, 2017, 2019 Efraim Flashner <[email protected]>
6;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2017, 2018 Clément Lassieur <[email protected]>
8;;; Copyright © 2017 Andy Wingo <[email protected]>
9;;; Copyright © 2018 Fis Trivial <[email protected]>
10;;; Copyright © 2018 Pierre Neidhardt <[email protected]>
11;;; Copyright © 2014 Eric Bavier <[email protected]>
12;;; Copyright © 2013 Andreas Enge <[email protected]>
13;;; Copyright © 2014 Mark H Weaver <[email protected]>
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)
33 #:use-module (guix git-download)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system trivial)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autogen)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages cpp)
45 #:use-module (gnu packages emacs)
46 #:use-module (gnu packages gcc)
47 #:use-module (gnu packages graphviz)
48 #:use-module (gnu packages pcre)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages sqlite)
53 #:use-module (gnu packages texinfo)
54 #:use-module (gnu packages ncurses)
55 #:use-module (gnu packages llvm)
56 #:use-module (gnu packages lua))
57
58;;; Tools to deal with source code: metrics, cross-references, etc.
59
60(define-public cflow
61 (package
62 (name "cflow")
63 (version "1.6")
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "mirror://gnu/cflow/cflow-"
67 version ".tar.bz2"))
68 (sha256
69 (base32
70 "1mzd3yf0dfv8h2av5vsxxlhpk21nw064h91b2kgfrdz92r0pnj1l"))))
71 (build-system gnu-build-system)
72
73 ;; Needed to have cflow-mode.el installed.
74 (native-inputs `(("emacs" ,emacs-minimal)))
75 (arguments
76 '(#:configure-flags (list (string-append "CPPFLAGS="
77 "-D" "CFLOW_PREPROC=\\\""
78 (assoc-ref %build-inputs "gcc")
79 "/bin/cpp\\\""))))
80 (home-page "https://www.gnu.org/software/cflow/")
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
85in either the POSIX format or in an extended GNU format. cflow also includes
86a major mode for Emacs for examining the flowcharts that it produces.")
87 (license license:gpl3+)))
88
89(define-public complexity
90 (package
91 (name "complexity")
92 (version "1.10")
93 (source (origin
94 (method url-fetch)
95 (uri (string-append "mirror://gnu/complexity/complexity-"
96 version ".tar.xz"))
97 (sha256
98 (base32
99 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
100 (build-system gnu-build-system)
101 (native-inputs
102 `(("texinfo" ,texinfo)
103 ("autogen" ,autogen)))
104 (home-page "https://www.gnu.org/software/complexity/")
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.")
111 (license license:gpl3+)))
112
113(define-public global ; a global variable
114 (package
115 (name "global")
116 (version "6.6.3")
117 (source (origin
118 (method url-fetch)
119 (uri (string-append "mirror://gnu/global/global-"
120 version ".tar.gz"))
121 (sha256
122 (base32
123 "0735pj47dnspf20n0j1px24p59nwjinlmlb2n32ln1hvdkprivnb"))))
124 (build-system gnu-build-system)
125 (inputs `(("ncurses" ,ncurses)
126 ("libltdl" ,libltdl)
127 ("sqlite" ,sqlite)))
128 (arguments
129 `(#:configure-flags
130 (list (string-append "--with-ncurses="
131 (assoc-ref %build-inputs "ncurses"))
132 (string-append "--with-sqlite3="
133 (assoc-ref %build-inputs "sqlite")))
134
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))))))
146 (home-page "https://www.gnu.org/software/global/")
147 (synopsis "Cross-environment source code tag system")
148 (description
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.")
153 (license license:gpl3+)))
154
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
169 (delete 'configure)
170 (add-before 'build 'make-dotl-files-older
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))
182 (add-before 'install 'make-target-directories
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"))
190 #t)))
191 (replace 'check
192 (lambda _
193 (setenv "HOME" (getcwd))
194 (setenv "PATH"
195 (string-append (getcwd) ":"
196 (getenv "PATH")))
197 (invoke "make" "test"))))
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.")
210 (license license:gpl2+)))
211
212(define-public cloc
213 (package
214 (name "cloc")
215 (version "1.82")
216 (source
217 (origin
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))
223 (sha256
224 (base32 "0fsz07z0slfg58512fmnlj8pnxkc360bgf7fclg60v9clvcjbjsw"))))
225 (build-system gnu-build-system)
226 (inputs
227 `(("coreutils" ,coreutils)
228 ("perl" ,perl)
229 ("perl-algorithm-diff" ,perl-algorithm-diff)
230 ("perl-digest-md5" ,perl-digest-md5)
231 ("perl-parallel-forkmanager" ,perl-parallel-forkmanager)
232 ("perl-regexp-common" ,perl-regexp-common)))
233 (arguments
234 `(#:phases (modify-phases %standard-phases
235 (delete 'configure) ; nothing to configure
236 (delete 'build) ; nothing to build
237 (replace 'install
238 (lambda* (#:key inputs outputs #:allow-other-keys)
239 (let* ((out (assoc-ref outputs "out")))
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)))
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,
264cloc can handle a greater variety of programming languages.")
265 (license license:gpl2+)))
266
267(define-public the-silver-searcher
268 (package
269 (name "the-silver-searcher")
270 (version "2.2.0")
271 (source (origin
272 (method url-fetch)
273 (uri (string-append
274 "https://geoff.greer.fm/ag/releases/the_silver_searcher-"
275 version ".tar.gz"))
276 (sha256
277 (base32
278 "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr"))))
279 (build-system gnu-build-system)
280 (native-inputs
281 `(("pkg-config" ,pkg-config)))
282 (inputs
283 `(("pcre" ,pcre)
284 ("xz" ,xz)
285 ("zlib" ,zlib)))
286 (home-page "https://geoff.greer.fm/ag/")
287 (synopsis "Fast code searching tool")
288 (description
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}.")
294 (license license:asl2.0)))
295
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
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
335 #:phases
336 (modify-phases %standard-phases
337 (add-after
338 'unpack 'find-libiberty
339 (lambda _
340 (let ((libiberty (assoc-ref %build-inputs "libiberty")))
341 (substitute* "cmake/FindIberty.cmake"
342 (("/usr/include") (string-append libiberty "/include"))
343 (("libiberty.a iberty")
344 (string-append "NAMES libiberty.a iberty\nPATHS \""
345 libiberty "/lib" "\"")))
346 #t)))
347 (replace
348 'install
349 (lambda* (#:key outputs #:allow-other-keys)
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))
357 #t)))))
358 (home-page "https://github.com/cameronwhite/withershins")
359 (inputs
360 `(("libiberty" ,libiberty)
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+)))
370
371(define-public lcov
372 (package
373 (name "lcov")
374 (version "1.14")
375 (source (origin
376 (method url-fetch)
377 (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis"
378 "/LCOV-" version "/lcov-" version ".tar.gz"))
379 (sha256
380 (base32
381 "06h7ixyznf6vz1qvksjgy5f3q2nw9akf6zx59npf0h3l32cmd68l"))))
382 (build-system gnu-build-system)
383 (arguments
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
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+)))
402
403(define-public rtags
404 (package
405 (name "rtags")
406 (version "2.18")
407 (source
408 (origin
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))
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)
424 (string-append "#include <rct/" header ">")))
425 #t)))
426 (sha256
427 (base32
428 "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0"))))
429 (build-system cmake-build-system)
430 (arguments
431 '(#:build-type "RelWithDebInfo"
432 #:configure-flags
433 '("-DRTAGS_NO_ELISP_FILES=1"
434 "-DCMAKE_CXX_FLAGS=-std=c++11"
435 "-DBUILD_TESTING=FALSE")
436 #:tests? #f))
437 (native-inputs
438 `(("pkg-config" ,pkg-config)))
439 (inputs
440 `(("bash-completion" ,bash-completion)
441 ("clang" ,clang)
442 ("llvm" ,llvm)
443 ("lua" ,lua)
444 ("rct" ,rct)
445 ("selene" ,selene)))
446 (home-page "https://github.com/Andersbakken/rtags")
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+)))
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")
504 bin)
505 #t))))
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+)))
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)))
540
541(define-public uncrustify
542 (package
543 (name "uncrustify")
544 (version "0.69.0")
545 (source (origin
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))
551 (sha256
552 (base32
553 "0sqrg13kp8fwymq40976bq380bzw40g4ss7ihlbq45d0f90ifa1k"))))
554 (build-system cmake-build-system)
555 (native-inputs
556 `(("unzip" ,unzip)
557 ("python" ,python-wrapper)))
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+)))
584
585(define-public astyle
586 (package
587 (name "astyle")
588 (version "3.1")
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
596 "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b"))))
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+)))
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
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)))))
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/")))
657
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
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))))