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