gnu: r-rcpphnsw: Update to 0.3.0.
[jackhill/guix/guix.git] / gnu / packages / build-tools.scm
CommitLineData
33f79a74 1;;; GNU Guix --- Functional package management for GNU
a3baaaa0 2;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
162dd290 3;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
da567fc8 4;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
71dab08d 5;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
9a588402 6;;; Copyright © 2018 Tomáš Čech <sleep_walker@gnu.org>
b7851222 7;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
53367e17 8;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
4b3ff362 9;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
41e09a15 10;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
fcafee61 11;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
6560c497 12;;; Copyright © 2020 Yuval Kogman <nothingmuch@woobling.org>
2c1d1b75 13;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
33f79a74
RW
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)
f85af5ab 35 #:use-module (guix git-download)
71dab08d 36 #:use-module (guix build-system cmake)
33f79a74 37 #:use-module (gnu packages)
6560c497 38 #:use-module (gnu packages check)
c97cef0a 39 #:use-module (gnu packages compression)
2c1d1b75 40 #:use-module (gnu packages linux)
53367e17 41 #:use-module (gnu packages lua)
41e09a15 42 #:use-module (gnu packages package-management)
2c1d1b75
JK
43 #:use-module (gnu packages pcre)
44 #:use-module (gnu packages pkg-config)
33f79a74 45 #:use-module (gnu packages python)
9a588402
46 #:use-module (gnu packages python-crypto)
47 #:use-module (gnu packages python-web)
6560c497 48 #:use-module (gnu packages python-xyz)
2c1d1b75 49 #:use-module (gnu packages sqlite)
162dd290
CB
50 #:use-module (gnu packages ninja)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system python))
33f79a74
RW
53
54(define-public bam
55 (package
56 (name "bam")
53367e17 57 (version "0.5.1")
33f79a74 58 (source (origin
53367e17
AV
59 ;; do not use auto-generated tarballs
60 (method git-fetch)
61 (uri (git-reference
b0e7b699 62 (url "https://github.com/matricks/bam")
53367e17
AV
63 (commit (string-append "v" version))))
64 (file-name (git-file-name name version))
33f79a74
RW
65 (sha256
66 (base32
53367e17 67 "13br735ig7lygvzyfd15fc2rdygrqm503j6xj5xkrl1r7w2wipq6"))))
33f79a74
RW
68 (build-system gnu-build-system)
69 (arguments
53367e17
AV
70 `(#:make-flags `("CC=gcc"
71 ,(string-append "INSTALL_PREFIX="
72 (assoc-ref %outputs "out")))
73 #:test-target "test"
74 #:phases
33f79a74 75 (modify-phases %standard-phases
53367e17 76 (delete 'configure))))
33f79a74
RW
77 (native-inputs
78 `(("python" ,python-2)))
53367e17
AV
79 (inputs
80 `(("lua" ,lua)))
33f79a74
RW
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
84describe the build process. It takes its inspiration for the script files
85from scons. While scons focuses on being 100% correct when building, bam
86makes a few sacrifices to acquire fast full and incremental build times.")
87 (license license:bsd-3)))
162dd290 88
71dab08d
FT
89(define-public bear
90 (package
91 (name "bear")
33061f7b 92 (version "2.4.4")
71dab08d 93 (source (origin
f85af5ab
TGR
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))
71dab08d
FT
99 (sha256
100 (base32
33061f7b 101 "184dqjcpxiwcfziyi67zzran2c4fal1r3j8nhjdjadcmfxf4389d"))))
71dab08d 102 (build-system cmake-build-system)
73d85423
FT
103 (inputs
104 `(("python" ,python-wrapper)))
71dab08d
FT
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
108provide information on how a given compilation unit is processed. With this,
109it is easy to re-run the compilation with alternate programs. Bear is used to
110generate such a compilation database.")
111 (license license:gpl3+)))
112
3ad0a358 113(define-public gn
cf14e679
MB
114 (let ((commit "eb997b5ab9c3f1ba6a2c52072785884864a84eae")
115 (revision "1794")) ;as returned by `git describe`, used below
3ad0a358
MB
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
cf14e679 125 "1vfkcy34wqhg7wsk7jdzhgnnzwim10wgbxv5bnavxzjcs871i2xa"))
3ad0a358
MB
126 (file-name (git-file-name name version))))
127 (build-system gnu-build-system)
128 (arguments
97b672d9 129 `(#:phases (modify-phases %standard-phases
3ad0a358
MB
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 _
ebee2f47 137 (invoke "python" "build/gen.py"
3ad0a358
MB
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
b7851222
MB
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))
3ad0a358
MB
150 #t))))
151 (replace 'build
152 (lambda _
153 (invoke "ninja" "-C" "out" "gn"
154 "-j" (number->string (parallel-job-count)))))
97b672d9
MB
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~%"))))
3ad0a358
MB
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}
174files 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
162dd290
CB
179(define-public meson
180 (package
181 (name "meson")
275f8749 182 (version "0.53.2")
162dd290
CB
183 (source (origin
184 (method url-fetch)
185 (uri (string-append "https://github.com/mesonbuild/meson/"
a47ed096
RW
186 "releases/download/" version "/meson-"
187 version ".tar.gz"))
162dd290
CB
188 (sha256
189 (base32
275f8749 190 "07y2hh9dfn1m9g4bsy49nbn3vdmd0b2iwr8bxg19fhqq6c7q73ry"))))
162dd290 191 (build-system python-build-system)
b14a04b2 192 (arguments
3f6c185e
MB
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
b14a04b2
MB
198 ;; Meson calls the various executables in out/bin through the
199 ;; Python interpreter, so we cannot use the shell wrapper.
200 (delete 'wrap))))
c695fb76 201 (inputs `(("ninja" ,ninja)))
67f8ba11 202 (propagated-inputs `(("python" ,python)))
162dd290
CB
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.
207It can compile code written in C, C++, Fortran, Java, Rust, and other
208languages. Meson provides features comparable to those of the
209Autoconf/Automake/make combo. Build specifications, also known as @dfn{Meson
6c4da3b7
TGR
210files}, are written in a custom domain-specific language (@dfn{DSL}) that
211resembles Python.")
162dd290 212 (license license:asl2.0)))
c97cef0a 213
ae286b58
AT
214;; Added temporarily for packages that need it.
215;; TODO: Remove when core-updates is merged.
216(define-public meson-0.55
217 (package
218 (inherit meson)
219 (version "0.55.1")
220 (source (origin
221 (method url-fetch)
222 (uri (string-append "https://github.com/mesonbuild/meson/"
223 "releases/download/" version "/meson-"
224 version ".tar.gz"))
225 (sha256
226 (base32
227 "1070kjiirxxdfppmrhi3wsc6rykay1zlciqrzayjhjg0hkw42mrv"))))))
228
dab666cd
PM
229(define-public meson-for-build
230 (package
231 (inherit meson)
232 (name "meson-for-build")
dab666cd 233 (source (origin
d3155863 234 (inherit (package-source meson))
dab666cd
PM
235 (patches (search-patches "meson-for-build-rpath.patch"))))
236
237 ;; People should probably install "meson", not "meson-for-build".
238 (properties `((hidden? . #t)))))
239
c97cef0a
OP
240(define-public premake4
241 (package
242 (name "premake")
243 (version "4.3")
244 (source (origin
245 (method url-fetch)
246 (uri (string-append "mirror://sourceforge/premake/Premake/"
247 version "/premake-" version "-src.zip"))
248 (sha256
249 (base32
250 "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn"))))
251 (build-system gnu-build-system)
252 (native-inputs
253 `(("unzip" ,unzip))) ; for unpacking the source
254 (arguments
255 `(#:make-flags '("CC=gcc")
256 #:tests? #f ; No test suite
257 #:phases
258 (modify-phases %standard-phases
259 (delete 'configure)
260 (add-after 'unpack 'enter-source
261 (lambda _ (chdir "build/gmake.unix") #t))
262 (replace 'install
263 (lambda* (#:key outputs #:allow-other-keys)
264 (install-file "../../bin/release/premake4"
265 (string-append (assoc-ref outputs "out") "/bin"))
266 #t)))))
267 (synopsis "Portable software build tool")
268 (description "@code{premake4} is a command line utility that reads a
269scripted definition of a software project and outputs @file{Makefile}s or
270other lower-level build files.")
271 (home-page "https://premake.github.io")
272 (license license:bsd-3)))
9a588402 273
fcafee61
LP
274(define-public premake5
275 (package
276 (inherit premake4)
7c475372 277 (version "5.0.0-alpha15")
fcafee61
LP
278 (source (origin
279 (method url-fetch)
280 (uri (string-append "https://github.com/premake/premake-core/"
281 "releases/download/v" version
282 "/premake-" version "-src.zip"))
283 (sha256
284 (base32
7c475372 285 "0lyxfyqxyhjqsb3kmx1fyrxinb26i68hb7w7rg8lajczrgkmc3w8"))))
fcafee61
LP
286 (arguments
287 (substitute-keyword-arguments (package-arguments premake4)
288 ((#:phases phases)
289 `(modify-phases ,phases
7c475372
TGR
290 (replace 'enter-source
291 (lambda _ (chdir "build/gmake2.unix") #t))
fcafee61
LP
292 (replace 'install
293 (lambda* (#:key outputs #:allow-other-keys)
294 (install-file "../../bin/release/premake5"
295 (string-append (assoc-ref outputs "out") "/bin"))
296 #t))))))
297 (description "@code{premake5} is a command line utility that reads a
298scripted definition of a software project and outputs @file{Makefile}s or
299other lower-level build files.")))
300
2c1d1b75
JK
301(define-public tup
302 (package
303 (name "tup")
0f99da2b 304 (version "0.7.9")
2c1d1b75
JK
305 (source (origin
306 (method url-fetch)
307 (uri (string-append "http://gittup.org/tup/releases/tup-v"
308 version ".tar.gz"))
309 (sha256
310 (base32
0f99da2b 311 "0gnd2598xqgwihdkfkx7qn0q6p4n7npam1fy83mp7s04zwj99syc"))
2c1d1b75
JK
312 (patches (search-patches "tup-unbundle-dependencies.patch"))
313 (modules '((guix build utils)))
314 (snippet
315 '(begin
316 ;; NOTE: Tup uses a slightly modified Lua, so it cannot be
317 ;; unbundled. See: src/lula/tup-lua.patch
318 (delete-file-recursively "src/pcre")
319 (delete-file-recursively "src/sqlite3")
320 #t))))
321 (build-system gnu-build-system)
322 (arguments
323 `(#:phases
324 (modify-phases %standard-phases
325 ;; There is a bootstrap script, but it doesn't do what you think - it
326 ;; builds tup.
327 (delete 'bootstrap)
328 (replace 'configure
329 (lambda _
330 (substitute* "src/tup/link.sh"
331 (("`git describe`") ,version))
332 (with-output-to-file "tup.config"
333 (lambda _
334 (format #t "CONFIG_TUP_USE_SYSTEM_SQLITE=y~%")))
335 #t))
336 (delete 'check)
337 (replace 'build
338 (lambda _
339 ;; Based on bootstrap-nofuse.sh, but with a detour to patch-shebang.
340 (invoke "./build.sh")
341 (invoke "./build/tup" "init")
342 (invoke "./build/tup" "generate" "--verbose" "build-nofuse.sh")
343 (patch-shebang "build-nofuse.sh")
344 (invoke "./build-nofuse.sh")))
345 (replace 'install
346 (lambda* (#:key outputs #:allow-other-keys)
347 (let* ((outdir (assoc-ref outputs "out"))
348 (ftdetect (string-append outdir
349 "/share/vim/vimfiles/ftdetect")))
350 (install-file "tup" (string-append outdir "/bin"))
351 (install-file "tup.1" (string-append outdir "/share/man/man1"))
352 (install-file "contrib/syntax/tup.vim"
353 (string-append outdir "/share/vim/vimfiles/syntax"))
354 (mkdir-p ftdetect)
355 (with-output-to-file (string-append ftdetect "/tup.vim")
356 (lambda _
357 (display "au BufNewFile,BufRead Tupfile,*.tup setf tup")))
358 #t))))))
359 (inputs
360 `(("fuse" ,fuse)
361 ("pcre" ,pcre)
362 ("pcre" ,pcre "bin") ; pcre-config
363 ("sqlite" ,sqlite)))
364 (native-inputs
365 `(("pkg-config" ,pkg-config)))
366 (home-page "http://gittup.org/tup/")
367 (synopsis "Fast build system that's hard to get wrong")
368 (description "Tup is a generic build system based on a directed acyclic
369graphs of commands to be executed. Tup instruments your build to detect the
370exact dependencies of the commands, allowing you to take advantage of ideal
371parallelism during incremental builds, and detecting any situations where
372a build worked by accident.")
373 (license license:gpl2)))
374
9a588402
375(define-public osc
376 (package
377 (name "osc")
844cb1b6 378 (version "0.165.2")
9a588402
379 (source
380 (origin
41e09a15
JB
381 (method git-fetch)
382 (uri (git-reference
383 (url "https://github.com/openSUSE/osc")
384 (commit version)))
385 (file-name (git-file-name name version))
9a588402 386 (sha256
844cb1b6 387 (base32 "0yjwvbvv9fgkpiyvrag89zxchyn3nbgp9jz0wn5p0z9450zwfyz6"))))
9a588402
388 (build-system python-build-system)
389 (arguments
41e09a15 390 `(#:phases
9a588402 391 (modify-phases %standard-phases
41e09a15 392 (add-after 'install 'fix-filename
9a588402
393 (lambda* (#:key outputs #:allow-other-keys)
394 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
395 ;; Main osc tool is renamed in spec file, not setup.py, let's
396 ;; do that too.
397 (rename-file
398 (string-append bin "osc-wrapper.py")
399 (string-append bin "osc"))
41e09a15 400 #t))))))
9a588402 401 (inputs
41e09a15
JB
402 `(("python-m2crypto" ,python-m2crypto)
403 ("python-pycurl" ,python-pycurl)
52bbf5f7 404 ("rpm" ,rpm))) ; for python-rpm
9a588402
405 (home-page "https://github.com/openSUSE/osc")
406 (synopsis "Open Build Service command line tool")
407 (description "@command{osc} is a command line interface to the Open Build
408Service. It allows you to checkout, commit, perform reviews etc. The vast
409majority of the OBS functionality is available via commands and the rest can
410be reached via direct API calls.")
411 (license license:gpl2+)))
6560c497
YK
412
413(define-public compiledb
414 (package
415 (name "compiledb")
416 (version "0.10.1")
417 (source
418 (origin
419 (method url-fetch)
420 (uri (pypi-uri "compiledb" version))
421 (sha256
422 (base32 "0vlngsdxfakyl8b7rnvn8h3l216lhbrrydr04yhy6kd03zflgfq6"))))
423 (build-system python-build-system)
424 (arguments
425 `(#:phases
426 (modify-phases %standard-phases
427 (add-after 'unpack 'no-compat-shim-dependency
428 ;; shutilwhich is only needed for python 3.3 and earlier
429 (lambda _
430 (substitute* "setup.py" (("^ *'shutilwhich'\n") ""))
431 (substitute* "compiledb/compiler.py" (("shutilwhich") "shutil")))))))
432 (propagated-inputs
433 `(("python-bashlex" ,python-bashlex)
434 ("python-click" ,python-click)))
435 (native-inputs
436 `(("python-pytest" ,python-pytest)))
437 (home-page
438 "https://github.com/nickdiego/compiledb")
439 (synopsis
440 "Generate Clang JSON Compilation Database files for make-based build systems")
441 (description
442 "@code{compiledb} provides a @code{make} python wrapper script which,
443besides executing the make build command, updates the JSON compilation
444database file corresponding to that build, resulting in a command-line
445interface similar to Bear.")
446 (license license:gpl3)))