gnu: Use HTTPS for almost all gnu.org HOME-PAGEs.
[jackhill/guix/guix.git] / gnu / packages / code.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
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)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system cmake)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages databases)
32 #:use-module (gnu packages emacs)
33 #:use-module (gnu packages gcc)
34 #:use-module (gnu packages pcre)
35 #:use-module (gnu packages pkg-config)
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))
41
42 ;;; Tools to deal with source code: metrics, cross-references, etc.
43
44 (define-public cflow
45 (package
46 (name "cflow")
47 (version "1.5")
48 (source (origin
49 (method url-fetch)
50 (uri (string-append "mirror://gnu/cflow/cflow-"
51 version ".tar.bz2"))
52 (sha256
53 (base32
54 "0yq33k5ap1zpnja64n89iai4zh018ffr72wki5a6mzczd880mr3g"))))
55 (build-system gnu-build-system)
56
57 ;; Needed to have cflow-mode.el installed.
58 (native-inputs `(("emacs" ,emacs-minimal)))
59
60 (home-page "https://www.gnu.org/software/cflow/")
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
65 in either the POSIX format or in an extended GNU format. cflow also includes
66 a major mode for Emacs for examining the flowcharts that it produces.")
67 (license license:gpl3+)))
68
69 (define-public complexity
70 (package
71 (name "complexity")
72 (version "1.10")
73 (source (origin
74 (method url-fetch)
75 (uri (string-append "mirror://gnu/complexity/complexity-"
76 version ".tar.xz"))
77 (sha256
78 (base32
79 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
80 (build-system gnu-build-system)
81 (native-inputs
82 `(("texinfo" ,texinfo)
83 ("autogen" ,autogen)))
84 (home-page "https://www.gnu.org/software/complexity/")
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.")
91 (license license:gpl3+)))
92
93 (define-public global ; a global variable
94 (package
95 (name "global")
96 (version "6.5.6")
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "mirror://gnu/global/global-"
100 version ".tar.gz"))
101 (sha256
102 (base32
103 "018m536k5y6lks1a6gqn3bsp7r8zk017znqj9kva1nm8d7x9lbqj"))))
104 (build-system gnu-build-system)
105 (inputs `(("ncurses" ,ncurses)
106 ("libltdl" ,libltdl)
107 ("sqlite" ,sqlite)))
108 (arguments
109 `(#:configure-flags
110 (list (string-append "--with-ncurses="
111 (assoc-ref %build-inputs "ncurses"))
112 (string-append "--with-sqlite3="
113 (assoc-ref %build-inputs "sqlite")))
114
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))))))
126 (home-page "https://www.gnu.org/software/global/")
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.")
133 (license license:gpl3+)))
134
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
149 (delete 'configure)
150 (add-before 'build 'make-dotl-files-older
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))
162 (add-before 'install 'make-target-directories
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")))))
170 (replace 'check
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.")
189 (license license:gpl2+)))
190
191 (define-public the-silver-searcher
192 (package
193 (name "the-silver-searcher")
194 (version "1.0.2")
195 (source (origin
196 (method url-fetch)
197 (uri (string-append
198 "http://geoff.greer.fm/ag/releases/the_silver_searcher-"
199 version ".tar.gz"))
200 (sha256
201 (base32
202 "0v54himv65w294l0k4lhdyc6kvpgijn8b9g5356479fzy7hphjkg"))))
203 (build-system gnu-build-system)
204 (native-inputs
205 `(("pkg-config" ,pkg-config)))
206 (inputs
207 `(("pcre" ,pcre)
208 ("xz" ,xz)
209 ("zlib" ,zlib)))
210 (home-page "http://geoff.greer.fm/ag/")
211 (synopsis "Fast code searching tool")
212 (description
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}.")
218 (license license:asl2.0)))
219
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
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
259 #:phases
260 (modify-phases %standard-phases
261 (add-after
262 'unpack 'find-libiberty
263 (lambda _
264 (let ((libiberty (assoc-ref %build-inputs "libiberty")))
265 (substitute* "cmake/FindIberty.cmake"
266 (("/usr/include") (string-append libiberty "/include"))
267 (("libiberty.a iberty")
268 (string-append "NAMES libiberty.a iberty\nPATHS \""
269 libiberty "/lib" "\"")))
270 #t)))
271 (replace
272 'install
273 (lambda* (#:key outputs #:allow-other-keys)
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))
281 #t)))))
282 (home-page "https://github.com/cameronwhite/withershins")
283 (inputs
284 `(("libiberty" ,libiberty)
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+)))
294
295 (define-public lcov
296 (package
297 (name "lcov")
298 (version "1.12")
299 (source (origin
300 (method url-fetch)
301 (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis"
302 "/LCOV-" version "/lcov-" version ".tar.gz"))
303 (sha256
304 (base32
305 "19wfifdpxxivhq9adbphanjfga9bg9spms9v7c3589wndjff8x5l"))))
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+)))