Commit | Line | Data |
---|---|---|
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 | |
84 | control flow of the program. It can output the graph in several styles and | |
e881752c | 85 | in either the POSIX format or in an extended GNU format. cflow also includes |
99e64a6e | 86 | a 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 | |
108 | convoluted, overly long or otherwise difficult to understand. This | |
109 | may help in learning or reviewing unfamiliar code or perhaps | |
110 | highlighting 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 |
150 | way across a wide array of environments, such as different text editors, | |
151 | shells and web browsers. The resulting tags are useful for quickly moving | |
152 | around 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 | |
206 | code (SLOC) in large software systems. It can automatically identify and | |
207 | measure a wide range of programming languages. It automatically estimates the | |
208 | effort, time, and money it would take to develop the software, using the | |
209 | COCOMO model or user-provided parameters.") | |
d13586bf TČ |
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 | |
260 | of source code in many programming languages. Given two versions of a code | |
261 | base, cloc can compute differences in blank, comment, and source lines. | |
262 | ||
263 | cloc contains code from David Wheeler's SLOCCount. Compared to SLOCCount, | |
e0f49664 | 264 | cloc can handle a greater variety of programming languages.") |
f7fc9667 AW |
265 | (license license:gpl2+))) |
266 | ||
d13586bf TČ |
267 | (define-public the-silver-searcher |
268 | (package | |
269 | (name "the-silver-searcher") | |
ffa82227 | 270 | (version "2.2.0") |
d13586bf TČ |
271 | (source (origin |
272 | (method url-fetch) | |
273 | (uri (string-append | |
422a6cd4 | 274 | "https://geoff.greer.fm/ag/releases/the_silver_searcher-" |
d13586bf TČ |
275 | version ".tar.gz")) |
276 | (sha256 | |
277 | (base32 | |
ffa82227 | 278 | "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr")))) |
d13586bf TČ |
279 | (build-system gnu-build-system) |
280 | (native-inputs | |
392f3266 | 281 | `(("pkg-config" ,pkg-config))) |
d13586bf TČ |
282 | (inputs |
283 | `(("pcre" ,pcre) | |
284 | ("xz" ,xz) | |
285 | ("zlib" ,zlib))) | |
422a6cd4 | 286 | (home-page "https://geoff.greer.fm/ag/") |
d13586bf TČ |
287 | (synopsis "Fast code searching tool") |
288 | (description | |
6acff0f9 TGR |
289 | "The Silver Searcher (@command{ag}) is a tool for quickly searching large |
290 | numbers of files. It's intended primarily for source code repositories, and | |
291 | respects files like @file{.gitignore} and @file{.hgignore}. It's also an order | |
292 | of magnitude faster than its inspiration, @command{ack}, and less specialised | |
293 | tools 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 | |
312 | applications with a focus on portability or with the need for additional | |
313 | features 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") | |
3dd14ea7 TGR |
323 | (source |
324 | (origin | |
325 | (method git-fetch) | |
326 | (uri (git-reference | |
327 | (url "https://github.com/cameronwhite/withershins.git") | |
328 | (commit (string-append "v" version)))) | |
329 | (file-name (git-file-name name version)) | |
330 | (sha256 | |
331 | (base32 "1cviqvbbcwljm1zx12j6511hazr3kscwrvcyifrkfi4fpy5z985m")))) | |
76e14638 RW |
332 | (build-system cmake-build-system) |
333 | (arguments | |
334 | `(#:out-of-source? #f | |
66c2df9e TGR |
335 | #:configure-flags |
336 | ;; XXX A (justified!) misleading-indentation error breaks the build. | |
337 | (list "-DENABLE_WERROR=OFF") | |
76e14638 RW |
338 | #:phases |
339 | (modify-phases %standard-phases | |
340 | (add-after | |
341 | 'unpack 'find-libiberty | |
342 | (lambda _ | |
25734108 | 343 | (let ((libiberty (assoc-ref %build-inputs "libiberty"))) |
76e14638 | 344 | (substitute* "cmake/FindIberty.cmake" |
25734108 RW |
345 | (("/usr/include") (string-append libiberty "/include")) |
346 | (("libiberty.a iberty") | |
347 | (string-append "NAMES libiberty.a iberty\nPATHS \"" | |
348 | libiberty "/lib" "\""))) | |
76e14638 RW |
349 | #t))) |
350 | (replace | |
351 | 'install | |
352 | (lambda* (#:key outputs #:allow-other-keys) | |
f3860753 TGR |
353 | (let* ((out (assoc-ref outputs "out")) |
354 | (include (string-append out "/include")) | |
355 | (lib (string-append out "/lib"))) | |
356 | (mkdir-p include) | |
357 | (install-file "src/withershins.hpp" include) | |
358 | (mkdir-p lib) | |
359 | (install-file "src/libwithershins.a" lib)) | |
76e14638 RW |
360 | #t))))) |
361 | (home-page "https://github.com/cameronwhite/withershins") | |
362 | (inputs | |
25734108 | 363 | `(("libiberty" ,libiberty) |
76e14638 RW |
364 | ("binutils" ,binutils) ;for libbfd |
365 | ("zlib" ,zlib))) | |
366 | (synopsis "C++11 library for generating stack traces") | |
367 | (description | |
368 | "Withershins is a simple cross-platform C++11 library for generating | |
369 | stack traces.") | |
370 | ;; Sources are released under Expat license, but since BFD is licensed | |
371 | ;; under the GPLv3+ the combined work is GPLv3+ as well. | |
372 | (license license:gpl3+))) | |
0084aaf3 LC |
373 | |
374 | (define-public lcov | |
375 | (package | |
376 | (name "lcov") | |
8fadbc4b | 377 | (version "1.14") |
0084aaf3 LC |
378 | (source (origin |
379 | (method url-fetch) | |
de67e922 LF |
380 | (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis" |
381 | "/LCOV-" version "/lcov-" version ".tar.gz")) | |
0084aaf3 LC |
382 | (sha256 |
383 | (base32 | |
8fadbc4b | 384 | "06h7ixyznf6vz1qvksjgy5f3q2nw9akf6zx59npf0h3l32cmd68l")))) |
0084aaf3 LC |
385 | (build-system gnu-build-system) |
386 | (arguments | |
b15af0ce TGR |
387 | '(#:make-flags |
388 | (let ((out (assoc-ref %outputs "out"))) | |
389 | (list (string-append "PREFIX=" out))) | |
390 | #:phases | |
391 | (modify-phases %standard-phases | |
392 | (delete 'configure)) ; no configure script | |
393 | #:tests? #f)) ; no 'check' target | |
0084aaf3 LC |
394 | (inputs `(("perl" ,perl))) |
395 | (home-page "http://ltp.sourceforge.net/coverage/lcov.php") | |
396 | (synopsis "Code coverage tool that enhances GNU gcov") | |
397 | (description | |
398 | "LCOV is an extension of @command{gcov}, a tool part of the | |
399 | GNU@tie{}Binutils, which provides information about what parts of a program | |
400 | are actually executed (i.e., \"covered\") while running a particular test | |
401 | case. The extension consists of a set of Perl scripts which build on the | |
402 | textual @command{gcov} output to implement the following enhanced | |
403 | functionality such as HTML output.") | |
404 | (license license:gpl2+))) | |
4b3070f7 FT |
405 | |
406 | (define-public rtags | |
407 | (package | |
408 | (name "rtags") | |
af147cdd | 409 | (version "2.18") |
457fc22d FT |
410 | (source |
411 | (origin | |
84ae0e29 TGR |
412 | (method git-fetch) |
413 | (uri (git-reference | |
414 | (url "https://github.com/Andersbakken/rtags.git") | |
415 | (commit (string-append "v" version)))) | |
416 | (file-name (git-file-name name version)) | |
457fc22d FT |
417 | (patches (search-patches "rtags-separate-rct.patch")) |
418 | (modules '((guix build utils))) | |
419 | (snippet | |
420 | ;; Part of spliting rct with rtags. | |
421 | ;; Substitute #include "rct/header.h" with #include <rct/header.h>. | |
422 | '(with-directory-excursion "src" | |
423 | (delete-file-recursively "rct") ;remove bundled copy | |
424 | (let ((files (find-files "." ".*\\.cpp|.*\\.h"))) | |
425 | (substitute* files | |
426 | (("#include ?\"rct/(.*.h)\"" all header) | |
6cbee49d MW |
427 | (string-append "#include <rct/" header ">"))) |
428 | #t))) | |
457fc22d FT |
429 | (sha256 |
430 | (base32 | |
84ae0e29 | 431 | "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0")))) |
4b3070f7 FT |
432 | (build-system cmake-build-system) |
433 | (arguments | |
3def739d TGR |
434 | '(#:build-type "RelWithDebInfo" |
435 | #:configure-flags | |
457fc22d | 436 | '("-DRTAGS_NO_ELISP_FILES=1" |
457fc22d | 437 | "-DBUILD_TESTING=FALSE") |
4b3070f7 | 438 | #:tests? #f)) |
457fc22d FT |
439 | (native-inputs |
440 | `(("pkg-config" ,pkg-config))) | |
4b3070f7 | 441 | (inputs |
457fc22d FT |
442 | `(("bash-completion" ,bash-completion) |
443 | ("clang" ,clang) | |
4b3070f7 | 444 | ("llvm" ,llvm) |
457fc22d FT |
445 | ("lua" ,lua) |
446 | ("rct" ,rct) | |
447 | ("selene" ,selene))) | |
84ae0e29 | 448 | (home-page "https://github.com/Andersbakken/rtags") |
4b3070f7 FT |
449 | (synopsis "Indexer for the C language family with Emacs integration") |
450 | (description | |
451 | "RTags is a client/server application that indexes C/C++ code and keeps a | |
452 | persistent file-based database of references, declarations, definitions, | |
453 | symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you | |
454 | to find symbols by name (including nested class and namespace scope). Most | |
455 | importantly we give you proper follow-symbol and find-references support.") | |
456 | (license license:gpl3+))) | |
dc993847 OP |
457 | |
458 | (define-public colormake | |
459 | (package | |
460 | (name "colormake") | |
461 | (version "0.9.20140503") | |
462 | (source | |
463 | (origin | |
213c32e4 TGR |
464 | (method git-fetch) |
465 | (uri (git-reference | |
466 | (url "https://github.com/pagekite/Colormake.git") | |
467 | (commit version))) | |
468 | (file-name (git-file-name name version)) | |
dc993847 | 469 | (sha256 |
213c32e4 | 470 | (base32 "1f9v5s0viq4yc9iv6701h3pv7j21zz1ckl37lpp9hsnliiizv03p")))) |
dc993847 OP |
471 | (build-system trivial-build-system) |
472 | (native-inputs | |
473 | `(("bash" ,bash) | |
213c32e4 | 474 | ("perl" ,perl))) |
dc993847 OP |
475 | (arguments |
476 | `(#:modules ((guix build utils)) | |
477 | #:builder | |
478 | (begin | |
479 | (use-modules (guix build utils)) | |
213c32e4 TGR |
480 | (copy-recursively (assoc-ref %build-inputs "source") "source") |
481 | (chdir "source") | |
dc993847 OP |
482 | (patch-shebang "colormake.pl" |
483 | (list (string-append (assoc-ref %build-inputs "perl") | |
484 | "/bin"))) | |
485 | (let* ((out (assoc-ref %outputs "out")) | |
486 | (bin (string-append out "/bin")) | |
487 | (doc (string-append out "/share/doc")) | |
488 | (install-files (lambda (files directory) | |
489 | (for-each (lambda (file) | |
490 | (install-file file directory)) | |
491 | files)))) | |
492 | (substitute* "colormake" | |
493 | (("colormake\\.pl") (string-append bin "/colormake.pl")) | |
494 | (("/bin/bash") | |
495 | (string-append (assoc-ref %build-inputs "bash") "/bin/sh"))) | |
496 | (install-file "colormake.1" (string-append doc "/man/man1")) | |
497 | (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc) | |
498 | (install-files '("colormake" "colormake-short" "clmake" | |
499 | "clmake-short" "colormake.pl") | |
e3cfef22 MW |
500 | bin) |
501 | #t)))) | |
0e564b5e | 502 | (home-page "https://bre.klaki.net/programs/colormake/") |
dc993847 OP |
503 | (synopsis "Wrapper around @command{make} to produce colored output") |
504 | (description "This package provides a wrapper around @command{make} to | |
505 | produce colored output.") | |
506 | (license license:gpl2+))) | |
906dcb20 CB |
507 | |
508 | (define-public makefile2graph | |
509 | (package | |
510 | (name "makefile2graph") | |
511 | (version "1.5.0") | |
104264cd TGR |
512 | (source |
513 | (origin | |
514 | (method git-fetch) | |
515 | (uri (git-reference | |
516 | (url "https://github.com/lindenb/makefile2graph.git") | |
517 | (commit (string-append "v" version)))) | |
518 | (file-name (git-file-name name version)) | |
519 | (sha256 | |
520 | (base32 "1gjfk3d8qg3cla7qd2y7r9s03whlfwy83q8k76xfcnqrjjfavdgk")))) | |
906dcb20 CB |
521 | (build-system gnu-build-system) |
522 | (arguments | |
523 | '(#:test-target "test" | |
524 | #:make-flags (list "CC=gcc" (string-append "prefix=" %output)) | |
525 | #:phases | |
526 | (modify-phases %standard-phases | |
527 | (delete 'configure)))) | |
528 | (native-inputs | |
529 | `(("graphviz" ,graphviz))) | |
530 | (home-page "https://github.com/lindenb/makefile2graph") | |
531 | (synopsis "Creates a graph of dependencies from GNU Make") | |
532 | (description | |
533 | "@code{make2graph} creates a graph of dependencies from GNU Make. The | |
534 | output is a graphviz-dot file, a Gexf-XML file or a list of the deepest | |
535 | independent targets.") | |
536 | (license license:expat))) | |
9c4dcfaf PN |
537 | |
538 | (define-public uncrustify | |
539 | (package | |
540 | (name "uncrustify") | |
ae5de93a | 541 | (version "0.69.0") |
9c4dcfaf | 542 | (source (origin |
b5944fcb PN |
543 | (method git-fetch) |
544 | (uri (git-reference | |
545 | (url "https://github.com/uncrustify/uncrustify/") | |
546 | (commit (string-append name "-" version)))) | |
547 | (file-name (git-file-name name version)) | |
9c4dcfaf PN |
548 | (sha256 |
549 | (base32 | |
ae5de93a | 550 | "0sqrg13kp8fwymq40976bq380bzw40g4ss7ihlbq45d0f90ifa1k")))) |
9c4dcfaf PN |
551 | (build-system cmake-build-system) |
552 | (native-inputs | |
34843fe9 PN |
553 | `(("unzip" ,unzip) |
554 | ("python" ,python-wrapper))) | |
9c4dcfaf PN |
555 | (arguments |
556 | `(#:phases | |
557 | (modify-phases %standard-phases | |
558 | (add-after 'unpack 'unpack-etc | |
559 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
560 | ;; Configuration samples are not installed by default. | |
561 | (let* ((output (assoc-ref outputs "out")) | |
562 | (etcdir (string-append output "/etc"))) | |
563 | (for-each (lambda (l) | |
564 | (install-file l etcdir)) | |
565 | (find-files "etc" "\\.cfg$"))) | |
566 | #t))))) | |
567 | (home-page "http://uncrustify.sourceforge.net/") | |
568 | (synopsis "Code formatter for C and other related languages") | |
569 | (description | |
570 | "Beautify source code in many languages of the C family (C, C++, C#, | |
571 | Objective@tie{}C, D, Java, Pawn, and Vala). Features: | |
572 | @itemize | |
573 | @item Indent and align code. | |
574 | @item Reformat comments (a little bit). | |
575 | @item Fix inter-character spacing. | |
576 | @item Add or remove parens / braces. | |
577 | @item Supports embedded SQL @code{EXEC SQL} stuff. | |
578 | @item Highly configurable - More than 600 configurable options. | |
579 | @end itemize\n") | |
580 | (license license:gpl2+))) | |
c1e5109b LC |
581 | |
582 | (define-public astyle | |
583 | (package | |
584 | (name "astyle") | |
4bfd8579 | 585 | (version "3.1") |
c1e5109b LC |
586 | (source |
587 | (origin | |
588 | (method url-fetch) | |
589 | (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20" | |
590 | version "/astyle_" version "_linux.tar.gz")) | |
591 | (sha256 | |
592 | (base32 | |
4bfd8579 | 593 | "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b")))) |
c1e5109b LC |
594 | (build-system gnu-build-system) |
595 | (arguments | |
596 | `(#:tests? #f ;no tests | |
597 | #:make-flags (list (string-append "prefix=" %output) | |
598 | "INSTALL=install" | |
599 | "all") | |
600 | #:phases | |
601 | (modify-phases %standard-phases | |
602 | (replace 'configure | |
603 | (lambda _ (chdir "build/gcc") #t)) | |
604 | (add-after 'install 'install-libs | |
605 | (lambda* (#:key outputs #:allow-other-keys) | |
606 | ;; Libraries are not installed by default | |
607 | (let* ((output (assoc-ref outputs "out")) | |
608 | (libdir (string-append output "/lib"))) | |
609 | (begin | |
610 | (mkdir-p libdir) | |
611 | (for-each (lambda (l) | |
612 | (copy-file | |
613 | l (string-append libdir "/" (basename l)))) | |
614 | (find-files "bin" "lib*")))) | |
615 | #t))))) | |
616 | (home-page "http://astyle.sourceforge.net/") | |
617 | (synopsis "Source code indenter, formatter, and beautifier") | |
618 | (description | |
619 | "Artistic Style is a source code indenter, formatter, and beautifier for | |
620 | the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.") | |
621 | (license license:lgpl3+))) | |
e470abf8 LC |
622 | |
623 | (define-public indent | |
624 | (package | |
625 | (name "indent") | |
7fe6dcf7 | 626 | (version "2.2.12") |
e470abf8 LC |
627 | (source (origin |
628 | (method url-fetch) | |
629 | (uri (string-append "mirror://gnu/indent/indent-" version | |
630 | ".tar.gz")) | |
7fe6dcf7 MB |
631 | (sha256 |
632 | (base32 "12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7")))) | |
e470abf8 LC |
633 | (build-system gnu-build-system) |
634 | (arguments | |
9d10a634 MW |
635 | `(#:phases |
636 | (modify-phases %standard-phases | |
637 | (add-after 'unpack 'fix-docdir | |
638 | (lambda _ | |
639 | ;; Although indent uses a modern autoconf in which docdir | |
640 | ;; defaults to PREFIX/share/doc, the doc/Makefile.am | |
641 | ;; overrides this to be in PREFIX/doc. Fix this. | |
642 | (substitute* "doc/Makefile.in" | |
643 | (("^docdir = .*$") "docdir = @docdir@\n")) | |
644 | #t))))) | |
7fe6dcf7 MB |
645 | (native-inputs |
646 | `(("texinfo" ,texinfo))) | |
e470abf8 LC |
647 | (synopsis "Code reformatter") |
648 | (description | |
649 | "Indent is a program that makes source code easier to read by | |
650 | reformatting it in a consistent style. It can change the style to one of | |
651 | several different styles such as GNU, BSD or K&R. It has some flexibility to | |
652 | deal with incomplete or malformed syntax. GNU indent offers several | |
653 | extensions over the standard utility.") | |
654 | (license license:gpl3+) | |
655 | (home-page "https://www.gnu.org/software/indent/"))) | |
ad8a4d6d FT |
656 | |
657 | (define-public amalgamate | |
658 | (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208") | |
659 | (revision "0") | |
660 | (version (git-version "1.1.1" revision commit))) | |
661 | (package | |
662 | (name "amalgamate") | |
663 | (version version) | |
664 | (home-page "https://github.com/edlund/amalgamate") | |
665 | (source | |
666 | (origin | |
667 | (method git-fetch) | |
668 | (uri (git-reference | |
669 | (url home-page) | |
670 | (commit commit))) | |
671 | (sha256 | |
672 | (base32 | |
673 | "0cllaraw8mxs8q2nr28nhgzkb417gj2wcklqg59w84f4lc78k3yb")) | |
674 | (file-name (git-file-name name version)) | |
675 | (modules '((guix build utils))) | |
676 | (snippet | |
677 | '(substitute* "test.sh" | |
678 | (("test_command \"cc -Wall -Wextra -o source.out source.c\"" all) | |
679 | "test_command \"gcc -Wall -Wextra -o source.out source.c\""))))) | |
680 | (build-system gnu-build-system) | |
681 | (inputs | |
682 | `(("python" ,python-wrapper))) | |
683 | (arguments | |
684 | `(#:phases | |
685 | (modify-phases %standard-phases | |
686 | (delete 'configure) | |
687 | (delete 'build) | |
688 | (replace 'install | |
689 | (lambda* (#:key outputs #:allow-other-keys) | |
690 | (let* ((out (assoc-ref outputs "out")) | |
691 | (bin (string-append out "/bin"))) | |
692 | (install-file "amalgamate.py" bin)))) | |
693 | (replace 'check | |
694 | (lambda _ | |
695 | (invoke "./test.sh")))))) | |
696 | (synopsis "Tool for amalgamating C source and header files") | |
697 | ;; The package is indeed a script file, and the term "amalgamate.py" is | |
698 | ;; used by upstream. | |
699 | (description "amalgamate.py aims to make it easy to use SQLite-style C | |
700 | source and header amalgamation in projects.") | |
701 | (license license:bsd-3)))) |