Merge branch 'master' into core-updates
[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 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages build-tools)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix utils)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system cmake)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages python)
33 #:use-module (gnu packages python-crypto)
34 #:use-module (gnu packages python-web)
35 #:use-module (gnu packages ninja)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system python))
38
39 (define-public bam
40 (package
41 (name "bam")
42 (version "0.4.0")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "http://github.com/downloads/matricks/"
46 "bam/bam-" version ".tar.bz2"))
47 (sha256
48 (base32
49 "0z90wvyd4nfl7mybdrv9dsd4caaikc6fxw801b72gqi1m9q0c0sn"))))
50 (build-system gnu-build-system)
51 (arguments
52 `(#:phases
53 (modify-phases %standard-phases
54 (delete 'configure)
55 (replace 'build
56 (lambda _
57 (zero? (system* "bash" "make_unix.sh"))))
58 (replace 'check
59 (lambda _
60 (zero? (system* "python" "scripts/test.py"))))
61 (replace 'install
62 (lambda* (#:key outputs #:allow-other-keys)
63 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
64 (mkdir-p bin)
65 (install-file "bam" bin)
66 #t))))))
67 (native-inputs
68 `(("python" ,python-2)))
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 meson
102 (package
103 (name "meson")
104 (version "0.47.2")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append "https://github.com/mesonbuild/meson/"
108 "releases/download/" version "/meson-"
109 version ".tar.gz"))
110 (sha256
111 (base32
112 "1swmycf6p9p0ag6yiywyyri42ffkxxj38r2ic7in24km47cszn4j"))))
113 (build-system python-build-system)
114 (arguments
115 `(;; FIXME: Tests require many additional inputs, a fix for the RUNPATH
116 ;; patch in meson-for-build, and patching many hard-coded file system
117 ;; locations in "run_unittests.py".
118 #:tests? #f
119 #:phases (modify-phases %standard-phases
120 ;; Meson calls the various executables in out/bin through the
121 ;; Python interpreter, so we cannot use the shell wrapper.
122 (delete 'wrap))))
123 (inputs `(("ninja" ,ninja)))
124 (propagated-inputs `(("python" ,python)))
125 (home-page "https://mesonbuild.com/")
126 (synopsis "Build system designed to be fast and user-friendly")
127 (description
128 "The Meson build system is focused on user-friendliness and speed.
129 It can compile code written in C, C++, Fortran, Java, Rust, and other
130 languages. Meson provides features comparable to those of the
131 Autoconf/Automake/make combo. Build specifications, also known as @dfn{Meson
132 files}, are written in a custom domain-specific language (@dfn{DSL}) that
133 resembles Python.")
134 (license license:asl2.0)))
135
136 (define-public meson-for-build
137 (package
138 (inherit meson)
139 (name "meson-for-build")
140 (source (origin
141 (inherit (package-source meson))
142 (patches (search-patches "meson-for-build-rpath.patch"))))
143
144 ;; People should probably install "meson", not "meson-for-build".
145 (properties `((hidden? . #t)))))
146
147 (define-public premake4
148 (package
149 (name "premake")
150 (version "4.3")
151 (source (origin
152 (method url-fetch)
153 (uri (string-append "mirror://sourceforge/premake/Premake/"
154 version "/premake-" version "-src.zip"))
155 (sha256
156 (base32
157 "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn"))))
158 (build-system gnu-build-system)
159 (native-inputs
160 `(("unzip" ,unzip))) ; for unpacking the source
161 (arguments
162 `(#:make-flags '("CC=gcc")
163 #:tests? #f ; No test suite
164 #:phases
165 (modify-phases %standard-phases
166 (delete 'configure)
167 (add-after 'unpack 'enter-source
168 (lambda _ (chdir "build/gmake.unix") #t))
169 (replace 'install
170 (lambda* (#:key outputs #:allow-other-keys)
171 (install-file "../../bin/release/premake4"
172 (string-append (assoc-ref outputs "out") "/bin"))
173 #t)))))
174 (synopsis "Portable software build tool")
175 (description "@code{premake4} is a command line utility that reads a
176 scripted definition of a software project and outputs @file{Makefile}s or
177 other lower-level build files.")
178 (home-page "https://premake.github.io")
179 (license license:bsd-3)))
180
181 (define-public osc
182 (package
183 (name "osc")
184 (version "0.162.1")
185 (source
186 (origin
187 (method url-fetch)
188 (uri (string-append "https://github.com/openSUSE/" name
189 "/archive/" version ".tar.gz"))
190 (file-name (string-append name "-" version ".tar.gz"))
191 (sha256
192 (base32 "0b4kpm96ns4smqyfjysbk2p78d36x44xprpna8zz85q1y5xn57aj"))))
193 (build-system python-build-system)
194 (arguments
195 `(#:python ,python-2 ; Module is python2 only.
196 #:phases
197 (modify-phases %standard-phases
198 (add-after 'install 'fix-filename-and-remove-unused
199 (lambda* (#:key outputs #:allow-other-keys)
200 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
201 ;; Main osc tool is renamed in spec file, not setup.py, let's
202 ;; do that too.
203 (rename-file
204 (string-append bin "osc-wrapper.py")
205 (string-append bin "osc"))
206 ;; Remove unused and broken script.
207 (delete-file (string-append bin "osc_hotshot.py"))
208 #t))))))
209 (inputs
210 `(("python2-m2crypto" ,python2-m2crypto)
211 ("python2-pycurl" ,python2-pycurl)
212 ("python2-urlgrabber" ,python2-urlgrabber)))
213 (home-page "https://github.com/openSUSE/osc")
214 (synopsis "Open Build Service command line tool")
215 (description "@command{osc} is a command line interface to the Open Build
216 Service. It allows you to checkout, commit, perform reviews etc. The vast
217 majority of the OBS functionality is available via commands and the rest can
218 be reached via direct API calls.")
219 (license license:gpl2+)))