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>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
42 ;;; Tools to deal with source code: metrics, cross-references, etc.
50 (uri (string-append "mirror://gnu/cflow/cflow-"
54 "0yq33k5ap1zpnja64n89iai4zh018ffr72wki5a6mzczd880mr3g"))))
55 (build-system gnu-build-system)
57 ;; Needed to have cflow-mode.el installed.
58 (native-inputs `(("emacs" ,emacs-minimal)))
60 (home-page "https://www.gnu.org/software/cflow/")
61 (synopsis "Create a graph of control flow within a program")
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+)))
69 (define-public complexity
75 (uri (string-append "mirror://gnu/complexity/complexity-"
79 "0lr0l9kj2w3jilz9h9y4np9pf9i9ccpy6331lanki2fnz4z8ldvd"))))
80 (build-system gnu-build-system)
82 `(("texinfo" ,texinfo)
83 ("autogen" ,autogen)))
84 (home-page "https://www.gnu.org/software/complexity/")
85 (synopsis "Analyze complexity of C functions")
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+)))
93 (define-public global ; a global variable
99 (uri (string-append "mirror://gnu/global/global-"
103 "018m536k5y6lks1a6gqn3bsp7r8zk017znqj9kva1nm8d7x9lbqj"))))
104 (build-system gnu-build-system)
105 (inputs `(("ncurses" ,ncurses)
110 (list (string-append "--with-ncurses="
111 (assoc-ref %build-inputs "ncurses"))
112 (string-append "--with-sqlite3="
113 (assoc-ref %build-inputs "sqlite")))
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"))
126 (home-page "https://www.gnu.org/software/global/")
127 (synopsis "Cross-environment source code tag system")
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+)))
135 (define-public sloccount
141 (uri (string-append "http://www.dwheeler.com/sloccount/sloccount-"
145 "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs"))))
146 (build-system gnu-build-system)
148 '(#:phases (modify-phases %standard-phases
150 (add-before 'build 'make-dotl-files-older
152 ;; Make the '.l' files as old as the '.c'
153 ;; files to avoid triggering the rule that
158 (for-each (lambda (file)
159 (set-file-time file ref))
160 (find-files "." "\\.[chl]$"))
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
168 (mkdir-p (string-append out
172 (setenv "HOME" (getcwd))
174 (string-append (getcwd) ":"
176 (zero? (system* "make" "test")))))
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)")
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+)))
191 (define-public the-silver-searcher
193 (name "the-silver-searcher")
198 "http://geoff.greer.fm/ag/releases/the_silver_searcher-"
202 "0v54himv65w294l0k4lhdyc6kvpgijn8b9g5356479fzy7hphjkg"))))
203 (build-system gnu-build-system)
205 `(("pkg-config" ,pkg-config)))
210 (home-page "http://geoff.greer.fm/ag/")
211 (synopsis "Fast code searching tool")
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)))
226 (uri (string-append "mirror://sourceforge/ctrio/trio/trio-"
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")
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"))))
243 (define-public withershins
250 "https://github.com/cameronwhite/withershins/archive/v"
252 (file-name (string-append name "-" version ".tar.gz"))
255 "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh"))))
256 (build-system cmake-build-system)
258 `(#:out-of-source? #f
260 (modify-phases %standard-phases
262 'unpack 'find-libiberty
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" "\"")))
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")))
278 (install-file "src/withershins.hpp" include)
280 (install-file "src/libwithershins.a" lib))
282 (home-page "https://github.com/cameronwhite/withershins")
284 `(("libiberty" ,libiberty)
285 ("binutils" ,binutils) ;for libbfd
287 (synopsis "C++11 library for generating stack traces")
289 "Withershins is a simple cross-platform C++11 library for generating
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+)))
301 (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis"
302 "/LCOV-" version "/lcov-" version ".tar.gz"))
305 "19wfifdpxxivhq9adbphanjfga9bg9spms9v7c3589wndjff8x5l"))))
306 (build-system gnu-build-system)
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
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")
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+)))