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