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