gnu: openttd: Update to 1.10.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>
3ad0a358 7;;; Copyright © 2018 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>
33f79a74
RW
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)
f85af5ab 33 #:use-module (guix git-download)
71dab08d 34 #:use-module (guix build-system cmake)
33f79a74 35 #:use-module (gnu packages)
c97cef0a 36 #:use-module (gnu packages compression)
53367e17 37 #:use-module (gnu packages lua)
41e09a15 38 #:use-module (gnu packages package-management)
33f79a74 39 #:use-module (gnu packages python)
9a588402
40 #:use-module (gnu packages python-crypto)
41 #:use-module (gnu packages python-web)
162dd290
CB
42 #:use-module (gnu packages ninja)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system python))
33f79a74
RW
45
46(define-public bam
47 (package
48 (name "bam")
53367e17 49 (version "0.5.1")
33f79a74 50 (source (origin
53367e17
AV
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))
33f79a74
RW
57 (sha256
58 (base32
53367e17 59 "13br735ig7lygvzyfd15fc2rdygrqm503j6xj5xkrl1r7w2wipq6"))))
33f79a74
RW
60 (build-system gnu-build-system)
61 (arguments
53367e17
AV
62 `(#:make-flags `("CC=gcc"
63 ,(string-append "INSTALL_PREFIX="
64 (assoc-ref %outputs "out")))
65 #:test-target "test"
66 #:phases
33f79a74 67 (modify-phases %standard-phases
53367e17 68 (delete 'configure))))
33f79a74
RW
69 (native-inputs
70 `(("python" ,python-2)))
53367e17
AV
71 (inputs
72 `(("lua" ,lua)))
33f79a74
RW
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
76describe the build process. It takes its inspiration for the script files
77from scons. While scons focuses on being 100% correct when building, bam
78makes a few sacrifices to acquire fast full and incremental build times.")
79 (license license:bsd-3)))
162dd290 80
71dab08d
FT
81(define-public bear
82 (package
83 (name "bear")
da567fc8 84 (version "2.4.3")
71dab08d 85 (source (origin
f85af5ab
TGR
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))
71dab08d
FT
91 (sha256
92 (base32
da567fc8 93 "19fk4flfykbzhb89ppmzqf0zlrkbjm6ajl9fsayndj9km5ys0041"))))
71dab08d 94 (build-system cmake-build-system)
73d85423
FT
95 (inputs
96 `(("python" ,python-wrapper)))
71dab08d
FT
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
100provide information on how a given compilation unit is processed. With this,
101it is easy to re-run the compilation with alternate programs. Bear is used to
102generate such a compilation database.")
103 (license license:gpl3+)))
104
3ad0a358 105(define-public gn
d9227245
MB
106 (let ((commit "6e5ba2e7210823cf7ccce3eb2a23336a4e7f1349")
107 (revision "1666")) ;as returned by `git describe`, used below
3ad0a358
MB
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
d9227245 117 "157ax65sixjm0i1j89wvny48v1mbsl4pbvv5vqinjc6r0fryaf2r"))
3ad0a358
MB
118 (file-name (git-file-name name version))))
119 (build-system gnu-build-system)
120 (arguments
97b672d9 121 `(#:phases (modify-phases %standard-phases
3ad0a358
MB
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 _
ebee2f47 129 (invoke "python" "build/gen.py"
3ad0a358
MB
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 "#define LAST_COMMIT_POSITION \"~a (~a)\"\n"
139 ,revision ,(string-take commit 8))
140 #t))))
141 (replace 'build
142 (lambda _
143 (invoke "ninja" "-C" "out" "gn"
144 "-j" (number->string (parallel-job-count)))))
97b672d9
MB
145 (replace 'check
146 (lambda* (#:key (tests? #t) #:allow-other-keys)
147 (if tests?
148 (lambda ()
149 (invoke "ninja" "-C" "out" "gn_unittests"
150 "-j" (number->string (parallel-job-count)))
151 (invoke "./out/gn_unittests"))
152 (format #t "test suite not run~%"))))
3ad0a358
MB
153 (replace 'install
154 (lambda* (#:key outputs #:allow-other-keys)
155 (let ((out (assoc-ref outputs "out")))
156 (install-file "out/gn" (string-append out "/bin"))
157 #t))))))
158 (native-inputs
159 `(("ninja" ,ninja)
160 ("python" ,python-2)))
161 (synopsis "Generate Ninja build files")
162 (description
163 "GN is a tool that collects information about a project from @file{.gn}
164files and generates build instructions for the Ninja build system.")
165 ;; GN is distributed as BSD-3, but bundles some files from ICU using the
166 ;; X11 license.
167 (license (list license:bsd-3 license:x11)))))
168
162dd290
CB
169(define-public meson
170 (package
171 (name "meson")
fd3594bf 172 (version "0.50.1")
162dd290
CB
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "https://github.com/mesonbuild/meson/"
a47ed096
RW
176 "releases/download/" version "/meson-"
177 version ".tar.gz"))
162dd290
CB
178 (sha256
179 (base32
fd3594bf 180 "1k2fw5qk4mqjcb4j5dhp8xfn0caqphb11yh8zkw7v9w01kb5d3zn"))))
162dd290 181 (build-system python-build-system)
b14a04b2 182 (arguments
3f6c185e
MB
183 `(;; FIXME: Tests require many additional inputs, a fix for the RUNPATH
184 ;; patch in meson-for-build, and patching many hard-coded file system
185 ;; locations in "run_unittests.py".
186 #:tests? #f
187 #:phases (modify-phases %standard-phases
b14a04b2
MB
188 ;; Meson calls the various executables in out/bin through the
189 ;; Python interpreter, so we cannot use the shell wrapper.
190 (delete 'wrap))))
c695fb76 191 (inputs `(("ninja" ,ninja)))
67f8ba11 192 (propagated-inputs `(("python" ,python)))
162dd290
CB
193 (home-page "https://mesonbuild.com/")
194 (synopsis "Build system designed to be fast and user-friendly")
195 (description
196 "The Meson build system is focused on user-friendliness and speed.
197It can compile code written in C, C++, Fortran, Java, Rust, and other
198languages. Meson provides features comparable to those of the
199Autoconf/Automake/make combo. Build specifications, also known as @dfn{Meson
6c4da3b7
TGR
200files}, are written in a custom domain-specific language (@dfn{DSL}) that
201resembles Python.")
162dd290 202 (license license:asl2.0)))
c97cef0a 203
dab666cd
PM
204(define-public meson-for-build
205 (package
206 (inherit meson)
207 (name "meson-for-build")
dab666cd 208 (source (origin
d3155863 209 (inherit (package-source meson))
dab666cd
PM
210 (patches (search-patches "meson-for-build-rpath.patch"))))
211
212 ;; People should probably install "meson", not "meson-for-build".
213 (properties `((hidden? . #t)))))
214
c97cef0a
OP
215(define-public premake4
216 (package
217 (name "premake")
218 (version "4.3")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append "mirror://sourceforge/premake/Premake/"
222 version "/premake-" version "-src.zip"))
223 (sha256
224 (base32
225 "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn"))))
226 (build-system gnu-build-system)
227 (native-inputs
228 `(("unzip" ,unzip))) ; for unpacking the source
229 (arguments
230 `(#:make-flags '("CC=gcc")
231 #:tests? #f ; No test suite
232 #:phases
233 (modify-phases %standard-phases
234 (delete 'configure)
235 (add-after 'unpack 'enter-source
236 (lambda _ (chdir "build/gmake.unix") #t))
237 (replace 'install
238 (lambda* (#:key outputs #:allow-other-keys)
239 (install-file "../../bin/release/premake4"
240 (string-append (assoc-ref outputs "out") "/bin"))
241 #t)))))
242 (synopsis "Portable software build tool")
243 (description "@code{premake4} is a command line utility that reads a
244scripted definition of a software project and outputs @file{Makefile}s or
245other lower-level build files.")
246 (home-page "https://premake.github.io")
247 (license license:bsd-3)))
9a588402 248
fcafee61
LP
249(define-public premake5
250 (package
251 (inherit premake4)
252 (version "5.0.0-alpha14")
253 (source (origin
254 (method url-fetch)
255 (uri (string-append "https://github.com/premake/premake-core/"
256 "releases/download/v" version
257 "/premake-" version "-src.zip"))
258 (sha256
259 (base32
260 "0236s7bjvxf7x1l5faywmfzjywflpx42ngyhkn0mqqjnh54a97vw"))))
261 (arguments
262 (substitute-keyword-arguments (package-arguments premake4)
263 ((#:phases phases)
264 `(modify-phases ,phases
265 (replace 'install
266 (lambda* (#:key outputs #:allow-other-keys)
267 (install-file "../../bin/release/premake5"
268 (string-append (assoc-ref outputs "out") "/bin"))
269 #t))))))
270 (description "@code{premake5} is a command line utility that reads a
271scripted definition of a software project and outputs @file{Makefile}s or
272other lower-level build files.")))
273
9a588402
274(define-public osc
275 (package
276 (name "osc")
844cb1b6 277 (version "0.165.2")
9a588402
278 (source
279 (origin
41e09a15
JB
280 (method git-fetch)
281 (uri (git-reference
282 (url "https://github.com/openSUSE/osc")
283 (commit version)))
284 (file-name (git-file-name name version))
9a588402 285 (sha256
844cb1b6 286 (base32 "0yjwvbvv9fgkpiyvrag89zxchyn3nbgp9jz0wn5p0z9450zwfyz6"))))
9a588402
287 (build-system python-build-system)
288 (arguments
41e09a15 289 `(#:phases
9a588402 290 (modify-phases %standard-phases
41e09a15 291 (add-after 'install 'fix-filename
9a588402
292 (lambda* (#:key outputs #:allow-other-keys)
293 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
294 ;; Main osc tool is renamed in spec file, not setup.py, let's
295 ;; do that too.
296 (rename-file
297 (string-append bin "osc-wrapper.py")
298 (string-append bin "osc"))
41e09a15 299 #t))))))
9a588402 300 (inputs
41e09a15
JB
301 `(("python-m2crypto" ,python-m2crypto)
302 ("python-pycurl" ,python-pycurl)
52bbf5f7 303 ("rpm" ,rpm))) ; for python-rpm
9a588402
304 (home-page "https://github.com/openSUSE/osc")
305 (synopsis "Open Build Service command line tool")
306 (description "@command{osc} is a command line interface to the Open Build
307Service. It allows you to checkout, commit, perform reviews etc. The vast
308majority of the OBS functionality is available via commands and the rest can
309be reached via direct API calls.")
310 (license license:gpl2+)))