gnu: aws-checksums: Fix comment formatting.
[jackhill/guix/guix.git] / gnu / packages / c.scm
CommitLineData
a5e2c9a9 1;;; GNU Guix --- Functional package management for GNU
350f50cb 2;;; Copyright © 2016, 2018 Ludovic Courtès <ludo@gnu.org>
d4228481 3;;; Copyright © 2016, 2017, 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
48dafe7d 4;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
07592c77 5;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
40e95456 6;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
c1ea1a94 7;;; Copyright © 2019, 2021 Guillaume Le Vaillant <glv@posteo.net>
4c16ffd3 8;;; Copyright © 2019 Andreas Enge <andreas@enge.fr>
7adb5299 9;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
8eea80d8 10;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
6c273ee4 11;;; Copyright © 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
93c974d1 12;;; Copyright © 2020, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
9d541e97 13;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
1be97fa9 14;;; Copyright © 2021 David Dashyan <mail@davie.li>
a5e2c9a9
LC
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 c)
32 #:use-module ((guix licenses) #:prefix license:)
d4228481 33 #:use-module (guix gexp)
40e95456 34 #:use-module (guix utils)
a5e2c9a9
LC
35 #:use-module (guix packages)
36 #:use-module (guix download)
c229fb3d 37 #:use-module (guix git-download)
5f998a5c 38 #:use-module (guix build-system cmake)
a5e2c9a9 39 #:use-module (guix build-system gnu)
9f088725 40 #:use-module (guix build-system trivial)
7be44e85 41 #:use-module (guix store)
4c66a8de 42 #:use-module (gnu packages)
8eea80d8 43 #:use-module (gnu packages bash)
a5e2c9a9 44 #:use-module (gnu packages bootstrap)
f0316832 45 #:use-module (gnu packages bison)
07592c77 46 #:use-module (gnu packages check)
f0316832 47 #:use-module (gnu packages flex)
a5e2c9a9 48 #:use-module (gnu packages perl)
9f088725 49 #:use-module (gnu packages texinfo)
97b7201f 50 #:use-module (gnu packages guile)
9acf79b2 51 #:use-module (gnu packages lua)
c229fb3d
PN
52 #:use-module (gnu packages multiprecision)
53 #:use-module (gnu packages pcre)
54 #:use-module (gnu packages python)
7def5056 55 #:use-module (gnu packages python-xyz)
c229fb3d
PN
56 #:use-module (gnu packages autotools)
57 #:use-module (gnu packages gettext)
011ec1e5 58 #:use-module (gnu packages pkg-config)
748e2ec0 59 #:use-module (gnu packages tls)
d4228481 60 #:use-module (gnu packages web)
011ec1e5 61 #:use-module (gnu packages xml))
a5e2c9a9
LC
62
63(define-public tcc
64 (package
65 (name "tcc") ;aka. "tinycc"
5d0bd1fb 66 (version "0.9.27")
a5e2c9a9
LC
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "mirror://savannah/tinycc/tcc-"
70 version ".tar.bz2"))
71 (sha256
72 (base32
5d0bd1fb 73 "177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy"))))
a5e2c9a9 74 (build-system gnu-build-system)
8394619b 75 (native-inputs (list perl texinfo))
a5e2c9a9
LC
76 (arguments
77 `(#:configure-flags (list (string-append "--elfinterp="
78 (assoc-ref %build-inputs "libc")
79 ,(glibc-dynamic-linker))
80 (string-append "--crtprefix="
81 (assoc-ref %build-inputs "libc")
82 "/lib")
83 (string-append "--sysincludepaths="
84 (assoc-ref %build-inputs "libc")
85 "/include:"
86 (assoc-ref %build-inputs
ce430bd6 87 "kernel-headers")
a5e2c9a9
LC
88 "/include:{B}/include")
89 (string-append "--libpaths="
90 (assoc-ref %build-inputs "libc")
9117d6df
EF
91 "/lib")
92 ,@(if (string-prefix? "armhf-linux"
93 (or (%current-target-system)
94 (%current-system)))
95 `("--triplet=arm-linux-gnueabihf")
96 '()))
a5e2c9a9 97 #:test-target "test"))
4c16ffd3
AE
98 (native-search-paths
99 (list (search-path-specification
100 (variable "CPATH")
101 (files '("include")))
102 (search-path-specification
103 (variable "LIBRARY_PATH")
104 (files '("lib" "lib64")))))
57a31efb 105 ;; Fails to build on MIPS: "Unsupported CPU"
0270b24b 106 (supported-systems (delete "mips64el-linux" %supported-systems))
a5e2c9a9
LC
107 (synopsis "Tiny and fast C compiler")
108 (description
109 "TCC, also referred to as \"TinyCC\", is a small and fast C compiler
110written in C. It supports ANSI C with GNU and extensions and most of the C99
111standard.")
112 (home-page "http://www.tinycc.org/")
5d0bd1fb
TGR
113 ;; An attempt to re-licence tcc under the Expat licence is underway but not
114 ;; (if ever) complete. See the RELICENSING file for more information.
a5e2c9a9 115 (license license:lgpl2.1+)))
9f088725 116
f0316832
RW
117(define-public pcc
118 (package
119 (name "pcc")
120 (version "20170109")
121 (source (origin
122 (method url-fetch)
123 (uri (string-append "http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-"
124 version ".tgz"))
125 (sha256
126 (base32
127 "1p34w496095mi0473f815w6wbi57zxil106mg7pj6sg6gzpjcgww"))))
128 (build-system gnu-build-system)
129 (arguments
130 `(#:phases
131 (modify-phases %standard-phases
132 (replace 'check
9c30cba4 133 (lambda _ (invoke "make" "-C" "cc/cpp" "test") #t)))))
f0316832 134 (native-inputs
8394619b 135 (list bison flex))
f0316832
RW
136 (synopsis "Portable C compiler")
137 (description
138 "PCC is a portable C compiler. The project goal is to write a C99
139compiler while still keeping it small, simple, fast and understandable.")
140 (home-page "http://pcc.ludd.ltu.se")
6a052473 141 (supported-systems (delete "aarch64-linux" %supported-systems))
f0316832
RW
142 ;; PCC incorporates code under various BSD licenses; for new code bsd-2 is
143 ;; preferred. See http://pcc.ludd.ltu.se/licenses/ for more details.
144 (license (list license:bsd-2 license:bsd-3))))
c229fb3d
PN
145
146(define-public libbytesize
147 (package
148 (name "libbytesize")
e48390cb 149 (version "2.2")
c229fb3d
PN
150 (source (origin
151 (method url-fetch)
152 (uri (string-append
94617bdd
TGR
153 "https://github.com/storaged-project/libbytesize/releases/"
154 "download/" version "/libbytesize-" version ".tar.gz"))
c229fb3d
PN
155 (sha256
156 (base32
e48390cb 157 "1aivwypmnqcaj2230pifvf3jcgl5chja8rspkxf0j3480asm8g5r"))))
c229fb3d 158 (build-system gnu-build-system)
bf6859e4 159 (arguments
2414997a 160 `(#:tests? #f))
c229fb3d
PN
161 (native-inputs
162 `(("gettext" ,gettext-minimal)
163 ("pkg-config" ,pkg-config)
164 ("python" ,python)))
165 (inputs
8394619b 166 (list mpfr pcre2))
c229fb3d
PN
167 (home-page "https://github.com/storaged-project/libbytesize")
168 (synopsis "Tiny C library for working with arbitrary big sizes in bytes")
169 (description
170 "The goal of this project is to provide a tiny library that would
171facilitate the common operations with sizes in bytes. Many projects need to
172work with sizes in bytes (be it sizes of storage space, memory...) and all of
173them need to deal with the same issues like:
174
175@itemize
176@item How to get a human-readable string for the given size?
177@item How to store the given size so that no significant information is lost?
178@item If we store the size in bytes, what if the given size gets over the
179MAXUINT64 value?
180@item How to interpret sizes entered by users according to their locale and
181typing conventions?
182@item How to deal with the decimal/binary units (MB versus MiB) ambiguity?
183@end itemize
184
185@code{libbytesize} offers a generally usable solution that could be used by
186every project that needs to deal with sizes in bytes. It is written in the C
187language with thin bindings for other languages.")
188 (license license:lgpl2.1+)))
011ec1e5
RW
189
190(define-public udunits
191 (package
192 (name "udunits")
0dca2e63
TGR
193 ;; Four-part version numbers are development snapshots, not releases. See
194 ;; <https://github.com/Unidata/UDUNITS-2/issues/99#issuecomment-732323472>.
48dafe7d 195 (version "2.2.28")
011ec1e5
RW
196 (source (origin
197 (method url-fetch)
198 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/udunits/"
199 "udunits-" version ".tar.gz"))
200 (sha256
201 (base32
48dafe7d 202 "17jpbp6f0rr132jn2gqy8ry8mv1w27v6dyhfq1igv8v1674aw2sr"))))
011ec1e5 203 (build-system gnu-build-system)
2a7dce4f
TGR
204 (arguments
205 `(#:configure-flags
206 (list "--disable-static")))
011ec1e5 207 (inputs
8394619b 208 (list expat))
011ec1e5
RW
209 (home-page "https://www.unidata.ucar.edu/software/udunits/")
210 (synopsis "C library for units of physical quantities and value-conversion utils")
211 (description
212 "The UDUNITS-2 package provides support for units of physical quantities.
213Its three main components are:
214
215@enumerate
216@item @code{udunits2lib}, a C library for units of physical quantities;
217@item @code{udunits2prog}, a utility for obtaining the definition of a unit
218 and for converting numeric values between compatible units; and
219@item an extensive database of units.
220@end enumerate\n")
221 ;; Like the BSD-3 license but with an extra anti patent clause.
222 (license (license:non-copyleft "file://COPYRIGHT"))))
07592c77
PN
223
224(define-public libfixposix
225 (package
226 (name "libfixposix")
227 (version "0.4.3")
228 (home-page "https://github.com/sionescu/libfixposix")
229 (source
230 (origin
231 (method git-fetch)
232 (uri (git-reference
233 (url home-page)
234 (commit (string-append "v" version))))
235 (file-name (git-file-name name version))
236 (sha256
237 (base32
238 "1x4q6yspi5g2s98vq4qszw4z3zjgk9l5zs8471w4d4cs6l97w08j"))))
239 (build-system gnu-build-system)
240 (native-inputs
8394619b 241 (list autoconf automake libtool pkg-config check))
07592c77
PN
242 (synopsis "Thin wrapper over POSIX syscalls")
243 (description
244 "The purpose of libfixposix is to offer replacements for parts of POSIX
245whose behaviour is inconsistent across *NIX flavours.")
246 (license license:boost1.0)))
f170603e
GLV
247
248(define-public libhx
249 (package
250 (name "libhx")
a7e73852 251 (version "4.2")
f170603e
GLV
252 (source
253 (origin
254 (method url-fetch)
29b9c2e6 255 (uri (string-append "https://inai.de/files/libhx/"
f170603e
GLV
256 "libHX-" version ".tar.xz"))
257 (sha256
a7e73852 258 (base32 "1ri3sxiw5a8br27j7f20s40kihfvq6mmxzcrx68zydiwyxjvf5jj"))))
f170603e 259 (build-system gnu-build-system)
29b9c2e6 260 (home-page "https://inai.de/projects/libhx/")
f170603e
GLV
261 (synopsis "C library with common data structures and functions")
262 (description
263 "This is a C library (with some C++ bindings available) that provides data
264structures and functions commonly needed, such as maps, deques, linked lists,
265string formatting and autoresizing, option and config file parsing, type
266checking casts and more.")
267 (license license:lgpl2.1+)))
7adb5299 268
9acf79b2
MC
269(define-public libwuya
270 ;; This commit is the one before "wuy_pool.h" was removed from libwuya,
271 ;; which libleak currently requires.
272 (let ((revision "1")
273 (commit "883502041044f4616cfbf75c8f2bb60059f704a9"))
274 (package
275 (name "libwuya")
276 (version (git-version "0.0" revision commit))
277 (source (origin
278 (method git-fetch)
279 (uri (git-reference
280 (url "https://github.com/WuBingzheng/libwuya")
281 (commit commit)))
282 (file-name (git-file-name name version))
283 (sha256
284 (base32
285 "1xrsqbgr13g2v0ag165ryp7xrwzv41xfygzk2a3445ca98c1qpdc"))))
286 (build-system gnu-build-system)
287 (arguments
288 `(#:tests? #f ;no test suite
289 #:phases (modify-phases %standard-phases
290 (add-after 'unpack 'patch-lua-includes
291 (lambda _
292 (substitute* '("wuy_cflua.h" "wuy_cflua.c")
293 (("<lua5\\.1/") "<"))
294 #t))
295 (add-after 'unpack 'add--fPIC-to-CFLAGS
296 (lambda _
297 (substitute* "Makefile"
298 (("CFLAGS[^\n]*" all)
299 (string-append all " -fPIC")))
300 #t))
301 (add-before 'build 'set-CC
302 (lambda _
303 (setenv "CC" "gcc")
304 #t))
305 (delete 'configure) ;no configure script
306 (replace 'install
307 (lambda* (#:key outputs #:allow-other-keys)
308 (let* ((out (assoc-ref outputs "out"))
309 (include-dir (string-append out "/include"))
310 (headers (find-files "." "\\.h$")))
311 (for-each (lambda (h)
312 (install-file h include-dir))
313 headers)
314 (install-file "libwuya.a" (string-append out "/lib"))
315 #t))))))
8394619b 316 (inputs (list lua))
9acf79b2
MC
317 (home-page "https://github.com/WuBingzheng/libwuya/")
318 (synopsis "C library implementing various data structures")
319 (description "The @code{libwuya} library implements data structures such
320as dictionaries, skip lists, and memory pools.")
321 ;; There is no clear information as to what license this is distributed
322 ;; under, but it is included (bundled) with libleak from the same author
323 ;; under the GNU GPL v2 or later license, so use this here until it is
324 ;; clarified (see: https://github.com/WuBingzheng/libwuya/issues/2).
325 (license license:gpl2+))))
326
d1c6b097
MB
327(define-public packcc
328 (package
329 (name "packcc")
8eea80d8
MB
330 (version "1.5.0")
331 (home-page "https://github.com/arithy/packcc")
d1c6b097
MB
332 (source (origin
333 (method git-fetch)
334 (uri (git-reference
335 (url home-page)
336 (commit (string-append "v" version))))
337 (file-name (git-file-name name version))
338 (sha256
339 (base32
8eea80d8 340 "1n9ivsa6b9ps2jbh34bycjqjpbwbk85l4jjg46pfhqxzz96793wy"))))
d1c6b097
MB
341 (build-system gnu-build-system)
342 (arguments
8eea80d8 343 '(#:phases (modify-phases %standard-phases
d1c6b097 344 (delete 'configure)
8eea80d8
MB
345 (add-before 'build 'chdir
346 (lambda _
347 (chdir "build/gcc")))
348 (add-before 'check 'pre-check
349 (lambda _
350 (setenv "CC" "gcc")
351 ;; The style tests are supposed to be skipped when
352 ;; uncrustify is unavailable, but a stray version
353 ;; check prevents it from working. This can be
354 ;; removed for future versions of PackCC.
355 (substitute* "../../tests/style.d/style.bats"
356 (("^[[:blank:]]+check_uncrustify_version")
357 ""))))
d1c6b097
MB
358 (replace 'install
359 (lambda* (#:key outputs #:allow-other-keys)
360 (let ((out (assoc-ref outputs "out")))
8eea80d8
MB
361 (install-file "release/bin/packcc"
362 (string-append out "/bin"))
363 (install-file "../../README.md"
d1c6b097
MB
364 (string-append out "/share/doc/packcc"))
365 #t))))))
8eea80d8 366 (native-inputs
8394619b 367 (list bats))
d1c6b097
MB
368 (synopsis "Packrat parser generator for C")
369 (description
370 "PackCC is a packrat parser generator for the C programming language.
371Its main features are:
372@itemize
373@item Generates a parser in C from a grammar described in a PEG.
374@item Gives your parser great efficiency by packrat parsing.
375@item Supports direct and indirect left-recursive grammar rules.
376@end itemize
377The grammar of your parser can be described in a @acronym{PEG, Parsing
378Expression Grammar}. The PEG is a top-down parsing language, and is similar
379to the regular-expression grammar. The PEG does not require tokenization to
380be a separate step, and tokenization rules can be written in the same way as
381any other grammar rules.")
382 (license license:expat)))
383
7adb5299
JN
384(define-public sparse
385 (package
386 (name "sparse")
08e32249 387 (version "0.6.4")
7adb5299
JN
388 (source (origin
389 (method url-fetch)
390 (uri
391 (string-append "mirror://kernel.org/software/devel/sparse/dist/"
392 "sparse-" version ".tar.xz"))
393 (sha256
394 (base32
08e32249 395 "0z1qds52144nvsdnl82r3zs3vax618v920jmffyyssmwj54qpcka"))))
7adb5299 396 (build-system gnu-build-system)
8394619b 397 (inputs (list perl))
7adb5299
JN
398 (arguments
399 '(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out")))
400 #:phases (modify-phases %standard-phases
401 (delete 'configure)
402 (add-after 'unpack 'patch-cgcc
403 (lambda _
404 (substitute* "cgcc"
08e32249 405 (("'cc'") (string-append "'" (which "gcc") "'"))))))))
7adb5299
JN
406 (synopsis "Semantic C parser for Linux development")
407 (description
408 "Sparse is a semantic parser for C and is required for Linux development.
409It provides a compiler frontend capable of parsing most of ANSI C as well as
410many GCC extensions, and a collection of sample compiler backends, including a
411static analyzer also called @file{sparse}. Sparse provides a set of
412annotations designed to convey semantic information about types, such as what
413address space pointers point to, or what locks a function acquires or
414releases.")
415 (home-page "https://sparse.wiki.kernel.org/index.php/Main_Page")
416 (license license:expat)))
70a49ef7
KCB
417
418(define-public libestr
419 (package
420 (name "libestr")
421 (version "0.1.11")
422 (source
423 (origin
424 (method git-fetch)
425 (uri (git-reference
b0e7b699 426 (url "https://github.com/rsyslog/libestr")
70a49ef7
KCB
427 (commit (string-append "v" version))))
428 (file-name (git-file-name name version))
429 (sha256
430 (base32
431 "1ca4rj90c0dn7kqpbcchkflxjw88a7rxcnwbr0gply4a28i01nd8"))))
432 (build-system gnu-build-system)
433 (arguments
434 `(#:phases
435 (modify-phases %standard-phases
436 ;; autogen.sh calls configure at the end of the script.
437 (replace 'bootstrap
438 (lambda _ (invoke "autoreconf" "-vfi"))))))
439 (native-inputs
8394619b 440 (list autoconf automake pkg-config libtool))
70a49ef7
KCB
441 (home-page "https://github.com/rsyslog/libestr")
442 (synopsis "Helper functions for handling strings")
443 (description
444 "This C library contains some essential string manipulation functions and
445more, like escaping special characters.")
446 (license license:lgpl2.1+)))
0aee6e51
KCB
447
448(define-public libfastjson
449 (package
450 (name "libfastjson")
362d4787 451 (version "0.99.9")
0aee6e51
KCB
452 (source
453 (origin
454 (method git-fetch)
455 (uri (git-reference
b0e7b699 456 (url "https://github.com/rsyslog/libfastjson")
0aee6e51
KCB
457 (commit (string-append "v" version))))
458 (file-name (git-file-name name version))
459 (sha256
362d4787 460 (base32 "12rqcdqxazw8czzxbivdapdgj19pcswpw1jp2915sxbljis83g6q"))))
0aee6e51
KCB
461 (build-system gnu-build-system)
462 (native-inputs
8394619b 463 (list autoconf automake libtool))
0aee6e51
KCB
464 (home-page "https://github.com/rsyslog/libfastjson")
465 (synopsis "Fast JSON library for C")
466 (description
467 "libfastjson is a fork from json-c aiming to provide: a small library
468with essential JSON handling functions, sufficiently good JSON support (not
469100% standards compliant), and very fast processing.")
470 (license license:expat)))
7def5056
KCB
471
472(define-public liblogging
473 (package
474 (name "liblogging")
475 (version "1.0.6")
476 (source
477 (origin
478 (method git-fetch)
479 (uri (git-reference
b0e7b699 480 (url "https://github.com/rsyslog/liblogging")
7def5056
KCB
481 (commit (string-append "v" version))))
482 (file-name (git-file-name name version))
483 (sha256
484 (base32
485 "1l32m0y65svf5vxsgw935jnqs6842rcqr56dmzwqvr00yfrjhjkp"))))
486 (build-system gnu-build-system)
487 (arguments
488 `(#:phases
489 (modify-phases %standard-phases
490 ;; autogen.sh calls configure at the end of the script.
491 (replace 'bootstrap
492 (lambda _ (invoke "autoreconf" "-vfi"))))))
493 (native-inputs
8394619b
LC
494 (list autoconf
495 automake
496 pkg-config
497 libtool
498 ;; For rst2man.py
499 python-docutils))
7def5056
KCB
500 (home-page "https://github.com/rsyslog/liblogging")
501 (synopsis "Easy to use and lightweight signal-safe logging library")
502 (description
503 "Liblogging is an easy to use library for logging. It offers an enhanced
504replacement for the syslog() call, but retains its ease of use.")
505 (license license:bsd-2)))
5bc13b8e 506
d4228481
KCB
507(define-public liblognorm
508 (package
509 (name "liblognorm")
510 (version "2.0.6")
511 (source
512 (origin
513 (method git-fetch)
514 (uri (git-reference
515 (url "https://github.com/rsyslog/liblognorm.git")
516 (commit (string-append "v" version))))
517 (file-name (git-file-name name version))
518 (sha256
519 (base32
520 "1pyy1swvq6jj12aqma42jimv71z8m66zy6ydd5v19cp2azm4krml"))))
521 (build-system gnu-build-system)
522 (arguments
523 (list
524 #:parallel-tests? #false ;not supported
525 #:phases
526 '(modify-phases %standard-phases
527 ;; These tests fail because tmp.rulebase is never created. This
528 ;; looks rather harmless.
529 (add-after 'unpack 'delete-failing-tests
530 (lambda _
531 (substitute* "tests/Makefile.am"
532 (("string_rb_simple.sh ") "")
533 (("string_rb_simple_2_lines.sh ") "")))))))
534 (inputs
535 (list json-c libestr libfastjson))
536 (native-inputs
537 (list autoconf automake libtool pkg-config))
538 (home-page "https://www.liblognorm.com")
539 (synopsis "Fast samples-based log normalization library")
540 (description
541 "Liblognorm normalizes event data into well-defined name-value pairs and
542a set of tags describing the message.")
543 ;; liblognorm is very slowly transitioning to ASL2.0
544 ;; See https://github.com/rsyslog/liblognorm/issues/329
545 (license license:lgpl2.1+)))
546
5bc13b8e
MC
547(define-public unifdef
548 (package
549 (name "unifdef")
550 (version "2.12")
551 (source (origin
552 (method url-fetch)
553 ;; https://dotat.at/prog/unifdef/unifdef-2.12.tar.xz
554 (uri (string-append "https://dotat.at/prog/" name "/"
555 name "-" version ".tar.xz"))
556 (sha256
557 (base32
558 "00647bp3m9n01ck6ilw6r24fk4mivmimamvm4hxp5p6wxh10zkj3"))
559 (modules '((guix build utils)))
560 (snippet
561 '(begin (delete-file-recursively "FreeBSD")
562 (delete-file-recursively "win32")
563 #t))))
564 (build-system gnu-build-system)
565 (arguments
566 `(#:phases (modify-phases %standard-phases
567 (delete 'configure))
40e95456
EF
568 #:make-flags (list (string-append "CC=" ,(cc-for-target))
569 (string-append "prefix=" %output))
5bc13b8e
MC
570 #:tests? #f)) ;no test suite
571 (native-inputs
8394619b 572 (list perl))
5bc13b8e
MC
573 (home-page "https://dotat.at/prog/unifdef/")
574 (synopsis "Utility to selectively processes conditional C preprocessor")
575 (description "The @command{unifdef} utility selectively processes
576conditional C preprocessor @code{#if} and @code{#ifdef} directives. It
577removes from a file both the directives and the additional text that they
578delimit, while otherwise leaving the file alone. It can be useful for
579avoiding distractions when studying code that uses @code{#ifdef} heavily for
580portability.")
581 (license (list license:bsd-2 ;all files except...
582 license:bsd-3)))) ;...the unidef.1 manual page
5f998a5c
GH
583
584(define-public aws-c-common
585 (package
586 (name "aws-c-common")
acbf5b10 587 ;; Update only when updating aws-crt-cpp.
f796dc92 588 (version "0.6.20")
5f998a5c
GH
589 (source (origin
590 (method git-fetch)
591 (uri (git-reference
592 (url (string-append "https://github.com/awslabs/" name))
593 (commit (string-append "v" version))))
594 (file-name (git-file-name name version))
595 (sha256
596 (base32
f796dc92 597 "089grcj58n4xs41kmnpaqpwsalcisjbqqb5yqahxxyfx2lf1j9c9"))))
5f998a5c 598 (build-system cmake-build-system)
9d541e97
GH
599 (arguments
600 '(#:configure-flags
601 '("-DBUILD_SHARED_LIBS=ON")))
5f998a5c 602 (synopsis "Amazon Web Services core C library")
acbf5b10 603 (supported-systems '("i686-linux" "x86_64-linux"))
5f998a5c
GH
604 (description
605 "This library provides common C99 primitives, configuration, data
606 structures, and error handling for the @acronym{AWS,Amazon Web Services} SDK.")
607 (home-page "https://github.com/awslabs/aws-c-common")
608 (license license:asl2.0)))
4c66a8de
GH
609
610(define-public aws-checksums
611 (package
612 (name "aws-checksums")
a9b4d69c 613 ;; Update only when updating aws-crt-cpp.
1ea17412 614 (version "0.1.12")
4c66a8de
GH
615 (source (origin
616 (method git-fetch)
617 (uri (git-reference
618 (url (string-append "https://github.com/awslabs/" name))
619 (commit (string-append "v" version))))
620 (file-name (git-file-name name version))
621 (sha256
622 (base32
14f54059 623 "054f2hkmkxhw83q7zsz349k82xk6bkrvlsab088pf7kn9wd4hy4k"))))
4c66a8de 624 (build-system cmake-build-system)
cc95d03e
GH
625 (arguments
626 '(#:configure-flags
14f54059
GH
627 (list "-DBUILD_SHARED_LIBS=ON"
628 (string-append "-DCMAKE_PREFIX_PATH="
629 (assoc-ref %build-inputs "aws-c-common")))))
4c66a8de 630 (inputs
8394619b 631 (list aws-c-common))
4c66a8de
GH
632 (synopsis "Amazon Web Services checksum library")
633 (description
634 "This library provides cross-Platform hardware accelerated CRC32c and CRC32
635with fallback to efficient C99 software implementations.")
636 (home-page "https://github.com/awslabs/aws-checksums")
637 (license license:asl2.0)))
ddab5244
GH
638
639(define-public aws-c-event-stream
640 (package
641 (name "aws-c-event-stream")
963ebbc6 642 ; Update only when updating aws-crt-cpp.
97190845 643 (version "0.2.7")
ddab5244
GH
644 (source (origin
645 (method git-fetch)
646 (uri (git-reference
647 (url (string-append "https://github.com/awslabs/" name))
648 (commit (string-append "v" version))))
649 (file-name (git-file-name name version))
650 (sha256
651 (base32
963ebbc6 652 "0xwwr7gdgfrphk6j7vk12rgimfim6m4qnj6hg8hgg16cplhvsfzh"))))
ddab5244 653 (build-system cmake-build-system)
97190845
GH
654 (arguments
655 '(#:configure-flags
963ebbc6
GH
656 (list "-DBUILD_SHARED_LIBS=ON"
657 (string-append "-DCMAKE_PREFIX_PATH="
658 (assoc-ref %build-inputs "aws-c-common")))))
ddab5244 659 (propagated-inputs
8394619b 660 (list aws-c-common aws-c-io aws-checksums))
ddab5244 661 (inputs
8394619b 662 (list aws-c-cal s2n))
ddab5244
GH
663 (synopsis "Amazon Web Services client-server message format library")
664 (description
665 "This library is a C99 implementation for @acronym{AWS,Amazon Web Services}
666event stream encoding, a binary format for bidirectional client-server
667communication.")
668 (home-page "https://github.com/awslabs/aws-c-event-stream")
669 (license license:asl2.0)))
748e2ec0 670
8ea7b6f9
GH
671(define-public aws-c-io
672 (package
673 (name "aws-c-io")
2a32dedf 674 ; Update only when updating aws-crt-cpp.
7c45af91 675 (version "0.10.20")
8ea7b6f9
GH
676 (source (origin
677 (method git-fetch)
678 (uri (git-reference
679 (url (string-append "https://github.com/awslabs/" name))
680 (commit (string-append "v" version))))
681 (file-name (git-file-name name version))
682 (sha256
683 (base32
7c45af91 684 "07l5rfbm1irkigfv51sfygs992af8rxicmay97frbx6z21khdjnr"))))
8ea7b6f9
GH
685 (build-system cmake-build-system)
686 (arguments
687 '(#:configure-flags
2a32dedf
GH
688 (list "-DBUILD_SHARED_LIBS=ON"
689 (string-append "-DCMAKE_PREFIX_PATH="
690 (assoc-ref %build-inputs "aws-c-common"))
691 "-DENABLE_NET_TESTS=OFF")))
8ea7b6f9 692 (propagated-inputs
8394619b 693 (list aws-c-cal aws-c-common s2n))
8ea7b6f9
GH
694 (synopsis "Event driven framework for implementing application protocols")
695 (description "This library provides a C99 framework for constructing
696event-driven, asynchronous network application protocols.")
697 (home-page "https://github.com/awslabs/aws-c-io")
698 (license license:asl2.0)))
699
748e2ec0
GH
700(define-public aws-c-cal
701 (package
702 (name "aws-c-cal")
4ff5cd6b 703 ; Update only when updating aws-crt-cpp.
139970c8 704 (version "0.5.17")
748e2ec0
GH
705 (source (origin
706 (method git-fetch)
707 (uri (git-reference
708 (url (string-append "https://github.com/awslabs/" name))
709 (commit (string-append "v" version))))
710 (file-name (git-file-name name version))
711 (sha256
712 (base32
139970c8 713 "0gd7xfzv509vcysifzfa8j2rykkc1prhiry7953snblkzm7airm5"))))
748e2ec0
GH
714 (build-system cmake-build-system)
715 (arguments
716 '(#:configure-flags
4ff5cd6b
GH
717 (list "-DBUILD_SHARED_LIBS=ON"
718 (string-append "-DCMAKE_PREFIX_PATH="
719 (assoc-ref %build-inputs "aws-c-common")))))
748e2ec0 720 (propagated-inputs
8394619b 721 (list aws-c-common))
748e2ec0
GH
722 (inputs
723 `(("openssl" ,openssl)
724 ("openssl:static" ,openssl "static")))
725 (synopsis "Amazon Web Services Crypto Abstraction Layer")
726 (description "This library provides a C99 wrapper for hash, HMAC, and ECC
727cryptographic primitives for the @acronym{AWS,Amazon Web Services} SDK.")
728 (home-page "https://github.com/awslabs/aws-c-cal")
729 (license license:asl2.0)))
1be97fa9 730
4bd4c53a
GH
731(define-public aws-c-sdkutils
732 (package
733 (name "aws-c-sdkutils")
734 ; Update only when updating aws-crt-cpp.
735 (version "0.1.2")
736 (source (origin
737 (method git-fetch)
738 (uri (git-reference
739 (url (string-append "https://github.com/awslabs/" name))
740 (commit (string-append "v" version))))
741 (file-name (git-file-name name version))
742 (sha256
743 (base32
744 "14wpl3dxwjbbzas44v6m6m3ll89rgz34x9gb140qz624gwzs9v0v"))))
745 (build-system cmake-build-system)
746 (arguments
747 '(#:configure-flags
748 (list "-DBUILD_SHARED_LIBS=ON"
749 (string-append "-DCMAKE_PREFIX_PATH="
750 (assoc-ref %build-inputs "aws-c-common")))))
751 (propagated-inputs
752 (list aws-c-common))
753 (synopsis "Amazon Web Service utility library")
754 (description "This library provides for parsing and management of profiles
755for the @acronym{AWS,Amazon Web Services} SDK.")
756 (home-page "https://github.com/awslabs/aws-c-sdkutils")
757 (license license:asl2.0)))
758
1be97fa9
DD
759(define-public pcl
760 (package
761 (name "pcl")
762 (version "1.12")
763 (source
764 (origin
765 (method url-fetch)
766 (uri (string-append
767 "http://www.xmailserver.org/pcl-" version ".tar.gz"))
768 (sha256
769 (base32
770 "06ly65rq4iyj2p4704i215c8y4rgspwl8sxfaifmf4ahfr30bcz7"))))
771 (build-system gnu-build-system)
772 (home-page "http://www.xmailserver.org/libpcl.html")
773 (synopsis "Portable Coroutine Library")
774 (description "The @acronym{PCL, Portable Coroutine Library} implements the
775low level functionality for coroutines.")
776 (license license:gpl2+)))
d9b8cfd6
GH
777
778(define-public aws-c-http
779 (package
780 (name "aws-c-http")
1a0ed460 781 ; Update only when updating aws-crt-cpp.
fbf14355 782 (version "0.6.13")
d9b8cfd6
GH
783 (source (origin
784 (method git-fetch)
785 (uri (git-reference
786 (url (string-append "https://github.com/awslabs/" name))
787 (commit (string-append "v" version))))
788 (file-name (git-file-name name version))
789 (sha256
790 (base32
fbf14355 791 "125glc9b3906r95519zqfbzzz6wj5ib4im2n45yxrigwkkpffbq9"))))
d9b8cfd6
GH
792 (build-system cmake-build-system)
793 (arguments
794 '(#:configure-flags
1a0ed460
GH
795 (list "-DBUILD_SHARED_LIBS=ON"
796 (string-append "-DCMAKE_PREFIX_PATH="
797 (assoc-ref %build-inputs "aws-c-common"))
798 "-DENABLE_NET_TESTS=OFF")))
d9b8cfd6 799 (propagated-inputs
8394619b 800 (list aws-c-compression aws-c-io))
d9b8cfd6
GH
801 (synopsis "Amazon Web Services HTTP library")
802 (description
803 "This library provides a C99 implementation of the HTTP/1.1 and HTTP/2
804specifications.")
805 (home-page "https://github.com/awslabs/aws-c-http")
806 (license license:asl2.0)))
2069238c
GH
807
808(define-public aws-c-compression
809 (package
810 (name "aws-c-compression")
cff8a12a
GH
811 ; Update only when updating aws-crt-cpp.
812 (version "0.2.14")
2069238c
GH
813 (source (origin
814 (method git-fetch)
815 (uri (git-reference
816 (url (string-append "https://github.com/awslabs/" name))
817 (commit (string-append "v" version))))
818 (file-name (git-file-name name version))
819 (sha256
820 (base32
cff8a12a 821 "0fs3zhhzxsb9nfcjpvfbcq79hal7si2ia1c09scab9a8m264f4vd"))))
2069238c
GH
822 (build-system cmake-build-system)
823 (arguments
824 '(#:configure-flags
cff8a12a
GH
825 (list "-DBUILD_SHARED_LIBS=ON"
826 (string-append "-DCMAKE_PREFIX_PATH="
827 (assoc-ref %build-inputs "aws-c-common")))))
2069238c 828 (propagated-inputs
8394619b 829 (list aws-c-common))
2069238c
GH
830 (synopsis "Amazon Web Services compression library")
831 (description
832 "This library provides a C99 implementation of compression algorithms,
833currently limited to Huffman encoding and decoding.")
834 (home-page "https://github.com/awslabs/aws-c-compression")
835 (license license:asl2.0)))
1f1bb634
GH
836
837(define-public aws-c-auth
838 (package
839 (name "aws-c-auth")
05be89ac 840 ; Update only when updating aws-crt-cpp.
d2cb3f99 841 (version "0.6.11")
1f1bb634
GH
842 (source (origin
843 (method git-fetch)
844 (uri (git-reference
845 (url (string-append "https://github.com/awslabs/" name))
846 (commit (string-append "v" version))))
847 (file-name (git-file-name name version))
848 (sha256
849 (base32
d2cb3f99 850 "0frfnbifkrib9l68mj92a3g1x8xc8hpdlzbga2a801zgf2flx4fy"))
1f1bb634
GH
851 (patches
852 (search-patches
05be89ac 853 "aws-c-auth-install-private-headers.patch"))))
1f1bb634
GH
854 (build-system cmake-build-system)
855 (arguments
856 '(#:configure-flags
05be89ac
GH
857 (list "-DBUILD_SHARED_LIBS=ON"
858 (string-append "-DCMAKE_PREFIX_PATH="
859 (assoc-ref %build-inputs "aws-c-common"))
860 "-DENABLE_NET_TESTS=OFF")))
1f1bb634 861 (propagated-inputs
d2cb3f99 862 (list aws-c-cal aws-c-common aws-c-http aws-c-io aws-c-sdkutils))
1f1bb634
GH
863 (synopsis "Amazon Web Services client-side authentication library")
864 (description
865 "This library provides a C99 implementation for AWS client-side
866authentication.")
867 (home-page "https://github.com/awslabs/aws-c-auth")
868 (license license:asl2.0)))
b3c1c37d
GH
869
870(define-public aws-c-s3
871 (package
872 (name "aws-c-s3")
2d613547 873 ; Update only when updating aws-crt-cpp.
4773664e 874 (version "0.1.38")
b3c1c37d
GH
875 (source (origin
876 (method git-fetch)
877 (uri (git-reference
878 (url (string-append "https://github.com/awslabs/" name))
879 (commit (string-append "v" version))))
880 (file-name (git-file-name name version))
881 (sha256
882 (base32
4773664e 883 "0n2y8hzb1bx3vnzlpb5hsav18dg33pwav0mpji6krz98y2l8msya"))))
b3c1c37d
GH
884 (build-system cmake-build-system)
885 (arguments
886 '(#:configure-flags
2d613547
GH
887 (list "-DBUILD_SHARED_LIBS=ON"
888 (string-append "-DCMAKE_PREFIX_PATH="
889 (assoc-ref %build-inputs "aws-c-common"))
890 "-DENABLE_NET_TESTS=OFF")))
b3c1c37d 891 (propagated-inputs
4773664e 892 (list aws-c-auth aws-c-http aws-checksums))
b3c1c37d
GH
893 (synopsis "Amazon Web Services client library for Amazon S3")
894 (description
895 "This library provides a C99 client implementation of the Simple Storage
896Service (S3) protocol for object storage.")
897 (home-page "https://github.com/awslabs/aws-c-s3")
898 (license license:asl2.0)))
2a0fcc31
GH
899
900(define-public aws-c-mqtt
901 (package
902 (name "aws-c-mqtt")
d5c9f52a 903 ; Update only when updating aws-crt-cpp.
fe75dc25 904 (version "0.7.10")
2a0fcc31
GH
905 (source (origin
906 (method git-fetch)
907 (uri (git-reference
908 (url (string-append "https://github.com/awslabs/" name))
909 (commit (string-append "v" version))))
910 (file-name (git-file-name name version))
911 (sha256
912 (base32
fe75dc25 913 "0qmzx8b4wcsq9s99q2zrhx1s3jdmfy8zs16qys9bqv45gspi3ybr"))))
2a0fcc31
GH
914 (build-system cmake-build-system)
915 (arguments
916 '(#:configure-flags
d5c9f52a
GH
917 (list "-DBUILD_SHARED_LIBS=ON"
918 (string-append "-DCMAKE_PREFIX_PATH="
919 (assoc-ref %build-inputs "aws-c-common")))))
2a0fcc31 920 (propagated-inputs
8394619b 921 (list aws-c-http aws-c-io))
2a0fcc31
GH
922 (synopsis "Amazon Web Services MQTT library")
923 (description
924 "This library provides a C99 implementation of the Message Queuing
925Telemetry Transport (MQTT) publish-subscribe messaging protocol.")
926 (home-page "https://github.com/awslabs/aws-c-mqtt")
927 (license license:asl2.0)))
93c974d1 928
7be44e85
MC
929;;; Factored out of the ck package so that it can be adjusted and called on
930;;; the host side easily, without impacting the package definition.
931(define (gnu-triplet->ck-machine target)
932 (letrec-syntax
933 ((matches (syntax-rules (=>)
934 ((_ (target-prefix => machine) rest ...)
935 (if (string-prefix? target-prefix target)
936 machine
937 (matches rest ...)))
938 ((_)
939 (error "unsupported target" target)))))
940 ;; This basically reproduces the logic handling the
941 ;; PLATFORM variable in the configure script of ck.
942 (matches ("x86_64" => "x86_64")
943 ("i586" => "x86")
944 ("i686" => "x86")
945 ("aarch64" => "aarch64")
946 ("arm" => "arm")
947 ("ppc64" => "ppc64")
948 ("ppc" => "ppc")
949 ("s390x" => "s390x")
950 ("sparc64" => "sparcv9"))))
951
952(define-public ck
953 (package
954 (name "ck")
955 (version "0.7.1")
956 (source (origin
957 (method git-fetch)
958 (uri (git-reference
959 (url "https://github.com/concurrencykit/ck")
960 (commit version)))
961 (file-name (git-file-name name version))
962 (sha256
963 (base32
964 "020yzfpvymdc8lc44znlnxmxb8mvp42g4nb4p8k814klazqvwh0x"))))
965 (build-system gnu-build-system)
966 (arguments
967 (list
968 #:phases
969 #~(modify-phases %standard-phases
970 (replace 'configure
971 ;; ck uses a custom configure script that stumbles on
972 ;; '--enable-fast-install', among other things.
973 (lambda* (#:key parallel-build? #:allow-other-keys)
974 (define target-machine #$(and=> (%current-target-system)
975 gnu-triplet->ck-machine))
976 (when target-machine
977 ;; The configure script doesn't currently work for
978 ;; cross-compiling (see:
979 ;; https://github.com/concurrencykit/ck/issues/191).
980 (error "ck cannot currently be cross-compiled"))
981 ;; The custom configure script doesn't make cross-compilation
982 ;; adjustments itself, so manually set the archiver, compiler
983 ;; and linker.
984 (setenv "AR" #$(ar-for-target))
985 (setenv "CC" #$(cc-for-target))
986 (setenv "LD" #$(ld-for-target))
987 (apply invoke "./configure"
988 `(,@(if target-machine
989 (list (string-append "--profile=" target-machine))
990 '())
991 ,(string-append "--prefix=" #$output)
992 ,(string-append "--mandir=" #$output "/share/man")
993 ,(string-append "--cores="
994 (if parallel-build?
995 (number->string (parallel-job-count))
996 "1")))))))))
997 (home-page "https://github.com/concurrencykit/ck")
998 (synopsis "C library for concurrent systems")
999 (description "Concurrency Kit (@code{ck}) provides concurrency primitives,
1000safe memory reclamation mechanisms and non-blocking (including lock-free) data
1001structures designed to aid in the research, design and implementation of high
1002performance concurrent systems developed in C99+.")
1003 (license (list license:bsd-2 ;everything except...
1004 license:asl2.0)))) ;src/ck_hp.c
1005
93c974d1
MC
1006(define-public utf8-h
1007 ;; The latest tag is used as there is no release.
1008 (let ((commit "500d4ea9f4c3449e5243c088d8af8700f7189734")
1009 (revision "0"))
1010 (package
1011 (name "utf8-h")
1012 (version (git-version "0.0.0" revision commit))
1013 (source (origin
1014 (method git-fetch)
1015 (uri (git-reference
1016 (url "https://github.com/sheredom/utf8.h")
1017 (commit commit)))
1018 (file-name (git-file-name "utf8.h" version))
1019 (sha256
1020 (base32
1021 "0x9f7ivww8c7cigf4ck0hfx2bm79qgx6q4ccwzqbzkrmcrl9shfb"))))
1022 (build-system cmake-build-system)
1023 (arguments
1024 `(#:phases
1025 (modify-phases %standard-phases
1026 (delete 'build)
1027 (delete 'configure)
1028 (replace 'check
1029 (lambda* (#:key tests? #:allow-other-keys)
1030 (when tests?
1031 (with-directory-excursion "test"
1032 (invoke "cmake" ".")
1033 (invoke "make")))))
1034 (replace 'install
1035 (lambda* (#:key outputs #:allow-other-keys)
1036 (let ((out (assoc-ref outputs "out")))
1037 (install-file "utf8.h" (string-append out "/include"))))))))
1038 (home-page "https://github.com/sheredom/utf8.h")
1039 (synopsis "Single header UTF-8 string functions for C and C++")
1040 (description "A simple one header solution to supporting UTF-8 strings in
1041C and C++. The functions it provides are like those from the C header
1042string.h, but with a utf8* prefix instead of the str* prefix.")
1043 (license license:unlicense))))