Commit | Line | Data |
---|---|---|
23153c90 | 1 | ;;; GNU Guix --- Functional package management for GNU |
dda0ada3 | 2 | ;;; Copyright © 2013, 2015, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org> |
a5b24740 | 3 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
4bfd8579 | 4 | ;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net> |
03fd5308 | 5 | ;;; Copyright © 2016, 2017, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il> |
ba7cd0fd | 6 | ;;; Copyright © 2017, 2018, 2019, 2020 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 | 12 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> |
62b8ae1a | 13 | ;;; Copyright © 2019 Hartmut Goebel <h.goebel@goebel-consult.de> |
86a91543 | 14 | ;;; Copyright © 2020, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
6ee590ec | 15 | ;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org> |
89c9e647 | 16 | ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu> |
93242b54 | 17 | ;;; Copyright © 2021 lu hui <luhuins@163.com> |
a0adb5f4 | 18 | ;;; Copyright © 2021, 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com> |
309935a0 | 19 | ;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de> |
23153c90 LC |
20 | ;;; |
21 | ;;; This file is part of GNU Guix. | |
22 | ;;; | |
23 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
24 | ;;; under the terms of the GNU General Public License as published by | |
25 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
26 | ;;; your option) any later version. | |
27 | ;;; | |
28 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
29 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
30 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
31 | ;;; GNU General Public License for more details. | |
32 | ;;; | |
33 | ;;; You should have received a copy of the GNU General Public License | |
34 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
35 | ||
36 | (define-module (gnu packages code) | |
d9d65f4e | 37 | #:use-module (guix gexp) |
23153c90 | 38 | #:use-module (guix packages) |
59bd4b90 | 39 | #:use-module (guix utils) |
23153c90 | 40 | #:use-module (guix download) |
ad8a4d6d | 41 | #:use-module (guix git-download) |
d13586bf | 42 | #:use-module ((guix licenses) #:prefix license:) |
23153c90 | 43 | #:use-module (guix build-system gnu) |
76e14638 | 44 | #:use-module (guix build-system cmake) |
830ea727 | 45 | #:use-module (guix build-system python) |
dc993847 | 46 | #:use-module (guix build-system trivial) |
457fc22d | 47 | #:use-module (gnu packages) |
ad8a4d6d FT |
48 | #:use-module (gnu packages autogen) |
49 | #:use-module (gnu packages autotools) | |
76e14638 | 50 | #:use-module (gnu packages base) |
ad8a4d6d | 51 | #:use-module (gnu packages bash) |
a0adb5f4 | 52 | #:use-module (gnu packages bison) |
58056d5b | 53 | #:use-module (gnu packages c) |
d13586bf | 54 | #:use-module (gnu packages compression) |
457fc22d | 55 | #:use-module (gnu packages cpp) |
89c9e647 JL |
56 | #:use-module (gnu packages curl) |
57 | #:use-module (gnu packages elf) | |
99e64a6e | 58 | #:use-module (gnu packages emacs) |
a0adb5f4 | 59 | #:use-module (gnu packages flex) |
76e14638 | 60 | #:use-module (gnu packages gcc) |
906dcb20 | 61 | #:use-module (gnu packages graphviz) |
1b8c7d12 | 62 | #:use-module (gnu packages llvm) |
58056d5b | 63 | #:use-module (gnu packages linux) |
1b8c7d12 MB |
64 | #:use-module (gnu packages lua) |
65 | #:use-module (gnu packages ncurses) | |
d13586bf | 66 | #:use-module (gnu packages pcre) |
99e64a6e | 67 | #:use-module (gnu packages perl) |
d8ccff83 | 68 | #:use-module (gnu packages perl-compression) |
ad8a4d6d FT |
69 | #:use-module (gnu packages pkg-config) |
70 | #:use-module (gnu packages python) | |
86a91543 | 71 | #:use-module (gnu packages python-web) |
590be0a1 | 72 | #:use-module (gnu packages python-xyz) |
a0adb5f4 | 73 | #:use-module (gnu packages readline) |
e8122816 | 74 | #:use-module (gnu packages serialization) |
cd0322a3 | 75 | #:use-module (gnu packages sqlite) |
58056d5b | 76 | #:use-module (gnu packages texinfo) |
1e4b2d8e | 77 | #:use-module (gnu packages tls) |
58056d5b MB |
78 | #:use-module (gnu packages web) |
79 | #:use-module (gnu packages xml)) | |
23153c90 LC |
80 | |
81 | ;;; Tools to deal with source code: metrics, cross-references, etc. | |
82 | ||
99e64a6e LC |
83 | (define-public cflow |
84 | (package | |
85 | (name "cflow") | |
03fd5308 | 86 | (version "1.7") |
99e64a6e LC |
87 | (source (origin |
88 | (method url-fetch) | |
89 | (uri (string-append "mirror://gnu/cflow/cflow-" | |
90 | version ".tar.bz2")) | |
91 | (sha256 | |
92 | (base32 | |
03fd5308 | 93 | "11khr78090jjyqa2l26bdz0myjx6b212lz216dhjc7h0z754c4fh")))) |
99e64a6e LC |
94 | (build-system gnu-build-system) |
95 | ||
96 | ;; Needed to have cflow-mode.el installed. | |
03fd5308 EF |
97 | (native-inputs |
98 | (list emacs-minimal)) | |
65d98906 OP |
99 | (arguments |
100 | '(#:configure-flags (list (string-append "CPPFLAGS=" | |
101 | "-D" "CFLOW_PREPROC=\\\"" | |
102 | (assoc-ref %build-inputs "gcc") | |
103 | "/bin/cpp\\\"")))) | |
6fd52309 | 104 | (home-page "https://www.gnu.org/software/cflow/") |
99e64a6e LC |
105 | (synopsis "Create a graph of control flow within a program") |
106 | (description | |
107 | "GNU cflow analyzes C source files and produces a graph charting the | |
108 | control flow of the program. It can output the graph in several styles and | |
e881752c | 109 | in either the POSIX format or in an extended GNU format. cflow also includes |
99e64a6e | 110 | a major mode for Emacs for examining the flowcharts that it produces.") |
d13586bf | 111 | (license license:gpl3+))) |
99e64a6e LC |
112 | |
113 | (define-public complexity | |
114 | (package | |
115 | (name "complexity") | |
1e42d8b8 | 116 | (version "1.10") |
99e64a6e LC |
117 | (source (origin |
118 | (method url-fetch) | |
119 | (uri (string-append "mirror://gnu/complexity/complexity-" | |
1e42d8b8 | 120 | version ".tar.xz")) |
99e64a6e LC |
121 | (sha256 |
122 | (base32 | |
1e42d8b8 | 123 | "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd")))) |
99e64a6e | 124 | (build-system gnu-build-system) |
f1ec2d67 VC |
125 | (arguments |
126 | (list #:phases | |
127 | #~(modify-phases %standard-phases | |
128 | (add-before 'build 'set-man-page-date | |
129 | ;; Avoid embedding the current date for reproducible builds | |
130 | (lambda _ | |
131 | (setenv "MAN_PAGE_DATE" "2012-04-18")))))) | |
99e64a6e | 132 | (native-inputs |
8394619b | 133 | (list texinfo autogen)) |
6fd52309 | 134 | (home-page "https://www.gnu.org/software/complexity/") |
99e64a6e LC |
135 | (synopsis "Analyze complexity of C functions") |
136 | (description | |
137 | "GNU complexity provides tools for finding procedures that are | |
138 | convoluted, overly long or otherwise difficult to understand. This | |
139 | may help in learning or reviewing unfamiliar code or perhaps | |
140 | highlighting your own code that seemed comprehensible when you wrote it.") | |
d13586bf | 141 | (license license:gpl3+))) |
99e64a6e LC |
142 | |
143 | (define-public global ; a global variable | |
144 | (package | |
145 | (name "global") | |
0c408f8b | 146 | (version "6.6.8") |
99e64a6e LC |
147 | (source (origin |
148 | (method url-fetch) | |
149 | (uri (string-append "mirror://gnu/global/global-" | |
150 | version ".tar.gz")) | |
151 | (sha256 | |
152 | (base32 | |
0c408f8b | 153 | "1kaphc3gml89p8dpdgh2is8hj46wj05689kxj0bmh5q759rxk4vg")))) |
99e64a6e | 154 | (build-system gnu-build-system) |
99e64a6e | 155 | (arguments |
d9d65f4e TGR |
156 | (list #:configure-flags |
157 | #~(list (string-append "--with-ncurses=" | |
158 | #$(this-package-input "ncurses")) | |
159 | (string-append "--with-sqlite3=" | |
160 | #$(this-package-input "sqlite")) | |
161 | (string-append "--with-universal-ctags=" | |
162 | #$(this-package-input "universal-ctags") | |
163 | "/bin/ctags") | |
164 | (string-append "--sysconfdir=" | |
165 | #$output "/share/gtags") | |
166 | "--localstatedir=/var" ; This needs to be a writable location. | |
167 | "--disable-static") | |
99e64a6e | 168 | |
d9d65f4e TGR |
169 | #:phases |
170 | #~(modify-phases %standard-phases | |
171 | (add-after 'unpack 'fix-globash | |
172 | (lambda* (#:key inputs #:allow-other-keys) | |
173 | (substitute* "globash/globash.in" | |
174 | (("/bin/echo") | |
175 | (search-input-file inputs "bin/echo"))))) | |
176 | (add-after 'post-install 'install-plugins | |
177 | (lambda _ | |
178 | (with-directory-excursion "plugin-factory" | |
179 | (invoke "make" "install")))) | |
180 | (add-before 'install 'dont-install-to-/var | |
181 | (lambda _ | |
182 | (substitute* "gozilla/Makefile" | |
183 | (("DESTDIR\\)\\$\\{localstatedir\\}") | |
184 | "TMPDIR)")))) | |
185 | (add-after 'install-plugins 'wrap-program | |
186 | (lambda _ | |
187 | (wrap-program | |
188 | (string-append #$output | |
189 | "/share/gtags/script/pygments_parser.py") | |
190 | `("GUIX_PYTHONPATH" ":" prefix | |
191 | (,(getenv "GUIX_PYTHONPATH")))))) | |
192 | (add-after 'install 'post-install | |
193 | (lambda _ | |
194 | ;; Install the plugin files in the right place. | |
195 | (let* ((data (string-append #$output "/share/gtags")) | |
196 | (vim (string-append #$output | |
197 | "/share/vim/vimfiles/plugin")) | |
198 | (lisp (string-append #$output "/share/emacs/site-lisp/" | |
199 | #$(package-name this-package) "-" | |
200 | #$(package-version this-package)))) | |
201 | (mkdir-p lisp) | |
202 | (mkdir-p vim) | |
203 | (rename-file (string-append data "/gtags.el") | |
204 | (string-append lisp "/gtags.el")) | |
205 | (rename-file (string-append data "/gtags.vim") | |
206 | (string-append vim "/gtags.vim")) | |
207 | (rename-file (string-append data "/gtags-cscope.vim") | |
208 | (string-append vim "/gtags-cscope.vim")))))))) | |
9526ce9b TGR |
209 | (inputs |
210 | (list bash-minimal ; for wrap-program | |
211 | coreutils | |
212 | universal-ctags | |
213 | libltdl | |
214 | ncurses | |
215 | python-pygments | |
216 | python-wrapper | |
217 | sqlite)) | |
6fd52309 | 218 | (home-page "https://www.gnu.org/software/global/") |
99e64a6e LC |
219 | (synopsis "Cross-environment source code tag system") |
220 | (description | |
254a8819 CL |
221 | "GNU GLOBAL is a source code tagging system that functions in the same |
222 | way across a wide array of environments, such as different text editors, | |
223 | shells and web browsers. The resulting tags are useful for quickly moving | |
224 | around in a large, deeply nested project.") | |
d13586bf | 225 | (license license:gpl3+))) |
99e64a6e | 226 | |
23153c90 LC |
227 | (define-public sloccount |
228 | (package | |
229 | (name "sloccount") | |
230 | (version "2.26") | |
231 | (source (origin | |
232 | (method url-fetch) | |
dda0ada3 | 233 | (uri (string-append "https://dwheeler.com/sloccount/sloccount-" |
23153c90 LC |
234 | version ".tar.gz")) |
235 | (sha256 | |
236 | (base32 | |
237 | "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs")))) | |
238 | (build-system gnu-build-system) | |
239 | (arguments | |
240 | '(#:phases (modify-phases %standard-phases | |
f8503e2b LC |
241 | (delete 'configure) |
242 | (add-before 'build 'make-dotl-files-older | |
23153c90 LC |
243 | (lambda _ |
244 | ;; Make the '.l' files as old as the '.c' | |
245 | ;; files to avoid triggering the rule that | |
246 | ;; requires Flex. | |
247 | (define ref | |
248 | (stat "README")) | |
249 | ||
250 | (for-each (lambda (file) | |
251 | (set-file-time file ref)) | |
252 | (find-files "." "\\.[chl]$")) | |
253 | #t)) | |
f8503e2b | 254 | (add-before 'install 'make-target-directories |
23153c90 LC |
255 | (lambda* (#:key outputs #:allow-other-keys) |
256 | (let ((out (assoc-ref outputs "out"))) | |
257 | (mkdir-p (string-append out "/bin")) | |
258 | (mkdir-p (string-append out | |
259 | "/share/man/man1")) | |
260 | (mkdir-p (string-append out | |
e99b4772 RW |
261 | "/share/doc")) |
262 | #t))) | |
f8503e2b | 263 | (replace 'check |
23153c90 LC |
264 | (lambda _ |
265 | (setenv "HOME" (getcwd)) | |
266 | (setenv "PATH" | |
267 | (string-append (getcwd) ":" | |
268 | (getenv "PATH"))) | |
e99b4772 | 269 | (invoke "make" "test")))) |
23153c90 LC |
270 | |
271 | #:make-flags (list (string-append "PREFIX=" | |
272 | (assoc-ref %outputs "out"))))) | |
8394619b | 273 | (inputs (list perl)) |
dda0ada3 | 274 | (home-page "https://dwheeler.com/sloccount/") |
23153c90 LC |
275 | (synopsis "Count physical source lines of code (SLOC)") |
276 | (description | |
277 | "SLOCCount is a set of the programs for counting source lines of | |
278 | code (SLOC) in large software systems. It can automatically identify and | |
279 | measure a wide range of programming languages. It automatically estimates the | |
280 | effort, time, and money it would take to develop the software, using the | |
281 | COCOMO model or user-provided parameters.") | |
d13586bf TČ |
282 | (license license:gpl2+))) |
283 | ||
f7fc9667 AW |
284 | (define-public cloc |
285 | (package | |
286 | (name "cloc") | |
e915b6a1 | 287 | (version "1.92") |
f7fc9667 AW |
288 | (source |
289 | (origin | |
38878020 TGR |
290 | (method git-fetch) |
291 | (uri (git-reference | |
b0e7b699 | 292 | (url "https://github.com/AlDanial/cloc") |
aa74d37b | 293 | (commit (string-append "v" version)))) |
38878020 | 294 | (file-name (git-file-name name version)) |
f7fc9667 | 295 | (sha256 |
e915b6a1 | 296 | (base32 "1hy1hskiw02b7xaxn2qz0v7znj14l49w1anx20z6rkcps7212l5l")))) |
f7fc9667 AW |
297 | (build-system gnu-build-system) |
298 | (inputs | |
8394619b LC |
299 | (list coreutils |
300 | perl | |
301 | perl-algorithm-diff | |
302 | perl-digest-md5 | |
303 | perl-parallel-forkmanager | |
304 | perl-regexp-common)) | |
f7fc9667 AW |
305 | (arguments |
306 | `(#:phases (modify-phases %standard-phases | |
295fc415 TGR |
307 | (delete 'configure) ; nothing to configure |
308 | (delete 'build) ; nothing to build | |
f7fc9667 AW |
309 | (replace 'install |
310 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
311 | (let* ((out (assoc-ref outputs "out"))) | |
53244d1f TGR |
312 | (invoke "make" "-C" "Unix" |
313 | (string-append "prefix=" out) | |
314 | (string-append "INSTALL=" | |
315 | (assoc-ref inputs "coreutils") | |
316 | "/bin/install") | |
e915b6a1 | 317 | "install")))) |
f7fc9667 AW |
318 | (add-after 'install 'wrap-program |
319 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
320 | (let ((out (assoc-ref outputs "out"))) | |
321 | (wrap-program (string-append out "/bin/cloc") | |
322 | `("PERL5LIB" ":" = | |
e915b6a1 | 323 | ,(string-split (getenv "PERL5LIB") #\:))))))) |
f7fc9667 AW |
324 | #:out-of-source? #t |
325 | ;; Tests require some other packages. | |
326 | #:tests? #f)) | |
327 | (home-page "https://github.com/AlDanial/cloc") | |
328 | (synopsis "Count source lines of code (SLOC) and other source code metrics") | |
329 | (description "cloc counts blank lines, comment lines, and physical lines | |
330 | of source code in many programming languages. Given two versions of a code | |
331 | base, cloc can compute differences in blank, comment, and source lines. | |
332 | ||
333 | cloc contains code from David Wheeler's SLOCCount. Compared to SLOCCount, | |
e0f49664 | 334 | cloc can handle a greater variety of programming languages.") |
f7fc9667 AW |
335 | (license license:gpl2+))) |
336 | ||
d13586bf TČ |
337 | (define-public the-silver-searcher |
338 | (package | |
339 | (name "the-silver-searcher") | |
ffa82227 | 340 | (version "2.2.0") |
d13586bf TČ |
341 | (source (origin |
342 | (method url-fetch) | |
343 | (uri (string-append | |
422a6cd4 | 344 | "https://geoff.greer.fm/ag/releases/the_silver_searcher-" |
d13586bf TČ |
345 | version ".tar.gz")) |
346 | (sha256 | |
347 | (base32 | |
ffa82227 | 348 | "0w1icjqd8hd45rn1y6nbfznk1a6ip54whwbfbhxp7ws2hn3ilqnr")))) |
d13586bf | 349 | (build-system gnu-build-system) |
f91097c5 MO |
350 | (arguments |
351 | ;; Required since GCC 10, see: | |
352 | ;; https://gcc.gnu.org/gcc-10/porting_to.html. | |
353 | `(#:configure-flags (list "CFLAGS=-fcommon"))) | |
d13586bf | 354 | (native-inputs |
8394619b | 355 | (list pkg-config)) |
d13586bf | 356 | (inputs |
8394619b | 357 | (list pcre xz zlib)) |
422a6cd4 | 358 | (home-page "https://geoff.greer.fm/ag/") |
d13586bf TČ |
359 | (synopsis "Fast code searching tool") |
360 | (description | |
6acff0f9 TGR |
361 | "The Silver Searcher (@command{ag}) is a tool for quickly searching large |
362 | numbers of files. It's intended primarily for source code repositories, and | |
363 | respects files like @file{.gitignore} and @file{.hgignore}. It's also an order | |
364 | of magnitude faster than its inspiration, @command{ack}, and less specialised | |
365 | tools such as @command{grep}.") | |
d13586bf | 366 | (license license:asl2.0))) |
76e14638 | 367 | |
a4e6356e RW |
368 | (define-public trio |
369 | (package | |
370 | (name "trio") | |
371 | (version "1.16") | |
372 | (source (origin | |
373 | (method url-fetch) | |
374 | (uri (string-append "mirror://sourceforge/ctrio/trio/trio-" | |
375 | version ".tar.gz")) | |
376 | (sha256 | |
377 | (base32 | |
378 | "02pwd5m5vq7hbrffgm2na1dfc249z50yyr5jv73vdw15bd7ygl44")))) | |
379 | (build-system gnu-build-system) | |
e819fc02 | 380 | (home-page "https://daniel.haxx.se/projects/trio/") |
a4e6356e RW |
381 | (synopsis "Portable and extendable printf and string functions") |
382 | (description | |
383 | "Trio is a set of @code{printf} and string functions designed be used by | |
384 | applications with a focus on portability or with the need for additional | |
385 | features that are not supported by the standard @code{stdio} implementation.") | |
386 | ;; This license is very similar to the ISC license, but the wording is | |
387 | ;; slightly different. | |
388 | (license (license:non-copyleft | |
389 | "http://sourceforge.net/p/ctrio/git/ci/master/tree/README")))) | |
390 | ||
58056d5b | 391 | (define-public universal-ctags |
0658cc83 MB |
392 | (package |
393 | (name "universal-ctags") | |
317be8c8 | 394 | (version "5.9.20220807.0") |
0658cc83 MB |
395 | (source |
396 | (origin | |
397 | (method git-fetch) | |
398 | (uri (git-reference | |
399 | (url "https://github.com/universal-ctags/ctags") | |
400 | (commit (string-append "p" version)))) | |
401 | (file-name (git-file-name name version)) | |
402 | (sha256 | |
403 | (base32 | |
317be8c8 | 404 | "1wjj6hlda7xyjm8yrl2zz74ks7azymm9yyrpz36zxxpx2scf6lsk")) |
0658cc83 MB |
405 | (modules '((guix build utils))) |
406 | (snippet | |
407 | '(begin | |
408 | ;; Remove the bundled PackCC and associated build rules. | |
409 | (substitute* "Makefile.am" | |
6ee590ec | 410 | (("^PACKCC = .*") |
e1383bfa | 411 | "PACKCC = packcc\n") |
6ee590ec MB |
412 | (("\\$\\(PACKCC_FILES\\)") |
413 | "") | |
414 | (("\\$\\(PEG_SRCS\\) \\$\\(PEG_HEADS\\): \\$\\(PACKCC\\)") | |
415 | "$(PEG_SRCS) $(PEG_HEADS):")) | |
416 | (delete-file-recursively "misc/packcc"))))) | |
0658cc83 MB |
417 | (build-system gnu-build-system) |
418 | (arguments | |
f8eaeea8 MB |
419 | '(;; Don't use the build-time TMPDIR (/tmp/guix-build-...) at runtime. |
420 | #:configure-flags '("--enable-tmpdir=/tmp") | |
6ee590ec | 421 | #:test-target "units" |
f8eaeea8 | 422 | #:phases (modify-phases %standard-phases |
0658cc83 MB |
423 | (add-after 'unpack 'make-files-writable |
424 | (lambda _ | |
6ee590ec MB |
425 | (for-each make-file-writable (find-files ".")))) |
426 | (add-before 'bootstrap 'patch-misc | |
0658cc83 | 427 | (lambda _ |
6ee590ec MB |
428 | ;; The autogen.sh script calls out to these scripts, so |
429 | ;; we cannot wait for the patch-source-shebangs phase. | |
430 | (for-each patch-shebang (find-files "misc")))) | |
0658cc83 MB |
431 | (add-before 'check 'patch-tests |
432 | (lambda _ | |
433 | (substitute* "misc/units" | |
434 | (("SHELL=/bin/sh") | |
435 | (string-append "SHELL=" (which "sh")))) | |
436 | (substitute* "Tmain/utils.sh" | |
6ee590ec | 437 | (("/bin/echo") (which "echo")))))))) |
0658cc83 | 438 | (native-inputs |
8394619b | 439 | (list autoconf automake packcc perl pkg-config)) |
0658cc83 | 440 | (inputs |
e1383bfa | 441 | (list jansson libseccomp libxml2 libyaml pcre2)) |
0658cc83 MB |
442 | (home-page "https://ctags.io/") |
443 | (synopsis "Generate tag files for source code") | |
444 | (description | |
445 | "Universal Ctags generates an index (or tag) file of language objects | |
58056d5b MB |
446 | found in source files for many popular programming languages. This index |
447 | makes it easy for text editors and other tools to locate the indexed items. | |
448 | Universal Ctags improves on traditional ctags because of its multilanguage | |
449 | support, its ability for the user to define new languages searched by regular | |
450 | expressions, and its ability to generate emacs-style TAGS files.") | |
0658cc83 | 451 | (license license:gpl2+))) |
58056d5b | 452 | |
76e14638 RW |
453 | (define-public withershins |
454 | (package | |
455 | (name "withershins") | |
456 | (version "0.1") | |
3dd14ea7 TGR |
457 | (source |
458 | (origin | |
459 | (method git-fetch) | |
460 | (uri (git-reference | |
b0e7b699 | 461 | (url "https://github.com/cameronwhite/withershins") |
3dd14ea7 TGR |
462 | (commit (string-append "v" version)))) |
463 | (file-name (git-file-name name version)) | |
464 | (sha256 | |
465 | (base32 "1cviqvbbcwljm1zx12j6511hazr3kscwrvcyifrkfi4fpy5z985m")))) | |
76e14638 RW |
466 | (build-system cmake-build-system) |
467 | (arguments | |
468 | `(#:out-of-source? #f | |
66c2df9e TGR |
469 | #:configure-flags |
470 | ;; XXX A (justified!) misleading-indentation error breaks the build. | |
471 | (list "-DENABLE_WERROR=OFF") | |
76e14638 RW |
472 | #:phases |
473 | (modify-phases %standard-phases | |
474 | (add-after | |
475 | 'unpack 'find-libiberty | |
476 | (lambda _ | |
25734108 | 477 | (let ((libiberty (assoc-ref %build-inputs "libiberty"))) |
76e14638 | 478 | (substitute* "cmake/FindIberty.cmake" |
25734108 RW |
479 | (("/usr/include") (string-append libiberty "/include")) |
480 | (("libiberty.a iberty") | |
481 | (string-append "NAMES libiberty.a iberty\nPATHS \"" | |
482 | libiberty "/lib" "\""))) | |
76e14638 RW |
483 | #t))) |
484 | (replace | |
485 | 'install | |
486 | (lambda* (#:key outputs #:allow-other-keys) | |
f3860753 TGR |
487 | (let* ((out (assoc-ref outputs "out")) |
488 | (include (string-append out "/include")) | |
489 | (lib (string-append out "/lib"))) | |
490 | (mkdir-p include) | |
491 | (install-file "src/withershins.hpp" include) | |
492 | (mkdir-p lib) | |
493 | (install-file "src/libwithershins.a" lib)) | |
76e14638 RW |
494 | #t))))) |
495 | (home-page "https://github.com/cameronwhite/withershins") | |
496 | (inputs | |
8394619b LC |
497 | (list libiberty binutils ;for libbfd |
498 | zlib)) | |
76e14638 RW |
499 | (synopsis "C++11 library for generating stack traces") |
500 | (description | |
501 | "Withershins is a simple cross-platform C++11 library for generating | |
502 | stack traces.") | |
503 | ;; Sources are released under Expat license, but since BFD is licensed | |
504 | ;; under the GPLv3+ the combined work is GPLv3+ as well. | |
505 | (license license:gpl3+))) | |
0084aaf3 LC |
506 | |
507 | (define-public lcov | |
adbcc3ed TGR |
508 | (package |
509 | (name "lcov") | |
510 | (version "1.15") | |
511 | (source | |
512 | (origin | |
513 | (method url-fetch) | |
514 | (uri (string-append "https://github.com/linux-test-project/lcov" | |
515 | "/releases/download/v" version | |
516 | "/lcov-" version ".tar.gz")) | |
517 | (sha256 | |
518 | (base32 "0fh5z0q5wg2jxr2nn5w7321y0zg9rwk75j3k5hnamjdy6gxa5kf1")))) | |
519 | (build-system gnu-build-system) | |
520 | (arguments | |
521 | '(#:test-target "test" | |
522 | #:make-flags (list (string-append "PREFIX=" | |
523 | (assoc-ref %outputs "out"))) | |
524 | #:phases | |
525 | (modify-phases %standard-phases | |
526 | (add-after 'unpack 'patch-pwd | |
527 | ;; Lift the requirement of having a shell in PATH. | |
528 | (lambda _ | |
529 | (substitute* "bin/geninfo" | |
530 | (("qw/abs_path/") | |
531 | "qw/abs_path getcwd/")) | |
532 | (substitute* '("bin/lcov" "bin/geninfo") | |
533 | (("`pwd`") | |
534 | "getcwd()")) | |
535 | #t)) | |
536 | (delete 'configure) ;no configure script | |
537 | (add-after 'install 'wrap | |
538 | (lambda* (#:key outputs #:allow-other-keys) | |
539 | (let ((out (assoc-ref outputs "out"))) | |
540 | (wrap-program (string-append out "/bin/geninfo") | |
541 | `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))) | |
542 | #t))))) | |
8394619b | 543 | (inputs (list perl perl-io-compress perl-json)) |
adbcc3ed TGR |
544 | (home-page "http://ltp.sourceforge.net/coverage/lcov.php") |
545 | (synopsis "Code coverage tool that enhances GNU gcov") | |
546 | (description "LCOV is an extension of @command{gcov}, a tool part of the | |
0084aaf3 LC |
547 | GNU@tie{}Binutils, which provides information about what parts of a program |
548 | are actually executed (i.e., \"covered\") while running a particular test | |
549 | case. The extension consists of a set of Perl scripts which build on the | |
550 | textual @command{gcov} output to implement the following enhanced | |
551 | functionality such as HTML output.") | |
adbcc3ed | 552 | (license license:gpl2+))) |
4b3070f7 | 553 | |
830ea727 LC |
554 | (define-public lcov-cobertura |
555 | (package | |
556 | (name "python-lcov-cobertura") | |
557 | (version "1.6") | |
558 | (source | |
559 | (origin | |
560 | (method url-fetch) | |
561 | (uri (pypi-uri "lcov_cobertura" version)) | |
562 | (sha256 | |
563 | (base32 | |
564 | "02ar6yjazlxq4p64cz9gag08bvakmzjrp147jara9wlnlbc96j8g")))) | |
565 | (build-system python-build-system) | |
566 | (home-page "https://eriwen.github.io/lcov-to-cobertura-xml/") | |
567 | (synopsis "LCOV to Cobertura XML converter") | |
568 | (description | |
569 | "The lcov-to-cobertura Python module converts code coverage report files | |
570 | in the lcov format to the XML format of | |
571 | @uref{http://cobertura.github.io/cobertura/, Cobertura}, a Java code coverage | |
572 | tool. It allows continuous integration servers like Jenkins to aggregate | |
573 | results and determine build stability.") | |
574 | (license license:asl2.0))) | |
575 | ||
89c9e647 JL |
576 | (define-public kcov |
577 | (package | |
578 | (name "kcov") | |
b834f73b | 579 | (version "40") |
89c9e647 JL |
580 | (source (origin |
581 | (method git-fetch) | |
582 | (uri (git-reference | |
583 | (url "https://github.com/SimonKagstrom/kcov") | |
1e4b2d8e | 584 | (commit (string-append "v" version)))) |
89c9e647 JL |
585 | (file-name (git-file-name name version)) |
586 | (sha256 | |
587 | (base32 | |
b834f73b | 588 | "0zayhmx6s377bxmkmvl9d9vjzfbpvh1k9ba6np4zdjvjjq327xag")))) |
89c9e647 JL |
589 | (build-system cmake-build-system) |
590 | (arguments | |
1e4b2d8e | 591 | `(#:tests? #f ; no test target |
89c9e647 JL |
592 | #:phases |
593 | (modify-phases %standard-phases | |
594 | (add-after 'unpack 'fix-/bin/bash-references | |
c6e99f78 TGR |
595 | (lambda* (#:key inputs #:allow-other-keys) |
596 | (let ((bash (assoc-ref inputs "bash"))) | |
89c9e647 | 597 | (substitute* (find-files "src" ".*\\.cc?$") |
c6e99f78 TGR |
598 | (("/bin/(bash|sh)" shell) |
599 | (string-append (assoc-ref inputs "bash") shell))))))))) | |
89c9e647 | 600 | (inputs |
8394619b | 601 | (list curl elfutils libelf openssl zlib)) |
89c9e647 | 602 | (native-inputs |
8394619b | 603 | (list python)) |
89c9e647 JL |
604 | (home-page "https://github.com/SimonKagstrom/kcov") |
605 | (synopsis "Code coverage tester for compiled languages, Python and Bash") | |
0225e5a4 TGR |
606 | (description "Kcov is a code coverage tester for compiled languages, |
607 | Python and Bash. It was originally a fork of Bcov, but has since evolved to | |
608 | support a large feature set in addition to that of Bcov. | |
89c9e647 JL |
609 | |
610 | Kcov uses DWARF debugging information for compiled programs to make it | |
611 | possible to collect coverage information without special compiler switches.") | |
612 | (license license:gpl2+))) | |
613 | ||
4b3070f7 FT |
614 | (define-public rtags |
615 | (package | |
616 | (name "rtags") | |
af147cdd | 617 | (version "2.18") |
457fc22d FT |
618 | (source |
619 | (origin | |
84ae0e29 TGR |
620 | (method git-fetch) |
621 | (uri (git-reference | |
b0e7b699 | 622 | (url "https://github.com/Andersbakken/rtags") |
84ae0e29 TGR |
623 | (commit (string-append "v" version)))) |
624 | (file-name (git-file-name name version)) | |
457fc22d FT |
625 | (patches (search-patches "rtags-separate-rct.patch")) |
626 | (modules '((guix build utils))) | |
627 | (snippet | |
628 | ;; Part of spliting rct with rtags. | |
629 | ;; Substitute #include "rct/header.h" with #include <rct/header.h>. | |
630 | '(with-directory-excursion "src" | |
631 | (delete-file-recursively "rct") ;remove bundled copy | |
632 | (let ((files (find-files "." ".*\\.cpp|.*\\.h"))) | |
633 | (substitute* files | |
634 | (("#include ?\"rct/(.*.h)\"" all header) | |
6cbee49d MW |
635 | (string-append "#include <rct/" header ">"))) |
636 | #t))) | |
457fc22d FT |
637 | (sha256 |
638 | (base32 | |
84ae0e29 | 639 | "0raqjbkl1ykga4ahgl9xw49cgh3cyqcf42z36z7d6fz1fw192kg0")))) |
4b3070f7 FT |
640 | (build-system cmake-build-system) |
641 | (arguments | |
3def739d TGR |
642 | '(#:build-type "RelWithDebInfo" |
643 | #:configure-flags | |
457fc22d | 644 | '("-DRTAGS_NO_ELISP_FILES=1" |
457fc22d | 645 | "-DBUILD_TESTING=FALSE") |
4b3070f7 | 646 | #:tests? #f)) |
457fc22d | 647 | (native-inputs |
8394619b | 648 | (list pkg-config)) |
4b3070f7 | 649 | (inputs |
8394619b LC |
650 | (list bash-completion |
651 | clang | |
652 | llvm | |
653 | lua | |
654 | rct | |
655 | selene)) | |
84ae0e29 | 656 | (home-page "https://github.com/Andersbakken/rtags") |
4b3070f7 FT |
657 | (synopsis "Indexer for the C language family with Emacs integration") |
658 | (description | |
659 | "RTags is a client/server application that indexes C/C++ code and keeps a | |
660 | persistent file-based database of references, declarations, definitions, | |
661 | symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you | |
662 | to find symbols by name (including nested class and namespace scope). Most | |
663 | importantly we give you proper follow-symbol and find-references support.") | |
664 | (license license:gpl3+))) | |
dc993847 OP |
665 | |
666 | (define-public colormake | |
667 | (package | |
668 | (name "colormake") | |
669 | (version "0.9.20140503") | |
670 | (source | |
671 | (origin | |
213c32e4 TGR |
672 | (method git-fetch) |
673 | (uri (git-reference | |
b0e7b699 | 674 | (url "https://github.com/pagekite/Colormake") |
213c32e4 TGR |
675 | (commit version))) |
676 | (file-name (git-file-name name version)) | |
dc993847 | 677 | (sha256 |
213c32e4 | 678 | (base32 "1f9v5s0viq4yc9iv6701h3pv7j21zz1ckl37lpp9hsnliiizv03p")))) |
dc993847 OP |
679 | (build-system trivial-build-system) |
680 | (native-inputs | |
8394619b | 681 | (list bash perl)) |
dc993847 OP |
682 | (arguments |
683 | `(#:modules ((guix build utils)) | |
684 | #:builder | |
685 | (begin | |
686 | (use-modules (guix build utils)) | |
213c32e4 TGR |
687 | (copy-recursively (assoc-ref %build-inputs "source") "source") |
688 | (chdir "source") | |
dc993847 OP |
689 | (patch-shebang "colormake.pl" |
690 | (list (string-append (assoc-ref %build-inputs "perl") | |
691 | "/bin"))) | |
692 | (let* ((out (assoc-ref %outputs "out")) | |
693 | (bin (string-append out "/bin")) | |
694 | (doc (string-append out "/share/doc")) | |
695 | (install-files (lambda (files directory) | |
696 | (for-each (lambda (file) | |
697 | (install-file file directory)) | |
698 | files)))) | |
699 | (substitute* "colormake" | |
700 | (("colormake\\.pl") (string-append bin "/colormake.pl")) | |
701 | (("/bin/bash") | |
2dffe476 | 702 | (search-input-file %build-inputs "/bin/sh"))) |
dc993847 OP |
703 | (install-file "colormake.1" (string-append doc "/man/man1")) |
704 | (install-files '("AUTHORS" "BUGS" "ChangeLog" "README") doc) | |
705 | (install-files '("colormake" "colormake-short" "clmake" | |
706 | "clmake-short" "colormake.pl") | |
e3cfef22 MW |
707 | bin) |
708 | #t)))) | |
0e564b5e | 709 | (home-page "https://bre.klaki.net/programs/colormake/") |
dc993847 OP |
710 | (synopsis "Wrapper around @command{make} to produce colored output") |
711 | (description "This package provides a wrapper around @command{make} to | |
712 | produce colored output.") | |
713 | (license license:gpl2+))) | |
906dcb20 CB |
714 | |
715 | (define-public makefile2graph | |
716 | (package | |
717 | (name "makefile2graph") | |
718 | (version "1.5.0") | |
104264cd TGR |
719 | (source |
720 | (origin | |
721 | (method git-fetch) | |
722 | (uri (git-reference | |
b0e7b699 | 723 | (url "https://github.com/lindenb/makefile2graph") |
104264cd TGR |
724 | (commit (string-append "v" version)))) |
725 | (file-name (git-file-name name version)) | |
726 | (sha256 | |
727 | (base32 "1gjfk3d8qg3cla7qd2y7r9s03whlfwy83q8k76xfcnqrjjfavdgk")))) | |
906dcb20 CB |
728 | (build-system gnu-build-system) |
729 | (arguments | |
730 | '(#:test-target "test" | |
731 | #:make-flags (list "CC=gcc" (string-append "prefix=" %output)) | |
732 | #:phases | |
733 | (modify-phases %standard-phases | |
734 | (delete 'configure)))) | |
735 | (native-inputs | |
8394619b | 736 | (list graphviz)) |
906dcb20 CB |
737 | (home-page "https://github.com/lindenb/makefile2graph") |
738 | (synopsis "Creates a graph of dependencies from GNU Make") | |
739 | (description | |
740 | "@code{make2graph} creates a graph of dependencies from GNU Make. The | |
741 | output is a graphviz-dot file, a Gexf-XML file or a list of the deepest | |
742 | independent targets.") | |
743 | (license license:expat))) | |
9c4dcfaf PN |
744 | |
745 | (define-public uncrustify | |
746 | (package | |
747 | (name "uncrustify") | |
309935a0 | 748 | (version "0.75.1") |
9c4dcfaf | 749 | (source (origin |
b5944fcb PN |
750 | (method git-fetch) |
751 | (uri (git-reference | |
752 | (url "https://github.com/uncrustify/uncrustify/") | |
753 | (commit (string-append name "-" version)))) | |
754 | (file-name (git-file-name name version)) | |
9c4dcfaf PN |
755 | (sha256 |
756 | (base32 | |
309935a0 | 757 | "1mzzzd4alajjdshbjd2a5mddqcpag8yyss72n09mfpialzyf7g60")))) |
9c4dcfaf PN |
758 | (build-system cmake-build-system) |
759 | (native-inputs | |
460a3897 | 760 | `(("python" ,python-wrapper))) |
9c4dcfaf PN |
761 | (arguments |
762 | `(#:phases | |
763 | (modify-phases %standard-phases | |
764 | (add-after 'unpack 'unpack-etc | |
765 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
766 | ;; Configuration samples are not installed by default. | |
767 | (let* ((output (assoc-ref outputs "out")) | |
768 | (etcdir (string-append output "/etc"))) | |
769 | (for-each (lambda (l) | |
770 | (install-file l etcdir)) | |
771 | (find-files "etc" "\\.cfg$"))) | |
772 | #t))))) | |
773 | (home-page "http://uncrustify.sourceforge.net/") | |
774 | (synopsis "Code formatter for C and other related languages") | |
775 | (description | |
776 | "Beautify source code in many languages of the C family (C, C++, C#, | |
777 | Objective@tie{}C, D, Java, Pawn, and Vala). Features: | |
778 | @itemize | |
779 | @item Indent and align code. | |
780 | @item Reformat comments (a little bit). | |
781 | @item Fix inter-character spacing. | |
782 | @item Add or remove parens / braces. | |
783 | @item Supports embedded SQL @code{EXEC SQL} stuff. | |
784 | @item Highly configurable - More than 600 configurable options. | |
785 | @end itemize\n") | |
786 | (license license:gpl2+))) | |
c1e5109b LC |
787 | |
788 | (define-public astyle | |
789 | (package | |
790 | (name "astyle") | |
4bfd8579 | 791 | (version "3.1") |
c1e5109b LC |
792 | (source |
793 | (origin | |
794 | (method url-fetch) | |
795 | (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20" | |
796 | version "/astyle_" version "_linux.tar.gz")) | |
797 | (sha256 | |
798 | (base32 | |
4bfd8579 | 799 | "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b")))) |
c1e5109b LC |
800 | (build-system gnu-build-system) |
801 | (arguments | |
802 | `(#:tests? #f ;no tests | |
803 | #:make-flags (list (string-append "prefix=" %output) | |
804 | "INSTALL=install" | |
805 | "all") | |
62b8ae1a HG |
806 | #:modules ((guix build gnu-build-system) ;; FIXME use %default-modules |
807 | (guix build utils) | |
808 | (ice-9 regex)) | |
c1e5109b LC |
809 | #:phases |
810 | (modify-phases %standard-phases | |
811 | (replace 'configure | |
812 | (lambda _ (chdir "build/gcc") #t)) | |
813 | (add-after 'install 'install-libs | |
814 | (lambda* (#:key outputs #:allow-other-keys) | |
0c6ab522 | 815 | ;; Libraries and includes are not installed by default |
c1e5109b | 816 | (let* ((output (assoc-ref outputs "out")) |
0c6ab522 | 817 | (incdir (string-append output "/include")) |
c1e5109b | 818 | (libdir (string-append output "/lib"))) |
62b8ae1a HG |
819 | (define (make-so-link sofile strip-pattern) |
820 | (symlink | |
821 | (basename sofile) | |
822 | (regexp-substitute #f | |
823 | (string-match strip-pattern sofile) | |
824 | 'pre))) | |
0c6ab522 HG |
825 | (mkdir-p incdir) |
826 | (copy-file "../../src/astyle.h" | |
827 | (string-append incdir "/astyle.h")) | |
62b8ae1a HG |
828 | (mkdir-p libdir) |
829 | (for-each (lambda (l) | |
830 | (copy-file | |
831 | l (string-append libdir "/" (basename l)))) | |
832 | (find-files "bin" "lib*")) | |
833 | (for-each | |
834 | (lambda (sofile) | |
835 | (make-so-link sofile "(\\.[0-9]){3}$") ;; link .so | |
836 | (make-so-link sofile "(\\.[0-9]){2}$")) ;; link .so.3 | |
837 | (find-files libdir "lib.*\\.so\\..*"))) | |
c1e5109b LC |
838 | #t))))) |
839 | (home-page "http://astyle.sourceforge.net/") | |
840 | (synopsis "Source code indenter, formatter, and beautifier") | |
841 | (description | |
842 | "Artistic Style is a source code indenter, formatter, and beautifier for | |
843 | the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.") | |
844 | (license license:lgpl3+))) | |
e470abf8 LC |
845 | |
846 | (define-public indent | |
847 | (package | |
848 | (name "indent") | |
7fe6dcf7 | 849 | (version "2.2.12") |
e470abf8 LC |
850 | (source (origin |
851 | (method url-fetch) | |
852 | (uri (string-append "mirror://gnu/indent/indent-" version | |
853 | ".tar.gz")) | |
7fe6dcf7 MB |
854 | (sha256 |
855 | (base32 "12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7")))) | |
e470abf8 LC |
856 | (build-system gnu-build-system) |
857 | (arguments | |
9d10a634 MW |
858 | `(#:phases |
859 | (modify-phases %standard-phases | |
860 | (add-after 'unpack 'fix-docdir | |
861 | (lambda _ | |
862 | ;; Although indent uses a modern autoconf in which docdir | |
863 | ;; defaults to PREFIX/share/doc, the doc/Makefile.am | |
864 | ;; overrides this to be in PREFIX/doc. Fix this. | |
865 | (substitute* "doc/Makefile.in" | |
866 | (("^docdir = .*$") "docdir = @docdir@\n")) | |
59bd4b90 MO |
867 | #t)) |
868 | (add-after 'unpack 'fix-configure | |
869 | (lambda* (#:key inputs native-inputs #:allow-other-keys) | |
870 | ;; Replace outdated config.sub and config.guess: | |
871 | (with-directory-excursion "config" | |
872 | (for-each (lambda (file) | |
873 | (install-file | |
874 | (string-append (assoc-ref | |
875 | (or native-inputs inputs) "automake") | |
876 | "/share/automake-" | |
877 | ,(version-major+minor | |
878 | (package-version automake)) | |
879 | "/" file) ".")) | |
880 | '("config.sub" "config.guess"))) | |
9d10a634 | 881 | #t))))) |
7fe6dcf7 | 882 | (native-inputs |
8394619b | 883 | (list texinfo automake)) ; For up to date 'config.guess' and 'config.sub'. |
e470abf8 LC |
884 | (synopsis "Code reformatter") |
885 | (description | |
886 | "Indent is a program that makes source code easier to read by | |
887 | reformatting it in a consistent style. It can change the style to one of | |
888 | several different styles such as GNU, BSD or K&R. It has some flexibility to | |
889 | deal with incomplete or malformed syntax. GNU indent offers several | |
890 | extensions over the standard utility.") | |
891 | (license license:gpl3+) | |
892 | (home-page "https://www.gnu.org/software/indent/"))) | |
ad8a4d6d FT |
893 | |
894 | (define-public amalgamate | |
895 | (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208") | |
896 | (revision "0") | |
897 | (version (git-version "1.1.1" revision commit))) | |
898 | (package | |
899 | (name "amalgamate") | |
900 | (version version) | |
901 | (home-page "https://github.com/edlund/amalgamate") | |
902 | (source | |
903 | (origin | |
904 | (method git-fetch) | |
905 | (uri (git-reference | |
906 | (url home-page) | |
907 | (commit commit))) | |
908 | (sha256 | |
909 | (base32 | |
910 | "0cllaraw8mxs8q2nr28nhgzkb417gj2wcklqg59w84f4lc78k3yb")) | |
911 | (file-name (git-file-name name version)) | |
912 | (modules '((guix build utils))) | |
913 | (snippet | |
914 | '(substitute* "test.sh" | |
915 | (("test_command \"cc -Wall -Wextra -o source.out source.c\"" all) | |
916 | "test_command \"gcc -Wall -Wextra -o source.out source.c\""))))) | |
917 | (build-system gnu-build-system) | |
aec302e0 | 918 | (inputs (list python-wrapper)) |
ad8a4d6d FT |
919 | (arguments |
920 | `(#:phases | |
921 | (modify-phases %standard-phases | |
922 | (delete 'configure) | |
923 | (delete 'build) | |
924 | (replace 'install | |
925 | (lambda* (#:key outputs #:allow-other-keys) | |
926 | (let* ((out (assoc-ref outputs "out")) | |
927 | (bin (string-append out "/bin"))) | |
928 | (install-file "amalgamate.py" bin)))) | |
929 | (replace 'check | |
930 | (lambda _ | |
931 | (invoke "./test.sh")))))) | |
932 | (synopsis "Tool for amalgamating C source and header files") | |
933 | ;; The package is indeed a script file, and the term "amalgamate.py" is | |
934 | ;; used by upstream. | |
935 | (description "amalgamate.py aims to make it easy to use SQLite-style C | |
936 | source and header amalgamation in projects.") | |
937 | (license license:bsd-3)))) | |
393315a9 | 938 | |
a0adb5f4 FCW |
939 | (define-public cdecl |
940 | (package | |
941 | (name "cdecl") | |
942 | (version "2.5") | |
943 | (source | |
944 | (origin | |
945 | (method url-fetch) | |
946 | (uri (string-append "https://www.ibiblio.org/pub/linux/devel/lang/c/cdecl-" | |
947 | version ".tar.gz")) | |
948 | (sha256 | |
949 | (base32 "0dm98bp186r4cihli6fmcwzjaadgwl1z3b0zdxfik8h7hkqawk5p")))) | |
950 | (build-system gnu-build-system) | |
951 | (arguments | |
952 | `(#:make-flags | |
953 | ,#~(list "LIBS=-lreadline" | |
954 | (string-append "BINDIR=" #$output "/bin") | |
955 | (string-append "MANDIR=" #$output "/share/man/man1")) | |
956 | #:phases | |
957 | (modify-phases %standard-phases | |
958 | (delete 'configure) ; No configure script. | |
959 | (add-after 'unpack 'fix-build | |
960 | (lambda _ | |
961 | (substitute* "Makefile" | |
962 | (("lex cdlex.l") | |
963 | "flex cdlex.l")) | |
964 | (substitute* "cdecl.c" | |
965 | ;; Fix "error: conflicting types for ‘getline’". | |
966 | (("char \\* getline\\(\\)") | |
967 | "char * our_getline(void)") | |
968 | (("char \\* getline \\(\\)") | |
969 | "char * our_getline(void)") | |
970 | (("line = getline\\(\\)") | |
971 | "line = our_getline()") | |
972 | ;; Fix "error: conflicting types for ‘getopt’". | |
973 | (("int getopt\\(int,char \\*\\*,char \\*\\);") | |
974 | "") | |
975 | ;; Fix invalid use of "restrict" as a variable name. | |
976 | (("i, j, restrict") | |
977 | "i, j, restriction") | |
978 | (("restrict =") | |
979 | "restriction =") | |
980 | ;; Fix "warning: implicit declaration of function ‘add_history’". | |
981 | (("# include <readline/readline.h>" all) | |
982 | (string-append all "\n# include <readline/history.h>")) | |
983 | ;; Fix "warning: implicit declaration of function ‘dotmpfile_from_string’". | |
984 | (("void setprogname\\(char \\*\\);" all) | |
985 | (string-append all "\nint dotmpfile_from_string(char *);")) | |
986 | ;; Fix "warning: implicit declaration of function ‘completion_matches’". | |
987 | (("matches = completion_matches\\(text, command_completion\\);") | |
988 | "matches = rl_completion_matches(text, command_completion);") | |
989 | (("char \\* command_completion\\(char \\*, int\\);") | |
990 | "char * command_completion(const char *, int);") | |
991 | (("char \\* command_completion\\(char \\*text, int flag\\)") | |
992 | "char * command_completion(const char *text, int flag)") | |
993 | ;; Fix "warning: ‘CPPFunction’ is deprecated". | |
994 | (("rl_attempted_completion_function = \\(CPPFunction \\*\\)attempt_completion;") | |
995 | "rl_attempted_completion_function = (rl_completion_func_t *)attempt_completion;") | |
996 | ;; Fix "warning: ‘Function’ is deprecated". | |
997 | (("rl_completion_entry_function = \\(Function \\*\\)keyword_completion;") | |
998 | "rl_completion_entry_function = (rl_compentry_func_t *)keyword_completion;")) | |
999 | ;; Fix typo in man page. | |
1000 | (substitute* "cdecl.1" | |
1001 | (("<storage>\t::= auto \\| extern \\| register \\| auto") | |
1002 | "<storage>\t::= auto | extern | register | static")))) | |
1003 | (add-before 'install 'create-directories | |
1004 | (lambda* (#:key outputs #:allow-other-keys) | |
1005 | (let* ((out (assoc-ref outputs "out")) | |
1006 | (bin (string-append out "/bin")) | |
1007 | (man (string-append out "/share/man/man1"))) | |
1008 | (mkdir-p bin) | |
1009 | (mkdir-p man))))) | |
1010 | #:tests? #f)) ; No "check" target. | |
1011 | (native-inputs (list bison flex)) | |
1012 | (inputs (list readline)) | |
1013 | (home-page "https://www.ibiblio.org/pub/linux/devel/lang/c/") | |
1014 | (synopsis "Turn English phrases into C or C++ declarations and vice versa") | |
1015 | (description "@code{cdecl} is a program that turns English-like phrases into C | |
1016 | declarations. It can also translate C into pseudo-English. It also handles | |
1017 | type casts and C++. It has command-line editing and history with the GNU | |
1018 | Readline library.") | |
1019 | (license license:public-domain))) | |
1020 | ||
393315a9 FCW |
1021 | (define-public cscope |
1022 | (package | |
1023 | (name "cscope") | |
1024 | (version "15.9") | |
1025 | (source | |
1026 | (origin | |
1027 | (method url-fetch) | |
1028 | (uri (string-append "mirror://sourceforge/cscope/cscope/" | |
1029 | "v" version "/cscope-" version ".tar.gz")) | |
1030 | (sha256 | |
1031 | (base32 "0ngiv4aj3rr35k3q3wjx0y19gh7i1ydqa0cqip6sjwd8fph5ll65")))) | |
1032 | (build-system gnu-build-system) | |
8394619b | 1033 | (inputs (list ncurses)) |
393315a9 FCW |
1034 | (arguments |
1035 | `(#:configure-flags | |
1036 | ;; Specify the correct ncurses directory to prevent incorrect fallback | |
1037 | ;; on SysV curses. | |
1038 | (list (string-append "--with-ncurses=" | |
1039 | (assoc-ref %build-inputs "ncurses"))))) | |
1040 | (home-page "http://cscope.sourceforge.net") | |
1041 | (synopsis "Tool for browsing source code") | |
1042 | (description | |
1043 | "Cscope is a text screen based source browsing tool. Although it is | |
1044 | primarily designed to search C code (including lex and yacc files), it can | |
1045 | also be used for C++ code. | |
1046 | ||
1047 | Using cscope, you can easily search for where symbols are used and defined.") | |
1048 | (license license:bsd-3))) | |
86a91543 MC |
1049 | |
1050 | (define-public xenon | |
1051 | (package | |
1052 | (name "xenon") | |
1053 | (version "0.9.0") | |
1054 | (source | |
1055 | (origin | |
1056 | (method url-fetch) | |
1057 | (uri (pypi-uri "xenon" version)) | |
1058 | (sha256 | |
1059 | (base32 | |
1060 | "1f4gynjzfckm3rjfywwgz1c7icfx3zjqirf16aj73xv0c9ncpffj")))) | |
1061 | (build-system python-build-system) | |
1062 | (arguments (list #:tests? #f)) ;test suite not shipped with the PyPI archive | |
1063 | (inputs (list python-pyyaml python-radon python-requests)) | |
1064 | (home-page "https://xenon.readthedocs.org/") | |
1065 | (synopsis "Monitor code metrics for Python on your CI server") | |
1066 | (description | |
1067 | "Xenon is a monitoring tool based on Radon. It monitors code complexity. | |
1068 | Ideally, @code{xenon} is run every time code is committed. Through command | |
1069 | line options, various thresholds can be set for the complexity of code. It | |
d1b60cb6 | 1070 | will fail (i.e., it will exit with a non-zero exit code) when any of these |
86a91543 MC |
1071 | requirements is not met.") |
1072 | (license license:expat))) | |
1073 | ||
1074 | (define-public python-xenon | |
1075 | (deprecated-package "python-xenon" xenon)) |