gnu: webkitgtk: Update to 2.28.2.
[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 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages build-tools)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix utils)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages lua)
38 #:use-module (gnu packages package-management)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages python-crypto)
41 #:use-module (gnu packages python-web)
42 #:use-module (gnu packages ninja)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system python))
45
46 (define-public bam
47 (package
48 (name "bam")
49 (version "0.5.1")
50 (source (origin
51 ;; do not use auto-generated tarballs
52 (method git-fetch)
53 (uri (git-reference
54 (url "https://github.com/matricks/bam.git")
55 (commit (string-append "v" version))))
56 (file-name (git-file-name name version))
57 (sha256
58 (base32
59 "13br735ig7lygvzyfd15fc2rdygrqm503j6xj5xkrl1r7w2wipq6"))))
60 (build-system gnu-build-system)
61 (arguments
62 `(#:make-flags `("CC=gcc"
63 ,(string-append "INSTALL_PREFIX="
64 (assoc-ref %outputs "out")))
65 #:test-target "test"
66 #:phases
67 (modify-phases %standard-phases
68 (delete 'configure))))
69 (native-inputs
70 `(("python" ,python-2)))
71 (inputs
72 `(("lua" ,lua)))
73 (home-page "https://matricks.github.io/bam/")
74 (synopsis "Fast and flexible build system")
75 (description "Bam is a fast and flexible build system. Bam uses Lua to
76 describe the build process. It takes its inspiration for the script files
77 from scons. While scons focuses on being 100% correct when building, bam
78 makes a few sacrifices to acquire fast full and incremental build times.")
79 (license license:bsd-3)))
80
81 (define-public bear
82 (package
83 (name "bear")
84 (version "2.4.3")
85 (source (origin
86 (method git-fetch)
87 (uri (git-reference
88 (url "https://github.com/rizsotto/Bear")
89 (commit version)))
90 (file-name (git-file-name name version))
91 (sha256
92 (base32
93 "19fk4flfykbzhb89ppmzqf0zlrkbjm6ajl9fsayndj9km5ys0041"))))
94 (build-system cmake-build-system)
95 (inputs
96 `(("python" ,python-wrapper)))
97 (home-page "https://github.com/rizsotto/Bear")
98 (synopsis "Tool for generating a compilation database")
99 (description "A JSON compilation database is used in the Clang project to
100 provide information on how a given compilation unit is processed. With this,
101 it is easy to re-run the compilation with alternate programs. Bear is used to
102 generate such a compilation database.")
103 (license license:gpl3+)))
104
105 (define-public gn
106 (let ((commit "ec938ddaa276646eb8f1ab33e160c156011d8217")
107 (revision "1736")) ;as returned by `git describe`, used below
108 (package
109 (name "gn")
110 (version (git-version "0.0" revision commit))
111 (home-page "https://gn.googlesource.com/gn")
112 (source (origin
113 (method git-fetch)
114 (uri (git-reference (url home-page) (commit commit)))
115 (sha256
116 (base32
117 "0j1qjwp2biw12s6npzpx4z8nvih7pyn68q6cz2k4700bk9y0d574"))
118 (file-name (git-file-name name version))))
119 (build-system gnu-build-system)
120 (arguments
121 `(#:phases (modify-phases %standard-phases
122 (add-before 'configure 'set-build-environment
123 (lambda _
124 (setenv "CC" "gcc") (setenv "CXX" "g++")
125 (setenv "AR" "ar")
126 #t))
127 (replace 'configure
128 (lambda _
129 (invoke "python" "build/gen.py"
130 "--no-last-commit-position")))
131 (add-after 'configure 'create-last-commit-position
132 (lambda _
133 ;; Create "last_commit_position.h" to avoid a dependency
134 ;; on 'git' (and the checkout..).
135 (call-with-output-file "out/last_commit_position.h"
136 (lambda (port)
137 (format port
138 (string-append
139 "#define LAST_COMMIT_POSITION_NUM ~a\n"
140 "#define LAST_COMMIT_POSITION \"~a (~a)\"\n")
141 ,revision ,revision ,(string-take commit 8))
142 #t))))
143 (replace 'build
144 (lambda _
145 (invoke "ninja" "-C" "out" "gn"
146 "-j" (number->string (parallel-job-count)))))
147 (replace 'check
148 (lambda* (#:key (tests? #t) #:allow-other-keys)
149 (if tests?
150 (lambda ()
151 (invoke "ninja" "-C" "out" "gn_unittests"
152 "-j" (number->string (parallel-job-count)))
153 (invoke "./out/gn_unittests"))
154 (format #t "test suite not run~%"))))
155 (replace 'install
156 (lambda* (#:key outputs #:allow-other-keys)
157 (let ((out (assoc-ref outputs "out")))
158 (install-file "out/gn" (string-append out "/bin"))
159 #t))))))
160 (native-inputs
161 `(("ninja" ,ninja)
162 ("python" ,python-2)))
163 (synopsis "Generate Ninja build files")
164 (description
165 "GN is a tool that collects information about a project from @file{.gn}
166 files and generates build instructions for the Ninja build system.")
167 ;; GN is distributed as BSD-3, but bundles some files from ICU using the
168 ;; X11 license.
169 (license (list license:bsd-3 license:x11)))))
170
171 (define-public meson
172 (package
173 (name "meson")
174 (version "0.50.1")
175 (source (origin
176 (method url-fetch)
177 (uri (string-append "https://github.com/mesonbuild/meson/"
178 "releases/download/" version "/meson-"
179 version ".tar.gz"))
180 (sha256
181 (base32
182 "1k2fw5qk4mqjcb4j5dhp8xfn0caqphb11yh8zkw7v9w01kb5d3zn"))))
183 (build-system python-build-system)
184 (arguments
185 `(;; FIXME: Tests require many additional inputs, a fix for the RUNPATH
186 ;; patch in meson-for-build, and patching many hard-coded file system
187 ;; locations in "run_unittests.py".
188 #:tests? #f
189 #:phases (modify-phases %standard-phases
190 ;; Meson calls the various executables in out/bin through the
191 ;; Python interpreter, so we cannot use the shell wrapper.
192 (delete 'wrap))))
193 (inputs `(("ninja" ,ninja)))
194 (propagated-inputs `(("python" ,python)))
195 (home-page "https://mesonbuild.com/")
196 (synopsis "Build system designed to be fast and user-friendly")
197 (description
198 "The Meson build system is focused on user-friendliness and speed.
199 It can compile code written in C, C++, Fortran, Java, Rust, and other
200 languages. Meson provides features comparable to those of the
201 Autoconf/Automake/make combo. Build specifications, also known as @dfn{Meson
202 files}, are written in a custom domain-specific language (@dfn{DSL}) that
203 resembles Python.")
204 (license license:asl2.0)))
205
206 (define-public meson-for-build
207 (package
208 (inherit meson)
209 (name "meson-for-build")
210 (source (origin
211 (inherit (package-source meson))
212 (patches (search-patches "meson-for-build-rpath.patch"))))
213
214 ;; People should probably install "meson", not "meson-for-build".
215 (properties `((hidden? . #t)))))
216
217 (define-public premake4
218 (package
219 (name "premake")
220 (version "4.3")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append "mirror://sourceforge/premake/Premake/"
224 version "/premake-" version "-src.zip"))
225 (sha256
226 (base32
227 "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn"))))
228 (build-system gnu-build-system)
229 (native-inputs
230 `(("unzip" ,unzip))) ; for unpacking the source
231 (arguments
232 `(#:make-flags '("CC=gcc")
233 #:tests? #f ; No test suite
234 #:phases
235 (modify-phases %standard-phases
236 (delete 'configure)
237 (add-after 'unpack 'enter-source
238 (lambda _ (chdir "build/gmake.unix") #t))
239 (replace 'install
240 (lambda* (#:key outputs #:allow-other-keys)
241 (install-file "../../bin/release/premake4"
242 (string-append (assoc-ref outputs "out") "/bin"))
243 #t)))))
244 (synopsis "Portable software build tool")
245 (description "@code{premake4} is a command line utility that reads a
246 scripted definition of a software project and outputs @file{Makefile}s or
247 other lower-level build files.")
248 (home-page "https://premake.github.io")
249 (license license:bsd-3)))
250
251 (define-public premake5
252 (package
253 (inherit premake4)
254 (version "5.0.0-alpha14")
255 (source (origin
256 (method url-fetch)
257 (uri (string-append "https://github.com/premake/premake-core/"
258 "releases/download/v" version
259 "/premake-" version "-src.zip"))
260 (sha256
261 (base32
262 "0236s7bjvxf7x1l5faywmfzjywflpx42ngyhkn0mqqjnh54a97vw"))))
263 (arguments
264 (substitute-keyword-arguments (package-arguments premake4)
265 ((#:phases phases)
266 `(modify-phases ,phases
267 (replace 'install
268 (lambda* (#:key outputs #:allow-other-keys)
269 (install-file "../../bin/release/premake5"
270 (string-append (assoc-ref outputs "out") "/bin"))
271 #t))))))
272 (description "@code{premake5} is a command line utility that reads a
273 scripted definition of a software project and outputs @file{Makefile}s or
274 other lower-level build files.")))
275
276 (define-public osc
277 (package
278 (name "osc")
279 (version "0.165.2")
280 (source
281 (origin
282 (method git-fetch)
283 (uri (git-reference
284 (url "https://github.com/openSUSE/osc")
285 (commit version)))
286 (file-name (git-file-name name version))
287 (sha256
288 (base32 "0yjwvbvv9fgkpiyvrag89zxchyn3nbgp9jz0wn5p0z9450zwfyz6"))))
289 (build-system python-build-system)
290 (arguments
291 `(#:phases
292 (modify-phases %standard-phases
293 (add-after 'install 'fix-filename
294 (lambda* (#:key outputs #:allow-other-keys)
295 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
296 ;; Main osc tool is renamed in spec file, not setup.py, let's
297 ;; do that too.
298 (rename-file
299 (string-append bin "osc-wrapper.py")
300 (string-append bin "osc"))
301 #t))))))
302 (inputs
303 `(("python-m2crypto" ,python-m2crypto)
304 ("python-pycurl" ,python-pycurl)
305 ("rpm" ,rpm))) ; for python-rpm
306 (home-page "https://github.com/openSUSE/osc")
307 (synopsis "Open Build Service command line tool")
308 (description "@command{osc} is a command line interface to the Open Build
309 Service. It allows you to checkout, commit, perform reviews etc. The vast
310 majority of the OBS functionality is available via commands and the rest can
311 be reached via direct API calls.")
312 (license license:gpl2+)))