build: container: Add #:host-uids argument to call-with-container.
[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>
23153c90
LC
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages code)
22 #:use-module (guix packages)
23 #:use-module (guix download)
d13586bf 24 #:use-module ((guix licenses) #:prefix license:)
23153c90 25 #:use-module (guix build-system gnu)
76e14638
RW
26 #:use-module (guix build-system cmake)
27 #:use-module (gnu packages base)
d13586bf 28 #:use-module (gnu packages compression)
e1ac691d 29 #:use-module (gnu packages databases)
99e64a6e 30 #:use-module (gnu packages emacs)
76e14638 31 #:use-module (gnu packages gcc)
d13586bf
32 #:use-module (gnu packages pcre)
33 #:use-module (gnu packages pkg-config)
99e64a6e
LC
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages texinfo)
36 #:use-module (gnu packages autogen)
37 #:use-module (gnu packages ncurses)
38 #:use-module (gnu packages autotools))
23153c90
LC
39
40;;; Tools to deal with source code: metrics, cross-references, etc.
41
99e64a6e
LC
42(define-public cflow
43 (package
44 (name "cflow")
45 (version "1.4")
46 (source (origin
47 (method url-fetch)
48 (uri (string-append "mirror://gnu/cflow/cflow-"
49 version ".tar.bz2"))
50 (sha256
51 (base32
52 "1jkbq97ajcf834z68hbn3xfhiz921zhn39gklml1racf0kb3jzh3"))))
53 (build-system gnu-build-system)
54
55 ;; Needed to have cflow-mode.el installed.
2d32d153 56 (native-inputs `(("emacs" ,emacs-no-x)))
99e64a6e
LC
57
58 (home-page "http://www.gnu.org/software/cflow/")
59 (synopsis "Create a graph of control flow within a program")
60 (description
61 "GNU cflow analyzes C source files and produces a graph charting the
62control flow of the program. It can output the graph in several styles and
e881752c 63in either the POSIX format or in an extended GNU format. cflow also includes
99e64a6e 64a major mode for Emacs for examining the flowcharts that it produces.")
d13586bf 65 (license license:gpl3+)))
99e64a6e
LC
66
67(define-public complexity
68 (package
69 (name "complexity")
70 (version "1.2")
71 (source (origin
72 (method url-fetch)
73 (uri (string-append "mirror://gnu/complexity/complexity-"
74 version ".tar.gz"))
75 (sha256
76 (base32
77 "0pmlhlj1chl4caaqffvn1cy9z8gwmjbx97syi7pdfa0vqygkql6d"))))
78 (build-system gnu-build-system)
79 (native-inputs
80 `(("texinfo" ,texinfo)
81 ("autogen" ,autogen)))
82 (home-page "http://www.gnu.org/software/complexity/")
83 (synopsis "Analyze complexity of C functions")
84 (description
85 "GNU complexity provides tools for finding procedures that are
86convoluted, overly long or otherwise difficult to understand. This
87may help in learning or reviewing unfamiliar code or perhaps
88highlighting your own code that seemed comprehensible when you wrote it.")
d13586bf 89 (license license:gpl3+)))
99e64a6e
LC
90
91(define-public global ; a global variable
92 (package
93 (name "global")
11906b2c 94 (version "6.5")
99e64a6e
LC
95 (source (origin
96 (method url-fetch)
97 (uri (string-append "mirror://gnu/global/global-"
98 version ".tar.gz"))
99 (sha256
100 (base32
11906b2c 101 "1af6lhwhrpdnigd3707fnk3dd6y53pbc4g0i75xjf0563bdi5zaa"))))
99e64a6e
LC
102 (build-system gnu-build-system)
103 (inputs `(("ncurses" ,ncurses)
e1ac691d
LC
104 ("libltdl" ,libltdl)
105 ("sqlite" ,sqlite)))
99e64a6e
LC
106 (arguments
107 `(#:configure-flags
108 (list (string-append "--with-ncurses="
e1ac691d
LC
109 (assoc-ref %build-inputs "ncurses"))
110 (string-append "--with-sqlite3="
111 (assoc-ref %build-inputs "sqlite")))
99e64a6e
LC
112
113 #:phases (alist-cons-after
114 'install 'post-install
115 (lambda* (#:key outputs #:allow-other-keys)
116 ;; Install the Emacs Lisp file in the right place.
117 (let* ((out (assoc-ref outputs "out"))
118 (data (string-append out "/share/gtags"))
119 (lisp (string-append out "/share/emacs/site-lisp")))
120 (mkdir-p lisp)
121 (copy-file (string-append data "/gtags.el")
122 (string-append lisp "/gtags.el"))
123 (delete-file (string-append data "/gtags.el"))
124 #t))
125 %standard-phases)))
126 (home-page "http://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
130across a wide array of environments, such as different text editors, shells
131and web browsers. The resulting tags are useful for quickly moving around in
132a 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
185code (SLOC) in large software systems. It can automatically identify and
186measure a wide range of programming languages. It automatically estimates the
187effort, time, and money it would take to develop the software, using the
188COCOMO model or user-provided parameters.")
d13586bf
189 (license license:gpl2+)))
190
191(define-public the-silver-searcher
192 (package
193 (name "the-silver-searcher")
194 (version "0.29.1")
195 (source (origin
196 (method url-fetch)
197 (uri (string-append
198 "https://github.com/ggreer/the_silver_searcher/archive/"
199 version ".tar.gz"))
200 (sha256
201 (base32
202 "0ah7vcqprl9hhafi68bvzaiywy7dfm28zf7kpw3xrlqzfn0vg7kp"))
203 (file-name (string-append name "-" version ".tar.gz"))))
204 (build-system gnu-build-system)
205 (native-inputs
206 `(("autoconf" ,autoconf)
207 ("automake" ,automake)
208 ("libtool" ,libtool)
209 ("pkg-config" ,pkg-config)))
210 (inputs
211 `(("pcre" ,pcre)
212 ("xz" ,xz)
213 ("zlib" ,zlib)))
214 (arguments
215 `(#:phases
216 ;; There is no configure yet, so let's create it, but let configure and
217 ;; make do the work in later phases.
218 (alist-cons-before 'configure 'autoconf
219 (lambda _
220 (substitute* "build.sh"
221 (("./configure") "true")
222 (("make -j4") "true"))
223 (zero? (system* "sh" "build.sh")))
224 %standard-phases)))
225 (home-page "http://geoff.greer.fm/ag/")
226 (synopsis "Fast code searching tool")
227 (description
228 "The silver searcher, or 'ag', is tool for quickly searching through
229files, but compared to grep is much faster and respects files like .gitignore,
230.hgignore, etc.")
231 (license license:asl2.0)))
76e14638
RW
232
233(define-public withershins
234 (package
235 (name "withershins")
236 (version "0.1")
237 (source (origin
238 (method url-fetch)
239 (uri (string-append
240 "https://github.com/cameronwhite/withershins/archive/v"
241 version ".tar.gz"))
242 (file-name (string-append name "-" version ".tar.gz"))
243 (sha256
244 (base32
245 "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh"))))
246 (build-system cmake-build-system)
247 (arguments
248 `(#:out-of-source? #f
76e14638
RW
249 #:phases
250 (modify-phases %standard-phases
251 (add-after
252 'unpack 'find-libiberty
253 (lambda _
25734108 254 (let ((libiberty (assoc-ref %build-inputs "libiberty")))
76e14638 255 (substitute* "cmake/FindIberty.cmake"
25734108
RW
256 (("/usr/include") (string-append libiberty "/include"))
257 (("libiberty.a iberty")
258 (string-append "NAMES libiberty.a iberty\nPATHS \""
259 libiberty "/lib" "\"")))
76e14638
RW
260 #t)))
261 (replace
262 'install
263 (lambda* (#:key outputs #:allow-other-keys)
264 (let ((out (assoc-ref outputs "out")))
265 (mkdir-p (string-append out "/lib"))
266 (mkdir (string-append out "/include"))
267 (copy-file "src/withershins.hpp"
268 (string-append out "/include/withershins.hpp"))
269 (copy-file "src/libwithershins.a"
270 (string-append out "/lib/libwithershins.a")))
271 #t)))))
272 (home-page "https://github.com/cameronwhite/withershins")
273 (inputs
25734108 274 `(("libiberty" ,libiberty)
76e14638
RW
275 ("binutils" ,binutils) ;for libbfd
276 ("zlib" ,zlib)))
277 (synopsis "C++11 library for generating stack traces")
278 (description
279 "Withershins is a simple cross-platform C++11 library for generating
280stack traces.")
281 ;; Sources are released under Expat license, but since BFD is licensed
282 ;; under the GPLv3+ the combined work is GPLv3+ as well.
283 (license license:gpl3+)))