Commit | Line | Data |
---|---|---|
23153c90 | 1 | ;;; GNU Guix --- Functional package management for GNU |
99e64a6e LC |
2 | ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org> |
3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | |
76e14638 | 4 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
94c3a6f1 | 5 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
6acff0f9 | 6 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> |
23153c90 LC |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages code) | |
24 | #:use-module (guix packages) | |
25 | #:use-module (guix download) | |
d13586bf | 26 | #:use-module ((guix licenses) #:prefix license:) |
23153c90 | 27 | #:use-module (guix build-system gnu) |
76e14638 RW |
28 | #:use-module (guix build-system cmake) |
29 | #:use-module (gnu packages base) | |
d13586bf | 30 | #:use-module (gnu packages compression) |
e1ac691d | 31 | #:use-module (gnu packages databases) |
99e64a6e | 32 | #:use-module (gnu packages emacs) |
76e14638 | 33 | #:use-module (gnu packages gcc) |
d13586bf TČ |
34 | #:use-module (gnu packages pcre) |
35 | #:use-module (gnu packages pkg-config) | |
99e64a6e LC |
36 | #:use-module (gnu packages perl) |
37 | #:use-module (gnu packages texinfo) | |
38 | #:use-module (gnu packages autogen) | |
39 | #:use-module (gnu packages ncurses) | |
40 | #:use-module (gnu packages autotools)) | |
23153c90 LC |
41 | |
42 | ;;; Tools to deal with source code: metrics, cross-references, etc. | |
43 | ||
99e64a6e LC |
44 | (define-public cflow |
45 | (package | |
46 | (name "cflow") | |
cb307c08 | 47 | (version "1.5") |
99e64a6e LC |
48 | (source (origin |
49 | (method url-fetch) | |
50 | (uri (string-append "mirror://gnu/cflow/cflow-" | |
51 | version ".tar.bz2")) | |
52 | (sha256 | |
53 | (base32 | |
cb307c08 | 54 | "0yq33k5ap1zpnja64n89iai4zh018ffr72wki5a6mzczd880mr3g")))) |
99e64a6e LC |
55 | (build-system gnu-build-system) |
56 | ||
57 | ;; Needed to have cflow-mode.el installed. | |
b8fc3622 | 58 | (native-inputs `(("emacs" ,emacs-minimal))) |
99e64a6e | 59 | |
6fd52309 | 60 | (home-page "https://www.gnu.org/software/cflow/") |
99e64a6e LC |
61 | (synopsis "Create a graph of control flow within a program") |
62 | (description | |
63 | "GNU cflow analyzes C source files and produces a graph charting the | |
64 | control flow of the program. It can output the graph in several styles and | |
e881752c | 65 | in either the POSIX format or in an extended GNU format. cflow also includes |
99e64a6e | 66 | a major mode for Emacs for examining the flowcharts that it produces.") |
d13586bf | 67 | (license license:gpl3+))) |
99e64a6e LC |
68 | |
69 | (define-public complexity | |
70 | (package | |
71 | (name "complexity") | |
1e42d8b8 | 72 | (version "1.10") |
99e64a6e LC |
73 | (source (origin |
74 | (method url-fetch) | |
75 | (uri (string-append "mirror://gnu/complexity/complexity-" | |
1e42d8b8 | 76 | version ".tar.xz")) |
99e64a6e LC |
77 | (sha256 |
78 | (base32 | |
1e42d8b8 | 79 | "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd")))) |
99e64a6e LC |
80 | (build-system gnu-build-system) |
81 | (native-inputs | |
82 | `(("texinfo" ,texinfo) | |
83 | ("autogen" ,autogen))) | |
6fd52309 | 84 | (home-page "https://www.gnu.org/software/complexity/") |
99e64a6e LC |
85 | (synopsis "Analyze complexity of C functions") |
86 | (description | |
87 | "GNU complexity provides tools for finding procedures that are | |
88 | convoluted, overly long or otherwise difficult to understand. This | |
89 | may help in learning or reviewing unfamiliar code or perhaps | |
90 | highlighting your own code that seemed comprehensible when you wrote it.") | |
d13586bf | 91 | (license license:gpl3+))) |
99e64a6e LC |
92 | |
93 | (define-public global ; a global variable | |
94 | (package | |
95 | (name "global") | |
0b2a91d8 | 96 | (version "6.5.6") |
99e64a6e LC |
97 | (source (origin |
98 | (method url-fetch) | |
99 | (uri (string-append "mirror://gnu/global/global-" | |
100 | version ".tar.gz")) | |
101 | (sha256 | |
102 | (base32 | |
0b2a91d8 | 103 | "018m536k5y6lks1a6gqn3bsp7r8zk017znqj9kva1nm8d7x9lbqj")))) |
99e64a6e LC |
104 | (build-system gnu-build-system) |
105 | (inputs `(("ncurses" ,ncurses) | |
e1ac691d LC |
106 | ("libltdl" ,libltdl) |
107 | ("sqlite" ,sqlite))) | |
99e64a6e LC |
108 | (arguments |
109 | `(#:configure-flags | |
110 | (list (string-append "--with-ncurses=" | |
e1ac691d LC |
111 | (assoc-ref %build-inputs "ncurses")) |
112 | (string-append "--with-sqlite3=" | |
113 | (assoc-ref %build-inputs "sqlite"))) | |
99e64a6e | 114 | |
9d9951d6 EF |
115 | #:phases |
116 | (modify-phases %standard-phases | |
117 | (add-after 'install 'post-install | |
118 | (lambda* (#:key outputs #:allow-other-keys) | |
119 | ;; Install the Emacs Lisp file in the right place. | |
120 | (let* ((out (assoc-ref outputs "out")) | |
121 | (data (string-append out "/share/gtags")) | |
122 | (lisp (string-append out "/share/emacs/site-lisp"))) | |
123 | (install-file (string-append data "/gtags.el") lisp) | |
124 | (delete-file (string-append data "/gtags.el")) | |
125 | #t)))))) | |
6fd52309 | 126 | (home-page "https://www.gnu.org/software/global/") |
99e64a6e LC |
127 | (synopsis "Cross-environment source code tag system") |
128 | (description | |
129 | "GLOBAL is a source code tagging system that functions in the same way | |
130 | across a wide array of environments, such as different text editors, shells | |
131 | and web browsers. The resulting tags are useful for quickly moving around in | |
132 | a large, deeply nested project.") | |
d13586bf | 133 | (license license:gpl3+))) |
99e64a6e | 134 | |
23153c90 LC |
135 | (define-public sloccount |
136 | (package | |
137 | (name "sloccount") | |
138 | (version "2.26") | |
139 | (source (origin | |
140 | (method url-fetch) | |
141 | (uri (string-append "http://www.dwheeler.com/sloccount/sloccount-" | |
142 | version ".tar.gz")) | |
143 | (sha256 | |
144 | (base32 | |
145 | "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs")))) | |
146 | (build-system gnu-build-system) | |
147 | (arguments | |
148 | '(#:phases (modify-phases %standard-phases | |
f8503e2b LC |
149 | (delete 'configure) |
150 | (add-before 'build 'make-dotl-files-older | |
23153c90 LC |
151 | (lambda _ |
152 | ;; Make the '.l' files as old as the '.c' | |
153 | ;; files to avoid triggering the rule that | |
154 | ;; requires Flex. | |
155 | (define ref | |
156 | (stat "README")) | |
157 | ||
158 | (for-each (lambda (file) | |
159 | (set-file-time file ref)) | |
160 | (find-files "." "\\.[chl]$")) | |
161 | #t)) | |
f8503e2b | 162 | (add-before 'install 'make-target-directories |
23153c90 LC |
163 | (lambda* (#:key outputs #:allow-other-keys) |
164 | (let ((out (assoc-ref outputs "out"))) | |
165 | (mkdir-p (string-append out "/bin")) | |
166 | (mkdir-p (string-append out | |
167 | "/share/man/man1")) | |
168 | (mkdir-p (string-append out | |
169 | "/share/doc"))))) | |
f8503e2b | 170 | (replace 'check |
23153c90 LC |
171 | (lambda _ |
172 | (setenv "HOME" (getcwd)) | |
173 | (setenv "PATH" | |
174 | (string-append (getcwd) ":" | |
175 | (getenv "PATH"))) | |
176 | (zero? (system* "make" "test"))))) | |
177 | ||
178 | #:make-flags (list (string-append "PREFIX=" | |
179 | (assoc-ref %outputs "out"))))) | |
180 | (inputs `(("perl" ,perl))) | |
181 | (home-page "http://www.dwheeler.com/sloccount/") | |
182 | (synopsis "Count physical source lines of code (SLOC)") | |
183 | (description | |
184 | "SLOCCount is a set of the programs for counting source lines of | |
185 | code (SLOC) in large software systems. It can automatically identify and | |
186 | measure a wide range of programming languages. It automatically estimates the | |
187 | effort, time, and money it would take to develop the software, using the | |
188 | COCOMO model or user-provided parameters.") | |
d13586bf TČ |
189 | (license license:gpl2+))) |
190 | ||
191 | (define-public the-silver-searcher | |
192 | (package | |
193 | (name "the-silver-searcher") | |
392f3266 | 194 | (version "1.0.2") |
d13586bf TČ |
195 | (source (origin |
196 | (method url-fetch) | |
197 | (uri (string-append | |
392f3266 | 198 | "http://geoff.greer.fm/ag/releases/the_silver_searcher-" |
d13586bf TČ |
199 | version ".tar.gz")) |
200 | (sha256 | |
201 | (base32 | |
392f3266 | 202 | "0v54himv65w294l0k4lhdyc6kvpgijn8b9g5356479fzy7hphjkg")))) |
d13586bf TČ |
203 | (build-system gnu-build-system) |
204 | (native-inputs | |
392f3266 | 205 | `(("pkg-config" ,pkg-config))) |
d13586bf TČ |
206 | (inputs |
207 | `(("pcre" ,pcre) | |
208 | ("xz" ,xz) | |
209 | ("zlib" ,zlib))) | |
d13586bf TČ |
210 | (home-page "http://geoff.greer.fm/ag/") |
211 | (synopsis "Fast code searching tool") | |
212 | (description | |
6acff0f9 TGR |
213 | "The Silver Searcher (@command{ag}) is a tool for quickly searching large |
214 | numbers of files. It's intended primarily for source code repositories, and | |
215 | respects files like @file{.gitignore} and @file{.hgignore}. It's also an order | |
216 | of magnitude faster than its inspiration, @command{ack}, and less specialised | |
217 | tools such as @command{grep}.") | |
d13586bf | 218 | (license license:asl2.0))) |
76e14638 | 219 | |
a4e6356e RW |
220 | (define-public trio |
221 | (package | |
222 | (name "trio") | |
223 | (version "1.16") | |
224 | (source (origin | |
225 | (method url-fetch) | |
226 | (uri (string-append "mirror://sourceforge/ctrio/trio/trio-" | |
227 | version ".tar.gz")) | |
228 | (sha256 | |
229 | (base32 | |
230 | "02pwd5m5vq7hbrffgm2na1dfc249z50yyr5jv73vdw15bd7ygl44")))) | |
231 | (build-system gnu-build-system) | |
232 | (home-page "http://daniel.haxx.se/projects/trio/") | |
233 | (synopsis "Portable and extendable printf and string functions") | |
234 | (description | |
235 | "Trio is a set of @code{printf} and string functions designed be used by | |
236 | applications with a focus on portability or with the need for additional | |
237 | features that are not supported by the standard @code{stdio} implementation.") | |
238 | ;; This license is very similar to the ISC license, but the wording is | |
239 | ;; slightly different. | |
240 | (license (license:non-copyleft | |
241 | "http://sourceforge.net/p/ctrio/git/ci/master/tree/README")))) | |
242 | ||
76e14638 RW |
243 | (define-public withershins |
244 | (package | |
245 | (name "withershins") | |
246 | (version "0.1") | |
247 | (source (origin | |
248 | (method url-fetch) | |
249 | (uri (string-append | |
250 | "https://github.com/cameronwhite/withershins/archive/v" | |
251 | version ".tar.gz")) | |
252 | (file-name (string-append name "-" version ".tar.gz")) | |
253 | (sha256 | |
254 | (base32 | |
255 | "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh")))) | |
256 | (build-system cmake-build-system) | |
257 | (arguments | |
258 | `(#:out-of-source? #f | |
76e14638 RW |
259 | #:phases |
260 | (modify-phases %standard-phases | |
261 | (add-after | |
262 | 'unpack 'find-libiberty | |
263 | (lambda _ | |
25734108 | 264 | (let ((libiberty (assoc-ref %build-inputs "libiberty"))) |
76e14638 | 265 | (substitute* "cmake/FindIberty.cmake" |
25734108 RW |
266 | (("/usr/include") (string-append libiberty "/include")) |
267 | (("libiberty.a iberty") | |
268 | (string-append "NAMES libiberty.a iberty\nPATHS \"" | |
269 | libiberty "/lib" "\""))) | |
76e14638 RW |
270 | #t))) |
271 | (replace | |
272 | 'install | |
273 | (lambda* (#:key outputs #:allow-other-keys) | |
f3860753 TGR |
274 | (let* ((out (assoc-ref outputs "out")) |
275 | (include (string-append out "/include")) | |
276 | (lib (string-append out "/lib"))) | |
277 | (mkdir-p include) | |
278 | (install-file "src/withershins.hpp" include) | |
279 | (mkdir-p lib) | |
280 | (install-file "src/libwithershins.a" lib)) | |
76e14638 RW |
281 | #t))))) |
282 | (home-page "https://github.com/cameronwhite/withershins") | |
283 | (inputs | |
25734108 | 284 | `(("libiberty" ,libiberty) |
76e14638 RW |
285 | ("binutils" ,binutils) ;for libbfd |
286 | ("zlib" ,zlib))) | |
287 | (synopsis "C++11 library for generating stack traces") | |
288 | (description | |
289 | "Withershins is a simple cross-platform C++11 library for generating | |
290 | stack traces.") | |
291 | ;; Sources are released under Expat license, but since BFD is licensed | |
292 | ;; under the GPLv3+ the combined work is GPLv3+ as well. | |
293 | (license license:gpl3+))) | |
0084aaf3 LC |
294 | |
295 | (define-public lcov | |
296 | (package | |
297 | (name "lcov") | |
591f1d3e | 298 | (version "1.12") |
0084aaf3 LC |
299 | (source (origin |
300 | (method url-fetch) | |
de67e922 LF |
301 | (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis" |
302 | "/LCOV-" version "/lcov-" version ".tar.gz")) | |
0084aaf3 LC |
303 | (sha256 |
304 | (base32 | |
591f1d3e | 305 | "19wfifdpxxivhq9adbphanjfga9bg9spms9v7c3589wndjff8x5l")))) |
0084aaf3 LC |
306 | (build-system gnu-build-system) |
307 | (arguments | |
308 | '(#:make-flags (let ((out (assoc-ref %outputs "out"))) | |
309 | (list (string-append "PREFIX=" out) | |
310 | (string-append "BIN_DIR=" out "/bin") | |
311 | (string-append "MAN_DIR=" out "/share/man"))) | |
312 | #:phases (modify-phases %standard-phases | |
313 | (delete 'configure)) | |
314 | #:tests? #f)) ;no 'check' target | |
315 | (inputs `(("perl" ,perl))) | |
316 | (home-page "http://ltp.sourceforge.net/coverage/lcov.php") | |
317 | (synopsis "Code coverage tool that enhances GNU gcov") | |
318 | (description | |
319 | "LCOV is an extension of @command{gcov}, a tool part of the | |
320 | GNU@tie{}Binutils, which provides information about what parts of a program | |
321 | are actually executed (i.e., \"covered\") while running a particular test | |
322 | case. The extension consists of a set of Perl scripts which build on the | |
323 | textual @command{gcov} output to implement the following enhanced | |
324 | functionality such as HTML output.") | |
325 | (license license:gpl2+))) |