gnu: facter: Update to 4.0.34.
[jackhill/guix/guix.git] / gnu / packages / build-tools.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
4 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
6 ;;; Copyright © 2018 Tomáš Čech <sleep_walker@gnu.org>
7 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
8 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
9 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
10 ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
11 ;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
12 ;;; Copyright © 2020 Yuval Kogman <nothingmuch@woobling.org>
13 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
21 ;;;
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
26 ;;;
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30 (define-module (gnu packages build-tools)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix utils)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix build-system cmake)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages linux)
41 #:use-module (gnu packages lua)
42 #:use-module (gnu packages package-management)
43 #:use-module (gnu packages pcre)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages python-crypto)
47 #:use-module (gnu packages python-web)
48 #:use-module (gnu packages python-xyz)
49 #:use-module (gnu packages sqlite)
50 #:use-module (gnu packages ninja)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system python))
53
54 (define-public bam
55 (package
56 (name "bam")
57 (version "0.5.1")
58 (source (origin
59 ;; do not use auto-generated tarballs
60 (method git-fetch)
61 (uri (git-reference
62 (url "https://github.com/matricks/bam")
63 (commit (string-append "v" version))))
64 (file-name (git-file-name name version))
65 (sha256
66 (base32
67 "13br735ig7lygvzyfd15fc2rdygrqm503j6xj5xkrl1r7w2wipq6"))))
68 (build-system gnu-build-system)
69 (arguments
70 `(#:make-flags `("CC=gcc"
71 ,(string-append "INSTALL_PREFIX="
72 (assoc-ref %outputs "out")))
73 #:test-target "test"
74 #:phases
75 (modify-phases %standard-phases
76 (delete 'configure))))
77 (native-inputs
78 `(("python" ,python-2)))
79 (inputs
80 `(("lua" ,lua)))
81 (home-page "https://matricks.github.io/bam/")
82 (synopsis "Fast and flexible build system")
83 (description "Bam is a fast and flexible build system. Bam uses Lua to
84 describe the build process. It takes its inspiration for the script files
85 from scons. While scons focuses on being 100% correct when building, bam
86 makes a few sacrifices to acquire fast full and incremental build times.")
87 (license license:bsd-3)))
88
89 (define-public bear
90 (package
91 (name "bear")
92 (version "2.4.3")
93 (source (origin
94 (method git-fetch)
95 (uri (git-reference
96 (url "https://github.com/rizsotto/Bear")
97 (commit version)))
98 (file-name (git-file-name name version))
99 (sha256
100 (base32
101 "19fk4flfykbzhb89ppmzqf0zlrkbjm6ajl9fsayndj9km5ys0041"))))
102 (build-system cmake-build-system)
103 (inputs
104 `(("python" ,python-wrapper)))
105 (home-page "https://github.com/rizsotto/Bear")
106 (synopsis "Tool for generating a compilation database")
107 (description "A JSON compilation database is used in the Clang project to
108 provide information on how a given compilation unit is processed. With this,
109 it is easy to re-run the compilation with alternate programs. Bear is used to
110 generate such a compilation database.")
111 (license license:gpl3+)))
112
113 (define-public gn
114 (let ((commit "eb997b5ab9c3f1ba6a2c52072785884864a84eae")
115 (revision "1794")) ;as returned by `git describe`, used below
116 (package
117 (name "gn")
118 (version (git-version "0.0" revision commit))
119 (home-page "https://gn.googlesource.com/gn")
120 (source (origin
121 (method git-fetch)
122 (uri (git-reference (url home-page) (commit commit)))
123 (sha256
124 (base32
125 "1vfkcy34wqhg7wsk7jdzhgnnzwim10wgbxv5bnavxzjcs871i2xa"))
126 (file-name (git-file-name name version))))
127 (build-system gnu-build-system)
128 (arguments
129 `(#:phases (modify-phases %standard-phases
130 (add-before 'configure 'set-build-environment
131 (lambda _
132 (setenv "CC" "gcc") (setenv "CXX" "g++")
133 (setenv "AR" "ar")
134 #t))
135 (replace 'configure
136 (lambda _
137 (invoke "python" "build/gen.py"
138 "--no-last-commit-position")))
139 (add-after 'configure 'create-last-commit-position
140 (lambda _
141 ;; Create "last_commit_position.h" to avoid a dependency
142 ;; on 'git' (and the checkout..).
143 (call-with-output-file "out/last_commit_position.h"
144 (lambda (port)
145 (format port
146 (string-append
147 "#define LAST_COMMIT_POSITION_NUM ~a\n"
148 "#define LAST_COMMIT_POSITION \"~a (~a)\"\n")
149 ,revision ,revision ,(string-take commit 8))
150 #t))))
151 (replace 'build
152 (lambda _
153 (invoke "ninja" "-C" "out" "gn"
154 "-j" (number->string (parallel-job-count)))))
155 (replace 'check
156 (lambda* (#:key (tests? #t) #:allow-other-keys)
157 (if tests?
158 (lambda ()
159 (invoke "ninja" "-C" "out" "gn_unittests"
160 "-j" (number->string (parallel-job-count)))
161 (invoke "./out/gn_unittests"))
162 (format #t "test suite not run~%"))))
163 (replace 'install
164 (lambda* (#:key outputs #:allow-other-keys)
165 (let ((out (assoc-ref outputs "out")))
166 (install-file "out/gn" (string-append out "/bin"))
167 #t))))))
168 (native-inputs
169 `(("ninja" ,ninja)
170 ("python" ,python-2)))
171 (synopsis "Generate Ninja build files")
172 (description
173 "GN is a tool that collects information about a project from @file{.gn}
174 files and generates build instructions for the Ninja build system.")
175 ;; GN is distributed as BSD-3, but bundles some files from ICU using the
176 ;; X11 license.
177 (license (list license:bsd-3 license:x11)))))
178
179 (define-public meson
180 (package
181 (name "meson")
182 (version "0.53.2")
183 (source (origin
184 (method url-fetch)
185 (uri (string-append "https://github.com/mesonbuild/meson/"
186 "releases/download/" version "/meson-"
187 version ".tar.gz"))
188 (sha256
189 (base32
190 "07y2hh9dfn1m9g4bsy49nbn3vdmd0b2iwr8bxg19fhqq6c7q73ry"))))
191 (build-system python-build-system)
192 (arguments
193 `(;; FIXME: Tests require many additional inputs, a fix for the RUNPATH
194 ;; patch in meson-for-build, and patching many hard-coded file system
195 ;; locations in "run_unittests.py".
196 #:tests? #f
197 #:phases (modify-phases %standard-phases
198 ;; Meson calls the various executables in out/bin through the
199 ;; Python interpreter, so we cannot use the shell wrapper.
200 (delete 'wrap))))
201 (inputs `(("ninja" ,ninja)))
202 (propagated-inputs `(("python" ,python)))
203 (home-page "https://mesonbuild.com/")
204 (synopsis "Build system designed to be fast and user-friendly")
205 (description
206 "The Meson build system is focused on user-friendliness and speed.
207 It can compile code written in C, C++, Fortran, Java, Rust, and other
208 languages. Meson provides features comparable to those of the
209 Autoconf/Automake/make combo. Build specifications, also known as @dfn{Meson
210 files}, are written in a custom domain-specific language (@dfn{DSL}) that
211 resembles Python.")
212 (license license:asl2.0)))
213
214 (define-public meson-for-build
215 (package
216 (inherit meson)
217 (name "meson-for-build")
218 (source (origin
219 (inherit (package-source meson))
220 (patches (search-patches "meson-for-build-rpath.patch"))))
221
222 ;; People should probably install "meson", not "meson-for-build".
223 (properties `((hidden? . #t)))))
224
225 (define-public premake4
226 (package
227 (name "premake")
228 (version "4.3")
229 (source (origin
230 (method url-fetch)
231 (uri (string-append "mirror://sourceforge/premake/Premake/"
232 version "/premake-" version "-src.zip"))
233 (sha256
234 (base32
235 "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn"))))
236 (build-system gnu-build-system)
237 (native-inputs
238 `(("unzip" ,unzip))) ; for unpacking the source
239 (arguments
240 `(#:make-flags '("CC=gcc")
241 #:tests? #f ; No test suite
242 #:phases
243 (modify-phases %standard-phases
244 (delete 'configure)
245 (add-after 'unpack 'enter-source
246 (lambda _ (chdir "build/gmake.unix") #t))
247 (replace 'install
248 (lambda* (#:key outputs #:allow-other-keys)
249 (install-file "../../bin/release/premake4"
250 (string-append (assoc-ref outputs "out") "/bin"))
251 #t)))))
252 (synopsis "Portable software build tool")
253 (description "@code{premake4} is a command line utility that reads a
254 scripted definition of a software project and outputs @file{Makefile}s or
255 other lower-level build files.")
256 (home-page "https://premake.github.io")
257 (license license:bsd-3)))
258
259 (define-public premake5
260 (package
261 (inherit premake4)
262 (version "5.0.0-alpha15")
263 (source (origin
264 (method url-fetch)
265 (uri (string-append "https://github.com/premake/premake-core/"
266 "releases/download/v" version
267 "/premake-" version "-src.zip"))
268 (sha256
269 (base32
270 "0lyxfyqxyhjqsb3kmx1fyrxinb26i68hb7w7rg8lajczrgkmc3w8"))))
271 (arguments
272 (substitute-keyword-arguments (package-arguments premake4)
273 ((#:phases phases)
274 `(modify-phases ,phases
275 (replace 'enter-source
276 (lambda _ (chdir "build/gmake2.unix") #t))
277 (replace 'install
278 (lambda* (#:key outputs #:allow-other-keys)
279 (install-file "../../bin/release/premake5"
280 (string-append (assoc-ref outputs "out") "/bin"))
281 #t))))))
282 (description "@code{premake5} is a command line utility that reads a
283 scripted definition of a software project and outputs @file{Makefile}s or
284 other lower-level build files.")))
285
286 (define-public tup
287 (package
288 (name "tup")
289 (version "0.7.9")
290 (source (origin
291 (method url-fetch)
292 (uri (string-append "http://gittup.org/tup/releases/tup-v"
293 version ".tar.gz"))
294 (sha256
295 (base32
296 "0gnd2598xqgwihdkfkx7qn0q6p4n7npam1fy83mp7s04zwj99syc"))
297 (patches (search-patches "tup-unbundle-dependencies.patch"))
298 (modules '((guix build utils)))
299 (snippet
300 '(begin
301 ;; NOTE: Tup uses a slightly modified Lua, so it cannot be
302 ;; unbundled. See: src/lula/tup-lua.patch
303 (delete-file-recursively "src/pcre")
304 (delete-file-recursively "src/sqlite3")
305 #t))))
306 (build-system gnu-build-system)
307 (arguments
308 `(#:phases
309 (modify-phases %standard-phases
310 ;; There is a bootstrap script, but it doesn't do what you think - it
311 ;; builds tup.
312 (delete 'bootstrap)
313 (replace 'configure
314 (lambda _
315 (substitute* "src/tup/link.sh"
316 (("`git describe`") ,version))
317 (with-output-to-file "tup.config"
318 (lambda _
319 (format #t "CONFIG_TUP_USE_SYSTEM_SQLITE=y~%")))
320 #t))
321 (delete 'check)
322 (replace 'build
323 (lambda _
324 ;; Based on bootstrap-nofuse.sh, but with a detour to patch-shebang.
325 (invoke "./build.sh")
326 (invoke "./build/tup" "init")
327 (invoke "./build/tup" "generate" "--verbose" "build-nofuse.sh")
328 (patch-shebang "build-nofuse.sh")
329 (invoke "./build-nofuse.sh")))
330 (replace 'install
331 (lambda* (#:key outputs #:allow-other-keys)
332 (let* ((outdir (assoc-ref outputs "out"))
333 (ftdetect (string-append outdir
334 "/share/vim/vimfiles/ftdetect")))
335 (install-file "tup" (string-append outdir "/bin"))
336 (install-file "tup.1" (string-append outdir "/share/man/man1"))
337 (install-file "contrib/syntax/tup.vim"
338 (string-append outdir "/share/vim/vimfiles/syntax"))
339 (mkdir-p ftdetect)
340 (with-output-to-file (string-append ftdetect "/tup.vim")
341 (lambda _
342 (display "au BufNewFile,BufRead Tupfile,*.tup setf tup")))
343 #t))))))
344 (inputs
345 `(("fuse" ,fuse)
346 ("pcre" ,pcre)
347 ("pcre" ,pcre "bin") ; pcre-config
348 ("sqlite" ,sqlite)))
349 (native-inputs
350 `(("pkg-config" ,pkg-config)))
351 (home-page "http://gittup.org/tup/")
352 (synopsis "Fast build system that's hard to get wrong")
353 (description "Tup is a generic build system based on a directed acyclic
354 graphs of commands to be executed. Tup instruments your build to detect the
355 exact dependencies of the commands, allowing you to take advantage of ideal
356 parallelism during incremental builds, and detecting any situations where
357 a build worked by accident.")
358 (license license:gpl2)))
359
360 (define-public osc
361 (package
362 (name "osc")
363 (version "0.165.2")
364 (source
365 (origin
366 (method git-fetch)
367 (uri (git-reference
368 (url "https://github.com/openSUSE/osc")
369 (commit version)))
370 (file-name (git-file-name name version))
371 (sha256
372 (base32 "0yjwvbvv9fgkpiyvrag89zxchyn3nbgp9jz0wn5p0z9450zwfyz6"))))
373 (build-system python-build-system)
374 (arguments
375 `(#:phases
376 (modify-phases %standard-phases
377 (add-after 'install 'fix-filename
378 (lambda* (#:key outputs #:allow-other-keys)
379 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
380 ;; Main osc tool is renamed in spec file, not setup.py, let's
381 ;; do that too.
382 (rename-file
383 (string-append bin "osc-wrapper.py")
384 (string-append bin "osc"))
385 #t))))))
386 (inputs
387 `(("python-m2crypto" ,python-m2crypto)
388 ("python-pycurl" ,python-pycurl)
389 ("rpm" ,rpm))) ; for python-rpm
390 (home-page "https://github.com/openSUSE/osc")
391 (synopsis "Open Build Service command line tool")
392 (description "@command{osc} is a command line interface to the Open Build
393 Service. It allows you to checkout, commit, perform reviews etc. The vast
394 majority of the OBS functionality is available via commands and the rest can
395 be reached via direct API calls.")
396 (license license:gpl2+)))
397
398 (define-public compiledb
399 (package
400 (name "compiledb")
401 (version "0.10.1")
402 (source
403 (origin
404 (method url-fetch)
405 (uri (pypi-uri "compiledb" version))
406 (sha256
407 (base32 "0vlngsdxfakyl8b7rnvn8h3l216lhbrrydr04yhy6kd03zflgfq6"))))
408 (build-system python-build-system)
409 (arguments
410 `(#:phases
411 (modify-phases %standard-phases
412 (add-after 'unpack 'no-compat-shim-dependency
413 ;; shutilwhich is only needed for python 3.3 and earlier
414 (lambda _
415 (substitute* "setup.py" (("^ *'shutilwhich'\n") ""))
416 (substitute* "compiledb/compiler.py" (("shutilwhich") "shutil")))))))
417 (propagated-inputs
418 `(("python-bashlex" ,python-bashlex)
419 ("python-click" ,python-click)))
420 (native-inputs
421 `(("python-pytest" ,python-pytest)))
422 (home-page
423 "https://github.com/nickdiego/compiledb")
424 (synopsis
425 "Generate Clang JSON Compilation Database files for make-based build systems")
426 (description
427 "@code{compiledb} provides a @code{make} python wrapper script which,
428 besides executing the make build command, updates the JSON compilation
429 database file corresponding to that build, resulting in a command-line
430 interface similar to Bear.")
431 (license license:gpl3)))