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