projects/guix·blob python-team · refs

2313 lines · 93.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016, 2018 Ludovic Courtès <[email protected]>
3;;; Copyright © 2016, 2017, 2018, 2019, 2021 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2018, 2020–2022 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2018, 2019 Pierre Neidhardt <[email protected]>
6;;; Copyright © 2019, 2020, 2022-2025 Efraim Flashner <[email protected]>
7;;; Copyright © 2019, 2021 Guillaume Le Vaillant <[email protected]>
8;;; Copyright © 2019 Andreas Enge <[email protected]>
9;;; Copyright © 2020, 2025 Janneke Nieuwenhuizen <[email protected]>
10;;; Copyright © 2020, 2021 Marius Bakke <[email protected]>
11;;; Copyright © 2020 Katherine Cox-Buday <[email protected]>
12;;; Copyright © 2020, 2022, 2023, 2025 Maxim Cournoyer <[email protected]>
13;;; Copyright © 2020, 2021 Greg Hogan <[email protected]>
14;;; Copyright © 2021 David Dashyan <[email protected]>
15;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
16;;; Copyright © 2022 (unmatched parenthesis <[email protected]>
17;;; Copyright © 2022, 2025, 2026 Artyom V. Poptsov <[email protected]>
18;;; Copyright © 2022 Ekaitz Zarraga <[email protected]>
19;;; Copyright © 2022 ( <[email protected]>
20;;; Copyright © 2022 Antero Mejr <[email protected]>
21;;; Copyright © 2023 zamfofex <[email protected]>
22;;; Copyright © 2023, 2024 Foundation Devices, Inc. <[email protected]>
23;;; Copyright © 2023, 2024 David Elsing <[email protected]>
24;;; Copyright @ 2022, Kitzman <[email protected]>
25;;; Copyright @ 2025 Dariqq <[email protected]>
26;;; Copyright © 2025, 2026 Ashish SHUKLA <[email protected]>
27;;; Copyright © 2026 Cayetano Santos <[email protected]>
28;;; Copyright © 2026 Sharlatan Hellseher <[email protected]>
29;;; Copyright © 2026 Sughosha <[email protected]>
30;;; Copyright © 2026 Jelle Licht <[email protected]>
31;;;
32;;; This file is part of GNU Guix.
33;;;
34;;; GNU Guix is free software; you can redistribute it and/or modify it
35;;; under the terms of the GNU General Public License as published by
36;;; the Free Software Foundation; either version 3 of the License, or (at
37;;; your option) any later version.
38;;;
39;;; GNU Guix is distributed in the hope that it will be useful, but
40;;; WITHOUT ANY WARRANTY; without even the implied warranty of
41;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42;;; GNU General Public License for more details.
43;;;
44;;; You should have received a copy of the GNU General Public License
45;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46
47(define-module (gnu packages c)
48 #:use-module ((guix licenses) #:prefix license:)
49 #:use-module (guix gexp)
50 #:use-module (guix utils)
51 #:use-module (guix packages)
52 #:use-module (guix deprecation)
53 #:use-module (guix download)
54 #:use-module (guix git-download)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system copy)
57 #:use-module (guix build-system gnu)
58 #:use-module (guix build-system meson)
59 #:use-module (guix build-system pyproject)
60 #:use-module (guix store)
61 #:use-module (gnu packages)
62 #:use-module (gnu packages base)
63 #:use-module (gnu packages bash)
64 #:use-module (gnu packages bdw-gc)
65 #:use-module (gnu packages bootstrap)
66 #:use-module (gnu packages bison)
67 #:use-module (gnu packages check)
68 #:use-module (gnu packages compiler-tools)
69 #:use-module (gnu packages compression)
70 #:use-module (gnu packages gawk)
71 #:use-module (gnu packages gcc)
72 #:use-module (gnu packages perl)
73 #:use-module (gnu packages texinfo)
74 #:use-module (gnu packages guile)
75 #:use-module (gnu packages llvm)
76 #:use-module (gnu packages lua)
77 #:use-module (gnu packages m4)
78 #:use-module (gnu packages multiprecision)
79 #:use-module (gnu packages ncurses)
80 #:use-module (gnu packages oneapi)
81 #:use-module (gnu packages pcre)
82 #:use-module (gnu packages python)
83 #:use-module (gnu packages python-build)
84 #:use-module (gnu packages python-xyz)
85 #:use-module (gnu packages autotools)
86 #:use-module (gnu packages gettext)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages sqlite)
89 #:use-module (gnu packages text-editors)
90 #:use-module (gnu packages tls)
91 #:use-module (gnu packages web)
92 #:use-module (gnu packages xml))
93
94(define-public c-intro-and-ref
95 (let ((revision "1")
96 (commit "4a8cc3c3b2e9db9056ec44e3ef3434067f47f5f9"))
97 (package
98 (name "c-intro-and-ref")
99 (version (git-version "0.1" revision commit))
100 (source (origin
101 (method git-fetch)
102 (uri (git-reference
103 (url "https://git.savannah.gnu.org/git/c-intro-and-ref.git")
104 (commit commit)))
105 (file-name (git-file-name name version))
106 (sha256
107 (base32
108 "1qrldk5x2pm5v77kbca2k7c48m2mc7jmwhs50rqhlq9ispsvkir0"))))
109 (build-system copy-build-system)
110 (arguments
111 (list #:phases #~(modify-phases %standard-phases
112 (add-after 'unpack 'build
113 (lambda* (#:key parallel-build? #:allow-other-keys)
114 (substitute* "Makefile"
115 (("makeinfo c.texi")
116 "makeinfo --no-split c.texi"))
117 (invoke "make" "c.info" "c.html"
118 "-j" (number->string
119 (if parallel-build?
120 (parallel-job-count)
121 1))))))
122 #:install-plan ''(("c.info" "share/info/")
123 ("c.html" "share/doc/"))))
124 (native-inputs (list texinfo))
125 (home-page "https://www.gnu.org/")
126 (synopsis "GNU C Language Intro and Reference")
127 (description "This manual explains the C language for use with the GNU
128Compiler Collection (GCC) on the GNU/Linux system and other systems. We refer
129to this dialect as GNU C. If you already know C, you can use this as a
130reference manual.")
131 (license license:fdl1.3+))))
132
133(define-public c-rrb
134 (let ((commit "d908617ff84515af90c454ff4d0f98675ae6b456")
135 (revision "0"))
136 (package
137 (name "c-rrb")
138 (version (git-version "0.1.0" revision commit))
139 (source (origin
140 (method git-fetch)
141 (uri (git-reference
142 (url "https://github.com/hypirion/c-rrb")
143 (commit commit)))
144 (file-name (git-file-name name version))
145 (sha256
146 (base32 "0zmha3xi80vgdcwzb4vwdllf97dvggjpjfgahrpsb5f5qi3yshxa"))))
147 (build-system gnu-build-system)
148 (arguments
149 (list #:configure-flags
150 #~(list (string-append
151 "CFLAGS=-g -O2"
152 " -Wno-error=incompatible-pointer-types"))))
153 (inputs (list libgc))
154 (native-inputs (list autoconf automake libtool))
155 (home-page "https://github.com/hypirion/c-rrb")
156 (synopsis "Relaxed Radix Balanced Trees")
157 (description "Relaxed Radix Balanced Trees are an immutable vector-like
158data structure with good performance characteristics for concatenation and
159slicing.")
160 (license license:boost1.0))))
161
162(define-public c-sbsv
163 (package
164 (name "c-sbsv")
165 (version "0.3.1")
166 (source
167 (origin
168 (method git-fetch)
169 (uri (git-reference
170 (url "https://github.com/hsh814/sbsv")
171 (commit (string-append "v" version))))
172 (file-name (git-file-name name version))
173 (sha256
174 (base32 "0wgqb7j2slp05zm6s2qqsb5821vzz1w3jdcwsn2k3jfj7mylnryq"))
175 (modules '((guix build utils)))
176 (snippet #~(begin ;remove the separate Python library
177 (delete-file-recursively "sbsv")
178 (delete-file-recursively "tests")
179 (delete-file "MANIFEST.in")
180 (delete-file "pyproject.toml")
181 (delete-file "setup.cfg")
182 (delete-file "setup.py")
183 (delete-file "uv.lock")))))
184 (build-system cmake-build-system)
185 (arguments
186 (list #:phases
187 #~(modify-phases %standard-phases
188 (add-after 'unpack 'change-directory
189 (lambda _ (chdir "libsbsv")))
190 (add-after 'change-directory 'prefer-dynamic-build
191 (lambda _
192 (substitute* "CMakeLists.txt"
193 (("\\<STATIC\\>") "SHARED")))))))
194 (home-page "https://github.com/hsh814/sbsv")
195 (synopsis "Square bracket separated values")
196 (description
197 "This C library provides a schema-driven structured log data format
198for the ease of writing and parsing.")
199 (license license:expat)))
200
201(define-public c-siphash
202 (package
203 (name "c-siphash")
204 (version "1.1.0")
205 (source
206 (origin
207 (method git-fetch)
208 (uri (git-reference
209 (url "https://github.com/c-util/c-siphash")
210 (commit (string-append "v" version))))
211 (file-name (git-file-name name version))
212 (sha256
213 (base32 "1igz5nbdm8l0hir5azmjcc46qz9qhrhkr656fzll99vsnja815sb"))))
214 (build-system meson-build-system)
215 (native-inputs
216 (list pkg-config))
217 (propagated-inputs
218 (list c-stdaux))
219 (home-page "https://c-util.github.io/c-siphash/")
220 (synopsis "Streaming-capable SipHash")
221 (description
222 "The c-siphash project is a standalone implementation of SipHash in
223Standard ISO-C11. It provides a streaming-capable API to compute data hashes
224according to the SipHash algorithm. For API documentation, see the
225@code{c-siphash.h} header file, as well as the docbook comments for each function.")
226 (license (list license:asl2.0
227 license:lgpl2.1+))))
228
229(define-public c-stdaux
230 (package
231 (name "c-stdaux")
232 (version "1.6.0")
233 (source
234 (origin
235 (method git-fetch)
236 (uri (git-reference
237 (url "https://github.com/c-util/c-stdaux")
238 (commit (string-append "v" version))))
239 (file-name (git-file-name name version))
240 (sha256
241 (base32 "0kj03iw2sfy3ni6s4p810wkaj561bl8fqqgzyvb48llnkyi6appz"))))
242 (build-system meson-build-system)
243 (home-page "https://c-util.github.io/c-stdaux/")
244 (synopsis "Auxiliary macros and functions for the C standard library")
245 (description
246 "This package provides support macros and auxiliary functions around
247the functionality of common C standard libraries. This includes helpers for
248the ISO C Standard Library, but also other common specifications like POSIX or
249common extended features of widespread compilers like @code{gcc} and
250@code{clang}.")
251 (license (list license:asl2.0
252 license:lgpl2.1+))))
253
254(define-public cproc
255 (let ((commit "d1c53ddf56571573a7025324c8dd5c6d547a4d1f")
256 (revision "4"))
257 (package
258 (name "cproc")
259 (version (git-version "0.0" revision commit))
260 (source
261 (origin
262 (method git-fetch)
263 (uri (git-reference
264 (url "https://git.sr.ht/~mcf/cproc")
265 (commit commit)))
266 (file-name (git-file-name name version))
267 (sha256
268 (base32 "1mca1wna724acjz0mj7sw6ls00zjvh7mni3v14bvaf0dilqfbp5v"))))
269 (build-system gnu-build-system)
270 (arguments
271 (list
272 #:make-flags
273 #~(list (string-append "CC=" #$(cc-for-target))
274 (string-append "PREFIX=" #$output))
275 #:phases
276 #~(modify-phases %standard-phases
277 (replace 'configure
278 (lambda* (#:key inputs #:allow-other-keys)
279 (let ((gcc-lib (assoc-ref inputs "gcc:lib"))
280 (host-system #$(nix-system->gnu-triplet (%current-system)))
281 (target-system #$(nix-system->gnu-triplet
282 (or (%current-target-system)
283 (%current-system)))))
284 (invoke "./configure"
285 (string-append "--prefix="
286 #$output)
287 (string-append "--host=" host-system)
288 (string-append "--target=" target-system)
289 (string-append "--with-as="
290 (search-input-file inputs
291 (string-append
292 "/bin/"
293 #$(as-for-target))))
294 (string-append "--with-ld="
295 (string-append
296 (search-input-file inputs
297 (string-append
298 "/bin/"
299 #$(ld-for-target))))
300 " "
301 ;; Contrary to other distros, the glibc
302 ;; files are not in the standard ld(1)
303 ;; search path on Guix. cproc only allows
304 ;; us to specify the gcc libdir; hence, we
305 ;; change the default linkflags.
306 "-L"
307 (dirname
308 (search-input-file inputs "/lib/libc.so")))
309 (string-append "--with-ldso="
310 (search-input-file inputs
311 #$(glibc-dynamic-linker)))
312 (string-append "--with-cpp="
313 (search-input-file inputs "/bin/cpp"))
314 (string-append "--with-qbe="
315 (search-input-file inputs "/bin/qbe"))
316 (string-append "--with-gcc-libdir="
317 (dirname (car (find-files gcc-lib
318 "crtbegin\\.o")))))))))))
319 (inputs `(("qbe" ,qbe)
320 ("gcc:lib" ,gcc "lib")))
321 (supported-systems (list "x86_64-linux" "aarch64-linux"))
322 (synopsis "Simple C11 compiler backed by QBE")
323 (description
324 "@code{cproc} is a C compiler using QBE as a backend,
325 supporting most of C11 along with some GCC and C2x extensions.")
326 (home-page "https://sr.ht/~mcf/cproc")
327 (license license:expat))))
328
329(define-public hdrhistogram-c
330 (package
331 (name "hdrhistogram-c")
332 (version "0.11.10")
333 (source
334 (origin
335 (method git-fetch)
336 (uri (git-reference
337 (url "https://github.com/HdrHistogram/HdrHistogram_c")
338 (commit version)))
339 (file-name (git-file-name name version))
340 (sha256 (base32
341 "1y72lxxlqjr7sw0614qx3pfmw8wz191dgjagh5dhsf5izgp67iic"))
342 (patches (search-patches "hdrhistogram-c-no-avx2-on-i386.patch"))))
343 (build-system cmake-build-system)
344 (arguments
345 (list
346 #:configure-flags
347 #~(if #$(target-ppc32?)
348 (list "-DCMAKE_EXE_LINKER_FLAGS=-latomic"
349 "-DCMAKE_SHARED_LINKER_FLAGS=-latomic")
350 '())))
351 (inputs (list zlib))
352 (home-page "https://github.com/HdrHistogram/HdrHistogram_c")
353 (synopsis "C port of the HdrHistogram")
354 (description "This is a C port of HdrHistogram, which contains a subset of
355the functionality supported by the Java implementation. The current supported
356features are:
357@enumerate
358@item Intercept any memory access or directly map real memory ranges.
359@item Standard histogram with 64 bit counts (32/16 bit counts not supported).
360@item All iterator types (all values, recorded, percentiles, linear, logarithmic)>
361@item Histogram serialisation (encoding version 1.2, decoding 1.0-1.2).
362@item Reader/writer phaser and interval recorder.
363@end enumerate")
364 (license license:cc0)))
365
366(define-public minini
367 (package
368 (name "minini")
369 (properties '((revision . "0")
370 ;; This commit is the next one to 1.5 that fixes the wrong
371 ;; type used in prototype for ini_putbool() function.
372 (commit . "797be9d2b883222d387732df73945d52c99ec994")))
373 (version (git-version "1.5"
374 (assoc-ref properties 'revision)
375 (assoc-ref properties 'commit)))
376 (source
377 (origin
378 (method git-fetch)
379 (uri (git-reference
380 (url "https://github.com/compuphase/minIni")
381 (commit (assoc-ref properties 'commit))))
382 (file-name (git-file-name name version))
383 (sha256
384 (base32 "1qdrvm0rzip1qbpgxp4bz1dd52lgxxcn40pdw6viz7scj47iccvn"))))
385 (build-system gnu-build-system)
386 (arguments
387 (list
388 #:modules
389 '((guix build gnu-build-system)
390 (guix build utils)
391 (srfi srfi-26)) ;for cute
392 #:phases
393 #~(modify-phases %standard-phases
394 (delete 'configure)
395 (replace 'build
396 (lambda _
397 (with-directory-excursion "dev"
398 (invoke #$(cc-for-target) "-c" "-fPIC" "minIni.c"
399 "-o" "minIni.o")
400 (invoke #$(cc-for-target) "-shared"
401 "-o" "libminIni.so" "minIni.o")
402 (invoke #$(cc-for-target) "-o" "test" "test.c" "minIni.c"))))
403 (replace 'install
404 (lambda _
405 (install-file "dev/libminIni.so" (string-append #$output "/lib"))
406 (for-each (cute install-file <>
407 (string-append #$output "/share/doc/minIni"))
408 '("doc/minIni.pdf" "README.md"))
409 (for-each (cute install-file <>
410 (string-append #$output "/include/minIni"))
411 (find-files "dev" "\\.h"))))
412 (replace 'check
413 (lambda* (#:key tests? #:allow-other-keys)
414 (when tests?
415 (with-directory-excursion "dev"
416 (invoke "./test"))))))))
417 (home-page "https://www.compuphase.com/minini.htm")
418 (synopsis "Library for reading and writing @file{.ini} files")
419 (description
420 "minIni is a portable and configurable library for reading and writing
421@file{.ini} files.")
422 (license license:asl2.0)))
423
424(define-public simple-cc
425 (package
426 (name "simple-cc")
427 (version "0.1")
428 (source
429 (origin
430 (method git-fetch)
431 (uri (git-reference
432 (url "git://git.simple-cc.org/scc")
433 (commit (string-append "v" version))))
434 (file-name (git-file-name name version))
435 (sha256
436 (base32 "1bza722flyb8j2wirjrp45hvfip0ayhx2l1d3qcrbhc124hi356r"))
437 (patches (search-patches "simple-cc-wcsrtombs.patch"
438 "simple-cc-qbebin.patch"
439 "simple-cc-path-max.patch"
440 "simple-cc-noexec-stack.patch"))))
441 (build-system gnu-build-system)
442 ;; TODO: Upstream only supports a limited set of architectures.
443 ;; aarch64 could be supported as well but fails 'check currently.
444 (supported-systems '("x86_64-linux"))
445 (arguments
446 (list
447 #:make-flags
448 #~(list (string-append "PREFIX=" #$output)
449 (string-append "CC=" #$(cc-for-target))
450 ;; By default, simple-cc is build using its own make(1)
451 ;; implementation. However, as of now, it does not support
452 ;; parallel builds. To speedup the build we use GNU make.
453 "SCCMAKE=make")
454 #:phases
455 #~(modify-phases %standard-phases
456 ;; The simple-cc codebase makes several assumptions that do not hold
457 ;; on Guix. For example, it assumes that c99(1) exists, we thus fix
458 ;; those references here.
459 (add-after 'unpack 'fix-paths
460 (lambda* (#:key inputs #:allow-other-keys)
461 (substitute* "src/cmd/scc-make/defaults.c"
462 (("c99") "gcc -std=c99")
463 (("/bin/sh") (search-input-file inputs "/bin/sh")))
464 (substitute* "src/libc/gcc-scc.sh"
465 (("}cc") "}gcc"))
466 (substitute* "src/cmd/scc-cc/posix/scc.sh"
467 (("dirname") (search-input-file inputs "/bin/dirname")))
468 (substitute* "scripts/build/host/linux.mk"
469 (("c99") "gcc -std=c99"))
470 (let ((str (lambda (x)
471 (string-append "\"" x "\""))))
472 (substitute* "include/scc/bits/scc/sys-scc.h"
473 (("\"ld\"") (str (search-input-file inputs "/bin/ld")))
474 (("\"as\"") (str (search-input-file inputs "/bin/as")))
475 (("\"qbe\"") (str (search-input-file inputs "/bin/qbe")))))
476
477 ;; Fixes for the simple-cc test suite.
478 (for-each (lambda (file)
479 (substitute* file
480 (("/bin/sh") (search-input-file inputs "/bin/sh"))
481 (("c99") "gcc -std=c99")
482 ;; Bash emits a different error message.
483 ((": not found") ": command not found")))
484 (find-files "tests/make" "\\.sh$"))))
485 (delete 'configure)
486 (add-before 'check 'setenv
487 (lambda _
488 (setenv "PATH"
489 (string-append (getenv "PATH") ":"
490 #$source "/bin"))))
491 ;; Tests fail when not run via GNU make, which we don't use for build
492 ;; as scc-make does not support parallel builds. Therefore, we need a
493 ;; custom 'check phase here which invokes the tests target without
494 ;; setting SCCMAKE. Further, we also need to unset MAKEFLAGS then.
495 (replace 'check
496 (lambda* (#:key tests? #:allow-other-keys)
497 (when tests?
498 (invoke "make" "-j1" "tests" "MAKEFLAGS=")))))))
499 (inputs (list ed qbe sed))
500 (home-page "https://www.simple-cc.org/")
501 (synopsis "Portable C toolchain that can be compiled on any UNIX system")
502 (description
503 "Portable C toolchain with a focus on simplicity. Includes, among other
504things, a compiler, a @code{make} implementation, and an implementation of
505several utilities normally provided by @code{binutils} (e.g., @code{nm(1)} or
506@code{addr2line(1)}). Further, it also comes with its own C standard
507library implementation.")
508 (license license:isc)))
509
510(define-public stringzilla
511 (package
512 (name "stringzilla")
513 (version "3.12.1")
514 (source
515 (origin
516 (method git-fetch)
517 (uri (git-reference
518 (url "https://github.com/ashvardanian/StringZilla")
519 (commit (string-append "v" version))))
520 (file-name (git-file-name name version))
521 (sha256
522 (base32 "1v1wh4lxxd1bymbiadnaj8207d85c88ic6wdxki1967f7iij8m4k"))))
523 (build-system cmake-build-system)
524 (arguments
525 (list #:configure-flags
526 #~(list "-DSTRINGZILLA_IS_MAIN_PROJECT=ON"
527 "-DSTRINGZILLA_INSTALL=ON"
528 (string-append "-DSTRINGZILLA_INCLUDE_INSTALL_DIR="
529 #$output "/include")
530 ;; One fails, another takes very long.
531 "-DSTRINGZILLA_BUILD_BENCHMARK=OFF")
532 #:phases
533 #~(modify-phases %standard-phases
534 ;; The install process moves a file into
535 ;; "/usr/src/stringzilla/". Fix this.
536 (add-after 'unpack 'install-in-a-standard-location
537 (lambda _
538 (substitute* "CMakeLists.txt"
539 (("(install\\(DIRECTORY \\./c/ DESTINATION ).*" _ prefix)
540 (string-append prefix
541 #$output
542 "/share/stringzilla/)\n")))))
543 ;; AVX512 support can be disabled by defining SZ_USE_X86_AVX512
544 ;; to 0 before including the header.
545 (add-after 'unpack 'skip-failing-test
546 (lambda _
547 (substitute* "CMakeLists.txt"
548 (("^ *define_launcher\\(.*_avx512 .*") "")))))))
549 (home-page "https://github.com/ashvardanian/StringZilla")
550 (synopsis "C/C++ header-only string library using SIMD and SWAR")
551 (description
552 "StringZilla is a C/C++ header-only string library which relies on SIMD
553and SWAR. It implements string search, edit distances, sorting, lazy ranges,
554hashes and fingerprints.")
555 (license (list license:asl2.0 license:bsd-3)))) ; readme says dual-licensed
556
557(define-public tcc
558 ;; There's currently no release fixing <https://issues.guix.gnu.org/52140>.
559 (let ((revision "1")
560 (commit "a83b28568596afd8792fd58d1a5bd157fc6b6634"))
561 (package
562 (name "tcc") ;aka. "tinycc"
563 (version (git-version "0.9.27" revision commit))
564 (source (origin
565 (method git-fetch)
566 (uri (git-reference
567 (url "git://repo.or.cz/tinycc.git")
568 (commit commit)))
569 (file-name (git-file-name name version))
570 (sha256
571 (base32
572 "01znw86fg73x3k0clafica4b6glbhz69p588kvp766i0zgvs68dh"))))
573 (build-system gnu-build-system)
574 (native-inputs (list perl texinfo))
575 (arguments
576 `(#:configure-flags (list "--extra-cflags=-Wno-error=implicit-int"
577 (string-append "--elfinterp="
578 (assoc-ref %build-inputs
579 "libc")
580 ,(glibc-dynamic-linker))
581 (string-append "--crtprefix="
582 (assoc-ref %build-inputs
583 "libc") "/lib")
584 (string-append "--sysincludepaths="
585 (assoc-ref %build-inputs
586 "libc") "/include:"
587 (assoc-ref %build-inputs
588 "kernel-headers")
589 "/include:{B}/include")
590 (string-append "--libpaths="
591 (assoc-ref %build-inputs
592 "libc") "/lib")
593 ,@(if (string-prefix? "armhf-linux"
594 (or (%current-target-system)
595 (%current-system)))
596 `("--triplet=arm-linux-gnueabihf")
597 '()))
598 #:test-target "test"))
599 (native-search-paths
600 (list (search-path-specification
601 (variable "CPATH")
602 (files '("include")))
603 (search-path-specification
604 (variable "LIBRARY_PATH")
605 (files '("lib" "lib64")))))
606 ;; Fails to build on MIPS: "Unsupported CPU"
607 (supported-systems (delete "mips64el-linux" %supported-systems))
608 (synopsis "Tiny and fast C compiler")
609 (description
610 "TCC, also referred to as \"TinyCC\", is a small and fast C compiler
611written in C. It supports ANSI C with GNU and extensions and most of the C99
612standard.")
613 (home-page "http://www.tinycc.org/")
614 ;; An attempt to re-licence tcc under the Expat licence is underway but not
615 ;; (if ever) complete. See the RELICENSING file for more information.
616 (license license:lgpl2.1+))))
617
618(define-public tomlc99
619 (let ((revision "1")
620 (commit "5221b3d3d66c25a1dc6f0372b4f824f1202fe398"))
621 (package
622 (name "tomlc99")
623 (version (git-version "1.0" revision commit))
624 (source (origin
625 (method git-fetch)
626 (uri (git-reference
627 (url "https://github.com/cktan/tomlc99")
628 (commit commit)))
629 (file-name (git-file-name name version))
630 (sha256
631 (base32
632 "1r443cpwy7f1f8imyfykpggkihrvv9fvdlgl95liiqmzqz9snqnd"))))
633 (build-system gnu-build-system)
634 (arguments
635 (list #:make-flags #~(list (string-append "CC="
636 #$(cc-for-target))
637 (string-append "prefix="
638 #$output))
639 #:phases
640 #~(modify-phases %standard-phases
641 (delete 'configure)
642 (replace 'check
643 (lambda* (#:key tests? make-flags
644 #:allow-other-keys)
645 (when tests?
646 (apply invoke
647 `("make" "-C" "unittest"
648 ,@make-flags))
649 (invoke "./unittest/t1"))))
650 ;; The Makefile checks for libtoml.pc and only installs if
651 ;; the prefix is /usr/local.
652 (add-after 'install 'install-pkg-config
653 (lambda _
654 (rename-file "libtoml.pc.sample" "libtoml.pc")
655 (substitute* "libtoml.pc"
656 (("^prefix=.*")
657 (string-append "prefix=" #$output "\n")))
658
659 (let ((pc (string-append #$output "/lib/pkgconfig")))
660 (mkdir-p pc)
661 (install-file "libtoml.pc" pc)))))))
662 (home-page "https://github.com/cktan/tomlc99")
663 (synopsis "TOML library for C")
664 (description
665 "This library is a C99 implementation to read
666@acronym{TOML, Tom's Obvious Minimal Language} text documents.
667
668This library is compatible with the @url{https://toml.io/en/v1.0.0,v1.0.0}
669specification of the language.")
670 (license license:expat))))
671
672(define-public pcc
673 (package
674 (name "pcc")
675 (version "20170109")
676 (source (origin
677 (method url-fetch)
678 (uri (string-append "http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-"
679 version ".tgz"))
680 (sha256
681 (base32
682 "1p34w496095mi0473f815w6wbi57zxil106mg7pj6sg6gzpjcgww"))))
683 (build-system gnu-build-system)
684 (arguments
685 (list #:phases
686 #~(modify-phases %standard-phases
687 (add-after 'unpack 'fix-multiple-definitions
688 (lambda _
689 ;; Certain variables are defined multiple times. This
690 ;; upsets the linker and causes a build failure.
691 (substitute* "cc/ccom/pass1.h"
692 (("FLT flt_zero;") "extern FLT flt_zero;"))
693 (substitute* (list "cc/ccom/scan.l" "cc/cxxcom/scan.l")
694 (("lineno, ") ""))))
695 (replace 'check
696 (lambda* (#:key tests? #:allow-other-keys)
697 (when tests?
698 (invoke "make" "-C" "cc/cpp" "test")))))))
699 (native-inputs (list bison flex))
700 (synopsis "Portable C compiler")
701 (description
702 "PCC is a portable C compiler. The project goal is to write a C99
703compiler while still keeping it small, simple, fast and understandable.")
704 (home-page "http://pcc.ludd.ltu.se")
705 (supported-systems (delete "aarch64-linux" %supported-systems))
706 ;; PCC incorporates code under various BSD licenses; for new code bsd-2 is
707 ;; preferred. See http://pcc.ludd.ltu.se/licenses/ for more details.
708 (license (list license:bsd-2 license:bsd-3))))
709
710(define-public qbe
711 (package
712 (name "qbe")
713 (version "1.3")
714 (source (origin
715 (method git-fetch)
716 (uri (git-reference
717 (url "git://c9x.me/qbe")
718 (commit (string-append "v" version))))
719 (file-name (git-file-name name version))
720 (sha256
721 (base32
722 "0nzz9xyj0znrz54km2mmd501sg4ls15qdmc0qbqnxm7wckjcwc93"))))
723 (build-system gnu-build-system)
724 (arguments
725 (list #:make-flags
726 #~(list (string-append "CC=" #$(cc-for-target))
727 (string-append "PREFIX=" #$output))
728 #:phases
729 #~(modify-phases %standard-phases
730 (add-after 'unpack 'allow-cross-compilation
731 (lambda _
732 (substitute* "Makefile"
733 (("`uname -m`") #$(or (%current-target-system)
734 (%current-system))))))
735 (delete 'configure))))
736 (supported-systems (list "x86_64-linux" "aarch64-linux" "riscv64-linux"))
737 (synopsis "Simple compiler backend")
738 (description
739 "QBE is a small compiler backend using an SSA-based intermediate
740language as input.")
741 (home-page "https://c9x.me/compile/")
742 (license license:expat)))
743
744(define-public python-pcpp
745 (package
746 (name "python-pcpp")
747 (version "1.30")
748 (source
749 (origin
750 (method git-fetch)
751 (uri (git-reference
752 (url "https://github.com/ned14/pcpp")
753 (commit (string-append "v" version))))
754 (file-name (git-file-name name version))
755 (sha256
756 (base32 "1rihvlg11nzk70kfzz4i3gi5izcy46w05ismcx04p5j1hlim0brb"))))
757 (build-system pyproject-build-system)
758 (arguments
759 (list
760 #:test-backend #~'unittest
761 #:test-flags #~(list "discover" "-s" "tests" "-p" "*.py")
762 #:phases
763 #~(modify-phases %standard-phases
764 (add-after 'unpack 'unbundle-ply
765 (lambda _
766 (rmdir "pcpp/ply")
767 (substitute* "setup.py"
768 (("'pcpp/ply/ply'")
769 "")))))))
770 (native-inputs (list python-setuptools))
771 (propagated-inputs (list python-ply))
772 (home-page "https://github.com/ned14/pcpp")
773 (synopsis "C99 preprocessor written in Python")
774 (description
775 "This package provides a C99 preprocessor written in pure Python.")
776 (license license:bsd-3)))
777
778(define-public aml
779 (package
780 (name "aml")
781 (version "1.0.0")
782 (source (origin
783 (method git-fetch)
784 (uri (git-reference
785 (url "https://github.com/any1/aml")
786 (commit (string-append "v" version))))
787 (file-name (git-file-name name version))
788 (sha256
789 (base32
790 "0cp0hmlfrsvmdrdhcr2b4msvhv80zx43bxqq995vlrk1ibljcj6p"))))
791 (build-system meson-build-system)
792 (native-inputs
793 (list pkg-config))
794 (home-page "https://github.com/any1/aml")
795 (synopsis "Another/Andri's main loop")
796 (description "The @code{aml} library provides a portable event loop for C,
797with the following features:
798@enumerate
799@item file descriptor event handlers
800@item timers and tickers
801@item signal handlers
802@item idle dispatch callbacks
803@item thread pool support
804@end enumerate")
805 (license license:isc)))
806
807(define-public libbytesize
808 (package
809 (name "libbytesize")
810 (version "2.10")
811 (source (origin
812 (method url-fetch)
813 (uri (string-append
814 "https://github.com/storaged-project/libbytesize/releases/"
815 "download/" version "/libbytesize-" version ".tar.gz"))
816 (sha256
817 (base32
818 "1lfa02ac96p12xxq75ilx3qk7kym4xrlqyfh26axb7y5iazf670x"))))
819 (build-system gnu-build-system)
820 (arguments
821 `(#:tests? #f))
822 (native-inputs
823 (list gettext-minimal pkg-config python))
824 (inputs
825 (list mpfr pcre2))
826 (home-page "https://github.com/storaged-project/libbytesize")
827 (synopsis "Tiny C library for working with arbitrary big sizes in bytes")
828 (description
829 "The goal of this project is to provide a tiny library that would
830facilitate the common operations with sizes in bytes. Many projects need to
831work with sizes in bytes (be it sizes of storage space, memory...) and all of
832them need to deal with the same issues like:
833
834@itemize
835@item How to get a human-readable string for the given size?
836@item How to store the given size so that no significant information is lost?
837@item If we store the size in bytes, what if the given size gets over the
838MAXUINT64 value?
839@item How to interpret sizes entered by users according to their locale and
840typing conventions?
841@item How to deal with the decimal/binary units (MB versus MiB) ambiguity?
842@end itemize
843
844@code{libbytesize} offers a generally usable solution that could be used by
845every project that needs to deal with sizes in bytes. It is written in the C
846language with thin bindings for other languages.")
847 (license license:lgpl2.1+)))
848
849(define-public udunits
850 (package
851 (name "udunits")
852 ;; Four-part version numbers are development snapshots, not releases. See
853 ;; <https://github.com/Unidata/UDUNITS-2/issues/99#issuecomment-732323472>.
854 (version "2.2.28")
855 (source (origin
856 (method url-fetch)
857 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/udunits/"
858 "udunits-" version ".tar.gz"))
859 (sha256
860 (base32
861 "17jpbp6f0rr132jn2gqy8ry8mv1w27v6dyhfq1igv8v1674aw2sr"))))
862 (build-system gnu-build-system)
863 (arguments
864 `(#:configure-flags
865 (list "--disable-static")))
866 (inputs
867 (list expat))
868 (home-page "https://www.unidata.ucar.edu/software/udunits/")
869 (synopsis "C library for units of physical quantities and value-conversion utils")
870 (description
871 "The UDUNITS-2 package provides support for units of physical quantities.
872Its three main components are:
873
874@enumerate
875@item @code{udunits2lib}, a C library for units of physical quantities;
876@item @code{udunits2prog}, a utility for obtaining the definition of a unit
877 and for converting numeric values between compatible units; and
878@item an extensive database of units.
879@end enumerate\n")
880 ;; Like the BSD-3 license but with an extra anti patent clause.
881 (license (license:non-copyleft "file://COPYRIGHT"))))
882
883(define-public libfixposix
884 (package
885 (name "libfixposix")
886 (version "0.4.3")
887 (home-page "https://github.com/sionescu/libfixposix")
888 (source
889 (origin
890 (method git-fetch)
891 (uri (git-reference
892 (url home-page)
893 (commit (string-append "v" version))))
894 (file-name (git-file-name name version))
895 (sha256
896 (base32
897 "1x4q6yspi5g2s98vq4qszw4z3zjgk9l5zs8471w4d4cs6l97w08j"))))
898 (build-system gnu-build-system)
899 (native-inputs
900 (list autoconf automake libtool pkg-config check))
901 (native-search-paths
902 (list
903 (search-path-specification
904 (variable "C_INCLUDE_PATH")
905 (files '("include")))))
906 (synopsis "Thin wrapper over POSIX syscalls")
907 (description
908 "The purpose of libfixposix is to offer replacements for parts of POSIX
909whose behaviour is inconsistent across *NIX flavours.")
910 (license license:boost1.0)))
911
912(define-public libhx
913 (package
914 (name "libhx")
915 (version "4.9")
916 (source
917 (origin
918 (method url-fetch)
919 (uri (string-append "https://inai.de/files/libhx/"
920 "libHX-" version ".tar.xz"))
921 (sha256
922 (base32 "16rwp8b2j8l0m27rffvb7ma350r79l611sa135hzfywkdli2bqh2"))))
923 (build-system gnu-build-system)
924 (home-page "https://inai.de/projects/libhx/")
925 (synopsis "C library with common data structures and functions")
926 (description
927 "This is a C library (with some C++ bindings available) that provides data
928structures and functions commonly needed, such as maps, deques, linked lists,
929string formatting and autoresizing, option and config file parsing, type
930checking casts and more.")
931 (license license:lgpl2.1+)))
932
933(define-public libcsptr
934 (package
935 (name "libcsptr")
936 (version "2.0.3")
937 (source (origin
938 (method git-fetch)
939 (uri (git-reference
940 (url "https://github.com/Snaipe/libcsptr")
941 (commit (string-append "v" version))))
942 (file-name (git-file-name name version))
943 (sha256
944 (base32 "056yg1irxi90ccgf646jxzngbsm946ckyzn8ykl92h6d2mnr141a"))))
945 (build-system gnu-build-system)
946 (native-inputs (list autoconf automake libtool))
947 (home-page "https://snai.pe/c/c-smart-pointers/")
948 (synopsis "Smart pointers for GNU C")
949 (description "This package is an attempt at bringing smart pointers
950like C++'s unique_ptr and shared_ptr to C through GCC's cleanup attribute.")
951 (license license:expat)))
952
953(define-public libwuya
954 ;; This commit is the one before "wuy_pool.h" was removed from libwuya,
955 ;; which libleak currently requires.
956 (let ((revision "1")
957 (commit "883502041044f4616cfbf75c8f2bb60059f704a9"))
958 (package
959 (name "libwuya")
960 (version (git-version "0.0" revision commit))
961 (source (origin
962 (method git-fetch)
963 (uri (git-reference
964 (url "https://github.com/WuBingzheng/libwuya")
965 (commit commit)))
966 (file-name (git-file-name name version))
967 (sha256
968 (base32
969 "1xrsqbgr13g2v0ag165ryp7xrwzv41xfygzk2a3445ca98c1qpdc"))))
970 (build-system gnu-build-system)
971 (arguments
972 `(#:tests? #f ;no test suite
973 #:phases (modify-phases %standard-phases
974 (add-after 'unpack 'patch-lua-includes
975 (lambda _
976 (substitute* '("wuy_cflua.h" "wuy_cflua.c")
977 (("<lua5\\.1/") "<"))
978 #t))
979 (add-after 'unpack 'add--fPIC-to-CFLAGS
980 (lambda _
981 (substitute* "Makefile"
982 (("CFLAGS[^\n]*" all)
983 (string-append all " -fPIC")))
984 #t))
985 (add-before 'build 'set-CC
986 (lambda _
987 (setenv "CC" "gcc")
988 #t))
989 (delete 'configure) ;no configure script
990 (replace 'install
991 (lambda* (#:key outputs #:allow-other-keys)
992 (let* ((out (assoc-ref outputs "out"))
993 (include-dir (string-append out "/include"))
994 (headers (find-files "." "\\.h$")))
995 (for-each (lambda (h)
996 (install-file h include-dir))
997 headers)
998 (install-file "libwuya.a" (string-append out "/lib"))
999 #t))))))
1000 (inputs (list lua))
1001 (home-page "https://github.com/WuBingzheng/libwuya/")
1002 (synopsis "C library implementing various data structures")
1003 (description "The @code{libwuya} library implements data structures such
1004as dictionaries, skip lists, and memory pools.")
1005 ;; There is no clear information as to what license this is distributed
1006 ;; under, but it is included (bundled) with libleak from the same author
1007 ;; under the GNU GPL v2 or later license, so use this here until it is
1008 ;; clarified (see: https://github.com/WuBingzheng/libwuya/issues/2).
1009 (license license:gpl2+))))
1010
1011;; Deprecated on 2026-06-24.
1012(define-deprecated/public-alias packcc
1013 (@ (gnu packages compiler-tools) packcc))
1014
1015(define-public sfsexp
1016 (package
1017 (name "sfsexp")
1018 (version "1.4.1")
1019 (home-page "https://github.com/mjsottile/sfsexp")
1020 (source
1021 (origin
1022 (method git-fetch)
1023 (uri (git-reference
1024 (url home-page)
1025 (commit (string-append "v" version))))
1026 (file-name (git-file-name name version))
1027 (sha256
1028 (base32 "03srnpc7p1j7ygd0wx9gybcxhqm50kjzkybh1xs75nwz97q3y2dq"))))
1029 (build-system gnu-build-system)
1030 (native-inputs (list autoconf automake libtool))
1031 (synopsis "Symbolic expression library for C and C++")
1032 (description
1033 "sfsexp is a C/C++ library to read, parse, modify, and create symbolic
1034expressions.")
1035 (license license:lgpl2.1+)))
1036
1037(define-public c-template-sort
1038 ;; The latest commit is used as there is no release.
1039 (let ((commit "24f5b8b13810ad130109c7b56daf8e99ab0fe1b8")
1040 (revision "0"))
1041 (package
1042 (name "c-template-sort")
1043 (version (git-version "0.0.0" revision commit))
1044 (source (origin
1045 (method git-fetch)
1046 (uri (git-reference
1047 (url "https://github.com/swenson/sort")
1048 (commit commit)))
1049 (file-name (git-file-name name version))
1050 (sha256
1051 (base32
1052 "0q3pgw51rjq7pb6gc7zx9i48pckyl930lcab4ngxrpa5a8flq850"))))
1053 (build-system copy-build-system)
1054 (arguments
1055 (list
1056 #:install-plan
1057 #~'(("sort.h" "include/sort.h")
1058 ("sort_extra.h" "include/sort_extra.h"))
1059 #:phases
1060 #~(modify-phases %standard-phases
1061 (add-before 'install 'check
1062 (lambda* (#:key tests? #:allow-other-keys)
1063 (when tests?
1064 (invoke "make" "test"
1065 (string-append "CC=" #$(cc-for-target)))))))))
1066 (home-page "https://github.com/swenson/sort")
1067 (synopsis "C implementation of many sorting algorithms")
1068 (description "This package provides a header-only C library,
1069that implements several sorting algorithms. It is configured using
1070macros and supports user-defined types.")
1071 (license license:expat))))
1072
1073(define-public demumble
1074 (package
1075 (name "demumble")
1076 (version "1.3.0")
1077 (source
1078 (origin
1079 (method git-fetch)
1080 (uri (git-reference
1081 (url "https://github.com/nico/demumble")
1082 (commit (string-append "v" version))))
1083 (file-name (git-file-name name version))
1084 (sha256
1085 (base32 "1kgk1zf2amd6jgbj8264i74izqj4ckh43z62v8xz2rvy8h0wqpyq"))))
1086 (build-system cmake-build-system)
1087 (arguments
1088 (list
1089 #:phases
1090 #~(modify-phases %standard-phases
1091 (replace 'check
1092 (lambda* (#:key tests? #:allow-other-keys)
1093 (when tests?
1094 ;; Test script assumes binary to be available in same dir.
1095 (symlink (in-vicinity #$source "demumble_test.py")
1096 "demumble_test.py")
1097 (invoke "python3" "demumble_test.py"))))
1098 ;; No 'install' target in CMakeLists.txt
1099 (replace 'install
1100 (lambda* (#:key outputs #:allow-other-keys)
1101 (let* ((bin (in-vicinity #$output "bin")))
1102 (install-file "demumble" bin)))))))
1103 (native-inputs (list python-minimal))
1104 (home-page "https://github.com/nico/demumble")
1105 (synopsis "Demangles both Itanium and Visual Studio symbols")
1106 (description "This package provides a demangler for symbol names.
1107Demangling refers to the process of translating @acronym{ABI, application binary
1108interface} identifiers back to their source code equivalents.")
1109 (license license:asl2.0)))
1110
1111(define-public sparse
1112 (package
1113 (name "sparse")
1114 (version "0.6.4")
1115 (source (origin
1116 (method url-fetch)
1117 (uri
1118 (string-append "mirror://kernel.org/software/devel/sparse/dist/"
1119 "sparse-" version ".tar.xz"))
1120 (sha256
1121 (base32
1122 "0z1qds52144nvsdnl82r3zs3vax618v920jmffyyssmwj54qpcka"))))
1123 (build-system gnu-build-system)
1124 (inputs (list perl))
1125 (arguments
1126 '(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out")))
1127 #:phases (modify-phases %standard-phases
1128 (delete 'configure)
1129 (add-after 'unpack 'patch-cgcc
1130 (lambda _
1131 (substitute* "cgcc"
1132 (("'cc'") (string-append "'" (which "gcc") "'"))))))))
1133 (synopsis "Semantic C parser for Linux development")
1134 (description
1135 "Sparse is a semantic parser for C and is required for Linux development.
1136It provides a compiler frontend capable of parsing most of ANSI C as well as
1137many GCC extensions, and a collection of sample compiler backends, including a
1138static analyzer also called @file{sparse}. Sparse provides a set of
1139annotations designed to convey semantic information about types, such as what
1140address space pointers point to, or what locks a function acquires or
1141releases.")
1142 (home-page "https://sparse.wiki.kernel.org/index.php/Main_Page")
1143 (license license:expat)))
1144
1145(define-public libestr
1146 (package
1147 (name "libestr")
1148 (version "0.1.11")
1149 (source
1150 (origin
1151 (method git-fetch)
1152 (uri (git-reference
1153 (url "https://github.com/rsyslog/libestr")
1154 (commit (string-append "v" version))))
1155 (file-name (git-file-name name version))
1156 (sha256
1157 (base32
1158 "1ca4rj90c0dn7kqpbcchkflxjw88a7rxcnwbr0gply4a28i01nd8"))))
1159 (build-system gnu-build-system)
1160 (arguments
1161 `(#:phases
1162 (modify-phases %standard-phases
1163 ;; autogen.sh calls configure at the end of the script.
1164 (replace 'bootstrap
1165 (lambda _ (invoke "autoreconf" "-vfi"))))))
1166 (native-inputs
1167 (list autoconf automake pkg-config libtool))
1168 (home-page "https://github.com/rsyslog/libestr")
1169 (synopsis "Helper functions for handling strings")
1170 (description
1171 "This C library contains some essential string manipulation functions and
1172more, like escaping special characters.")
1173 (license license:lgpl2.1+)))
1174
1175(define-public libfastjson
1176 (package
1177 (name "libfastjson")
1178 (version "1.2304.0")
1179 (source
1180 (origin
1181 (method git-fetch)
1182 (uri (git-reference
1183 (url "https://github.com/rsyslog/libfastjson")
1184 (commit (string-append "v" version))))
1185 (file-name (git-file-name name version))
1186 (sha256
1187 (base32 "0gmyzplnb4cfbg4yai0s8yi13xbaq606d5h50zwlkky712aklwss"))))
1188 (build-system gnu-build-system)
1189 (native-inputs (list autoconf automake libtool))
1190 (home-page "https://github.com/rsyslog/libfastjson")
1191 (synopsis "Fast JSON library for C")
1192 (description
1193 "libfastjson is a fork from json-c aiming to provide: a small library
1194with essential JSON handling functions, sufficiently good JSON support (not
1195100% standards compliant), and very fast processing.")
1196 (license license:expat)))
1197
1198(define-public liblogging
1199 (package
1200 (name "liblogging")
1201 (version "1.0.6")
1202 (source
1203 (origin
1204 (method git-fetch)
1205 (uri (git-reference
1206 (url "https://github.com/rsyslog/liblogging")
1207 (commit (string-append "v" version))))
1208 (file-name (git-file-name name version))
1209 (sha256
1210 (base32
1211 "1l32m0y65svf5vxsgw935jnqs6842rcqr56dmzwqvr00yfrjhjkp"))))
1212 (build-system gnu-build-system)
1213 (arguments
1214 `(#:phases
1215 (modify-phases %standard-phases
1216 ;; autogen.sh calls configure at the end of the script.
1217 (replace 'bootstrap
1218 (lambda _ (invoke "autoreconf" "-vfi"))))))
1219 (native-inputs
1220 (list autoconf
1221 automake
1222 pkg-config
1223 libtool
1224 ;; For rst2man.py
1225 python-docutils))
1226 (home-page "https://github.com/rsyslog/liblogging")
1227 (synopsis "Easy to use and lightweight signal-safe logging library")
1228 (description
1229 "Liblogging is an easy to use library for logging. It offers an enhanced
1230replacement for the syslog() call, but retains its ease of use.")
1231 (license license:bsd-2)))
1232
1233(define-public liblognorm
1234 (package
1235 (name "liblognorm")
1236 (version "2.0.7")
1237 (source
1238 (origin
1239 (method git-fetch)
1240 (uri (git-reference
1241 (url "https://github.com/rsyslog/liblognorm")
1242 (commit (string-append "v" version))))
1243 (file-name (git-file-name name version))
1244 (sha256
1245 (base32
1246 "1syh3lx58q6izzgmpq8pj4j5aw6qr5nzplnmk42f2alrw38sprd5"))))
1247 (build-system gnu-build-system)
1248 (arguments
1249 (list
1250 #:parallel-tests? #false ;not supported
1251 #:phases
1252 '(modify-phases %standard-phases
1253 ;; These tests fail because tmp.rulebase is never created. This
1254 ;; looks rather harmless.
1255 (add-after 'unpack 'delete-failing-tests
1256 (lambda _
1257 (substitute* "tests/Makefile.am"
1258 (("string_rb_simple.sh ") "")
1259 (("string_rb_simple_2_lines.sh ") "")))))))
1260 (inputs
1261 (list json-c libestr libfastjson))
1262 (native-inputs
1263 (list autoconf automake libtool pkg-config))
1264 (home-page "https://www.liblognorm.com")
1265 (synopsis "Fast samples-based log normalization library")
1266 (description
1267 "Liblognorm normalizes event data into well-defined name-value pairs and
1268a set of tags describing the message.")
1269 ;; liblognorm is very slowly transitioning to ASL2.0
1270 ;; See https://github.com/rsyslog/liblognorm/issues/329
1271 (license license:lgpl2.1+)))
1272
1273(define-public unifdef
1274 (package
1275 (name "unifdef")
1276 (version "2.12")
1277 (source (origin
1278 (method url-fetch)
1279 ;; https://dotat.at/prog/unifdef/unifdef-2.12.tar.xz
1280 (uri (string-append "https://dotat.at/prog/" name "/"
1281 name "-" version ".tar.xz"))
1282 (sha256
1283 (base32
1284 "00647bp3m9n01ck6ilw6r24fk4mivmimamvm4hxp5p6wxh10zkj3"))
1285 (modules '((guix build utils)))
1286 (snippet
1287 '(begin (delete-file-recursively "FreeBSD")
1288 (delete-file-recursively "win32")
1289 #t))))
1290 (build-system gnu-build-system)
1291 (arguments
1292 `(#:phases (modify-phases %standard-phases
1293 (delete 'configure))
1294 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1295 (string-append "prefix=" %output))
1296 #:tests? #f)) ;no test suite
1297 (native-inputs
1298 (list perl))
1299 (home-page "https://dotat.at/prog/unifdef/")
1300 (synopsis "Utility to selectively processes conditional C preprocessor")
1301 (description "The @command{unifdef} utility selectively processes
1302conditional C preprocessor @code{#if} and @code{#ifdef} directives. It
1303removes from a file both the directives and the additional text that they
1304delimit, while otherwise leaving the file alone. It can be useful for
1305avoiding distractions when studying code that uses @code{#ifdef} heavily for
1306portability.")
1307 (license (list license:bsd-2 ;all files except...
1308 license:bsd-3)))) ;...the unidef.1 manual page
1309
1310(define-deprecated/public-alias byacc
1311 (@ (gnu packages compiler-tools) byacc))
1312
1313(define-public argparse
1314 (package
1315 (name "argparse")
1316 (version "1.1.0")
1317 (source (origin
1318 (method git-fetch)
1319 (uri (git-reference
1320 (url "https://github.com/cofyc/argparse")
1321 (commit (string-append "v" version))))
1322 (file-name (git-file-name name version))
1323 (sha256
1324 (base32
1325 "0zb0b2aikk4dasjzsyiyf2xn1hbld8gf8np3843zcg9wbxydd8zd"))))
1326 (build-system gnu-build-system)
1327 (arguments
1328 (list #:test-target "test"
1329 #:phases
1330 #~(modify-phases %standard-phases
1331 (delete 'configure) ;no configure script
1332 (replace 'install
1333 (lambda* (#:key outputs #:allow-other-keys)
1334 (let* ((out (assoc-ref outputs "out"))
1335 (inc (string-append out "/include"))
1336 (lib (string-append out "/lib")))
1337 (install-file "argparse.h" inc)
1338 (install-file "libargparse.so" lib)))))))
1339 (synopsis "Command line arguments parsing library")
1340 (home-page "https://github.com/cofyc/argparse")
1341 (description
1342 "This C library provides high-level arguments parsing solutions inspired
1343by Python's @code{argparse} module.")
1344 (license license:expat)))
1345
1346(define-public aws-c-common
1347 (package
1348 (name "aws-c-common")
1349 ;; Update only when updating aws-crt-cpp.
1350 (version "0.12.2")
1351 (source (origin
1352 (method git-fetch)
1353 (uri (git-reference
1354 (url (string-append "https://github.com/awslabs/" name))
1355 (commit (string-append "v" version))))
1356 (file-name (git-file-name name version))
1357 (sha256
1358 (base32
1359 "1drad31f3ynvjy2xmgnidzwxya2z47n9wa4s13cpnzf2aga0jb4v"))))
1360 (build-system cmake-build-system)
1361 (arguments
1362 '(#:parallel-tests? #f
1363 #:configure-flags
1364 '("-DBUILD_SHARED_LIBS=ON")))
1365 (supported-systems '("armhf-linux" "aarch64-linux"
1366 "i686-linux" "x86_64-linux"))
1367 (synopsis "Amazon Web Services core C library")
1368 (description
1369 "This library provides common C99 primitives, configuration, data
1370 structures, and error handling for the @acronym{AWS,Amazon Web Services} SDK.")
1371 (home-page "https://github.com/awslabs/aws-c-common")
1372 (license license:asl2.0)))
1373
1374(define-public aws-checksums
1375 (package
1376 (name "aws-checksums")
1377 ;; Update only when updating aws-crt-cpp.
1378 (version "0.2.5")
1379 (source (origin
1380 (method git-fetch)
1381 (uri (git-reference
1382 (url (string-append "https://github.com/awslabs/" name))
1383 (commit (string-append "v" version))))
1384 (file-name (git-file-name name version))
1385 (sha256
1386 (base32
1387 "06mpn3g882gx1ds3962a86l2r1hq7wjkdq6lsb3ixmri7sfmi26r"))))
1388 (build-system cmake-build-system)
1389 (arguments
1390 '(#:configure-flags
1391 (list "-DBUILD_SHARED_LIBS=ON"
1392 (string-append "-DCMAKE_PREFIX_PATH="
1393 (assoc-ref %build-inputs "aws-c-common")))))
1394 (inputs
1395 (list aws-c-common))
1396 (synopsis "Amazon Web Services checksum library")
1397 (description
1398 "This library provides cross-Platform hardware accelerated CRC32c and CRC32
1399with fallback to efficient C99 software implementations.")
1400 (home-page "https://github.com/awslabs/aws-checksums")
1401 (license license:asl2.0)))
1402
1403(define-public aws-c-event-stream
1404 (package
1405 (name "aws-c-event-stream")
1406 ;; Update only when updating aws-crt-cpp.
1407 (version "0.5.4")
1408 (source (origin
1409 (method git-fetch)
1410 (uri (git-reference
1411 (url (string-append "https://github.com/awslabs/" name))
1412 (commit (string-append "v" version))))
1413 (file-name (git-file-name name version))
1414 (sha256
1415 (base32
1416 "0bxbvmj59g51k2w8dny65j48z02z5n30c86qzhh88x2qv6hg52v3"))))
1417 (build-system cmake-build-system)
1418 (arguments
1419 '(#:configure-flags
1420 (list "-DBUILD_SHARED_LIBS=ON"
1421 (string-append "-DCMAKE_PREFIX_PATH="
1422 (assoc-ref %build-inputs "aws-c-common")))))
1423 (propagated-inputs
1424 (list aws-c-common aws-c-io aws-checksums))
1425 (inputs
1426 (list aws-c-cal s2n))
1427 (synopsis "Amazon Web Services client-server message format library")
1428 (description
1429 "This library is a C99 implementation for @acronym{AWS,Amazon Web Services}
1430event stream encoding, a binary format for bidirectional client-server
1431communication.")
1432 (home-page "https://github.com/awslabs/aws-c-event-stream")
1433 (license license:asl2.0)))
1434
1435(define-public aws-c-io
1436 (package
1437 (name "aws-c-io")
1438 ;; Update only when updating aws-crt-cpp.
1439 (version "0.17.1")
1440 (source (origin
1441 (method git-fetch)
1442 (uri (git-reference
1443 (url (string-append "https://github.com/awslabs/" name))
1444 (commit (string-append "v" version))))
1445 (file-name (git-file-name name version))
1446 (sha256
1447 (base32
1448 "0slk4ibskia3nzn1wwkj0biamh0fhgbmc1abplmgjzcmz9wlqxr5"))))
1449 (build-system cmake-build-system)
1450 (arguments
1451 '(#:configure-flags
1452 (list "-DBUILD_SHARED_LIBS=ON"
1453 (string-append "-DCMAKE_PREFIX_PATH="
1454 (assoc-ref %build-inputs "aws-c-common"))
1455 "-DENABLE_NET_TESTS=OFF")))
1456 (propagated-inputs
1457 (list aws-c-cal aws-c-common s2n))
1458 (synopsis "Event driven framework for implementing application protocols")
1459 (description "This library provides a C99 framework for constructing
1460event-driven, asynchronous network application protocols.")
1461 (home-page "https://github.com/awslabs/aws-c-io")
1462 (license license:asl2.0)))
1463
1464(define-public aws-c-cal
1465 (package
1466 (name "aws-c-cal")
1467 ;; Update only when updating aws-crt-cpp.
1468 (version "0.8.8")
1469 (source (origin
1470 (method git-fetch)
1471 (uri (git-reference
1472 (url (string-append "https://github.com/awslabs/" name))
1473 (commit (string-append "v" version))))
1474 (file-name (git-file-name name version))
1475 (sha256
1476 (base32
1477 "0f9bfgn100hdc08wvbh041bgfv0g29vzkp7arqa1d68880vi58kx"))))
1478 (build-system cmake-build-system)
1479 (arguments
1480 '(#:configure-flags
1481 (list "-DBUILD_SHARED_LIBS=ON"
1482 (string-append "-DCMAKE_PREFIX_PATH="
1483 (assoc-ref %build-inputs "aws-c-common")))))
1484 (propagated-inputs
1485 (list aws-c-common s2n))
1486 (synopsis "Amazon Web Services Crypto Abstraction Layer")
1487 (description "This library provides a C99 wrapper for hash, HMAC, and ECC
1488cryptographic primitives for the @acronym{AWS,Amazon Web Services} SDK.")
1489 (home-page "https://github.com/awslabs/aws-c-cal")
1490 (license license:asl2.0)))
1491
1492(define-public aws-c-sdkutils
1493 (package
1494 (name "aws-c-sdkutils")
1495 ;; Update only when updating aws-crt-cpp.
1496 (version "0.2.3")
1497 (source (origin
1498 (method git-fetch)
1499 (uri (git-reference
1500 (url (string-append "https://github.com/awslabs/" name))
1501 (commit (string-append "v" version))))
1502 (file-name (git-file-name name version))
1503 (sha256
1504 (base32
1505 "09smvqgg08kr5xri5kc94v67154pxx032vdia0agx86q1pxyfl9l"))))
1506 (build-system cmake-build-system)
1507 (arguments
1508 '(#:configure-flags
1509 (list "-DBUILD_SHARED_LIBS=ON"
1510 (string-append "-DCMAKE_PREFIX_PATH="
1511 (assoc-ref %build-inputs "aws-c-common")))))
1512 (propagated-inputs
1513 (list aws-c-common))
1514 (synopsis "Amazon Web Service utility library")
1515 (description "This library provides for parsing and management of profiles
1516for the @acronym{AWS,Amazon Web Services} SDK.")
1517 (home-page "https://github.com/awslabs/aws-c-sdkutils")
1518 (license license:asl2.0)))
1519
1520(define-public aws-c-http
1521 (package
1522 (name "aws-c-http")
1523 ;; Update only when updating aws-crt-cpp.
1524 (version "0.9.5")
1525 (source (origin
1526 (method git-fetch)
1527 (uri (git-reference
1528 (url (string-append "https://github.com/awslabs/" name))
1529 (commit (string-append "v" version))))
1530 (file-name (git-file-name name version))
1531 (sha256
1532 (base32
1533 "0yr2krsajmrvma58fs8sb3jpajynjw2xsi5fmg3cih32wbcjiixj"))))
1534 (build-system cmake-build-system)
1535 (arguments
1536 '(#:configure-flags
1537 (list "-DBUILD_SHARED_LIBS=ON"
1538 (string-append "-DCMAKE_PREFIX_PATH="
1539 (assoc-ref %build-inputs "aws-c-common"))
1540 "-DENABLE_NET_TESTS=OFF")))
1541 (propagated-inputs
1542 (list aws-c-compression aws-c-io))
1543 (synopsis "Amazon Web Services HTTP library")
1544 (description
1545 "This library provides a C99 implementation of the HTTP/1.1 and HTTP/2
1546specifications.")
1547 (home-page "https://github.com/awslabs/aws-c-http")
1548 (license license:asl2.0)))
1549
1550(define-public aws-c-compression
1551 (package
1552 (name "aws-c-compression")
1553 ;; Update only when updating aws-crt-cpp.
1554 (version "0.3.1")
1555 (source (origin
1556 (method git-fetch)
1557 (uri (git-reference
1558 (url (string-append "https://github.com/awslabs/" name))
1559 (commit (string-append "v" version))))
1560 (file-name (git-file-name name version))
1561 (sha256
1562 (base32
1563 "0vh1rapnk6mhcdk3clihxzli7mrik89m9py3hp3h59p937xfx6l2"))))
1564 (build-system cmake-build-system)
1565 (arguments
1566 '(#:configure-flags
1567 (list "-DBUILD_SHARED_LIBS=ON"
1568 (string-append "-DCMAKE_PREFIX_PATH="
1569 (assoc-ref %build-inputs "aws-c-common")))))
1570 (propagated-inputs
1571 (list aws-c-common))
1572 (synopsis "Amazon Web Services compression library")
1573 (description
1574 "This library provides a C99 implementation of compression algorithms,
1575currently limited to Huffman encoding and decoding.")
1576 (home-page "https://github.com/awslabs/aws-c-compression")
1577 (license license:asl2.0)))
1578
1579(define-public aws-c-auth
1580 (package
1581 (name "aws-c-auth")
1582 ;; Update only when updating aws-crt-cpp.
1583 (version "0.9.0")
1584 (source (origin
1585 (method git-fetch)
1586 (uri (git-reference
1587 (url (string-append "https://github.com/awslabs/" name))
1588 (commit (string-append "v" version))))
1589 (file-name (git-file-name name version))
1590 (sha256
1591 (base32
1592 "1pfnd65q72rg4y062ajd5imzl6v4n2cgn7nimjxkb0p6shhd8c0z"))))
1593 (build-system cmake-build-system)
1594 (arguments
1595 '(#:configure-flags
1596 (list "-DBUILD_SHARED_LIBS=ON"
1597 (string-append "-DCMAKE_PREFIX_PATH="
1598 (assoc-ref %build-inputs "aws-c-common"))
1599 "-DENABLE_NET_TESTS=OFF")))
1600 (propagated-inputs
1601 (list aws-c-cal aws-c-common aws-c-http aws-c-io aws-c-sdkutils))
1602 (synopsis "Amazon Web Services client-side authentication library")
1603 (description
1604 "This library provides a C99 implementation for AWS client-side
1605authentication.")
1606 (home-page "https://github.com/awslabs/aws-c-auth")
1607 (license license:asl2.0)))
1608
1609(define-public aws-c-s3
1610 (package
1611 (name "aws-c-s3")
1612 ;; Update only when updating aws-crt-cpp.
1613 (version "0.7.13")
1614 (source (origin
1615 (method git-fetch)
1616 (uri (git-reference
1617 (url (string-append "https://github.com/awslabs/" name))
1618 (commit (string-append "v" version))))
1619 (file-name (git-file-name name version))
1620 (sha256
1621 (base32
1622 "0iqjhcfyg4nzgbr3ysc7lv7vfs6aw5wawh5927205w8di3f0r37b"))))
1623 (build-system cmake-build-system)
1624 (arguments
1625 '(#:configure-flags
1626 (list "-DBUILD_SHARED_LIBS=ON"
1627 (string-append "-DCMAKE_PREFIX_PATH="
1628 (assoc-ref %build-inputs "aws-c-common"))
1629 "-DENABLE_NET_TESTS=OFF")))
1630 (propagated-inputs
1631 (list aws-c-auth aws-c-http aws-checksums))
1632 (synopsis "Amazon Web Services client library for Amazon S3")
1633 (description
1634 "This library provides a C99 client implementation of the Simple Storage
1635Service (S3) protocol for object storage.")
1636 (home-page "https://github.com/awslabs/aws-c-s3")
1637 (license license:asl2.0)))
1638
1639(define-public aws-c-mqtt
1640 (package
1641 (name "aws-c-mqtt")
1642 ;; Update only when updating aws-crt-cpp.
1643 (version "0.12.2")
1644 (source (origin
1645 (method git-fetch)
1646 (uri (git-reference
1647 (url (string-append "https://github.com/awslabs/" name))
1648 (commit (string-append "v" version))))
1649 (file-name (git-file-name name version))
1650 (sha256
1651 (base32
1652 "1vcy2hd5h84pxjpig9rfa49v1d9nkjxjm1b24y1bs9l222q7g8sc"))))
1653 (build-system cmake-build-system)
1654 (arguments
1655 '(#:configure-flags
1656 (list "-DBUILD_SHARED_LIBS=ON"
1657 (string-append "-DCMAKE_PREFIX_PATH="
1658 (assoc-ref %build-inputs "aws-c-common")))))
1659 (propagated-inputs
1660 (list aws-c-http aws-c-io))
1661 (synopsis "Amazon Web Services MQTT library")
1662 (description
1663 "This library provides a C99 implementation of the Message Queuing
1664Telemetry Transport (MQTT) publish-subscribe messaging protocol.")
1665 (home-page "https://github.com/awslabs/aws-c-mqtt")
1666 (license license:asl2.0)))
1667
1668;; Note: there is another mimalloc embedded in rust-mimalloc (version 1.6.4).
1669(define-public mimalloc
1670 (package
1671 (name "mimalloc")
1672 (version "3.5.3")
1673 (source (origin
1674 (method git-fetch)
1675 (uri (git-reference
1676 (url "https://github.com/microsoft/mimalloc")
1677 (commit (string-append "v" version))))
1678 (file-name (git-file-name name version))
1679 (sha256
1680 (base32
1681 "1d92pi0y5255y1iwrliij8a7v1f2dpbg3h4f4mbzbnqismcwqqhs"))))
1682 (build-system cmake-build-system)
1683 (arguments
1684 `(#:build-type "Release"
1685 ,@(if (target-ppc32?)
1686 `(#:configure-flags '("-DMI_USE_LIBATOMIC=ON"))
1687 '())))
1688 (synopsis "General purpose memory allocator")
1689 (description "@code{mimalloc} is a drop-in replacement for @code{malloc}.")
1690 (home-page "https://microsoft.github.io/mimalloc/")
1691 (license license:expat)))
1692
1693(define-public mps
1694 (package
1695 (name "mps")
1696 (version "1.118.0")
1697 (source
1698 (origin
1699 (method git-fetch)
1700 (uri (git-reference
1701 (url "https://github.com/Ravenbrook/mps")
1702 (commit (string-append "release-" version))))
1703 (file-name (git-file-name name version))
1704 (sha256
1705 (base32 "078iv3fsz0dnfwb7g63apkvcksczbqfxrxm73k80jwnwca6pgafy"))))
1706 (build-system gnu-build-system)
1707 (arguments
1708 (list
1709 #:phases
1710 #~(modify-phases %standard-phases
1711 (add-after 'unpack 'patch-cflags
1712 ;; The recursive make call in the test suite doesn't pass CFLAGS
1713 ;; down properly so we need to do it ourselves
1714 (lambda _
1715 (substitute* "Makefile.in"
1716 (("CFLAGS=\"(.*)\"" _ flags)
1717 (string-append "CFLAGS=\"" flags " $(CFLAGS)\""))))))
1718 #:parallel-build? #f ;Parallel build fails
1719 #:test-target "test"
1720 #:make-flags
1721 #~(list "CFLAGS=-Wno-error=dangling-pointer -Wno-maybe-uninitialized"
1722 ;; These flags are needed for the recursive make calls in testing
1723 (string-append "CC=" #$(cc-for-target)) "-j" "1")))
1724 (inputs (list sqlite))
1725 (home-page "http://www.ravenbrook.com/project/mps")
1726 (synopsis "Memory pool system")
1727 (description
1728 "This package provides a cross-platform memory management system. It
1729permits the flexible combination of memory management techniques, supporting
1730manual and automatic memory management, in-line allocation, finalization,
1731weakness, and multiple concurrent co-operating incremental generational
1732garbage collections. It also includes a library of memory pool classes
1733implementing specialized memory management policies.")
1734 (license license:bsd-2)))
1735
1736;; Deprecated on 2026-07-08.
1737(define-deprecated/public-alias orangeduck-mpc
1738 (@ (gnu packages compiler-tools) orangeduck-mpc))
1739
1740;;; Factored out of the ck package so that it can be adjusted and called on
1741;;; the host side easily, without impacting the package definition.
1742(define (gnu-triplet->ck-machine target)
1743 (letrec-syntax
1744 ((matches (syntax-rules (=>)
1745 ((_ (target-prefix => machine) rest ...)
1746 (if (string-prefix? target-prefix target)
1747 machine
1748 (matches rest ...)))
1749 ((_)
1750 (error "unsupported target" target)))))
1751 ;; This basically reproduces the logic handling the
1752 ;; PLATFORM variable in the configure script of ck.
1753 (matches ("x86_64" => "x86_64")
1754 ("i586" => "x86")
1755 ("i686" => "x86")
1756 ("aarch64" => "aarch64")
1757 ("arm" => "arm")
1758 ("ppc64" => "ppc64")
1759 ("ppc" => "ppc")
1760 ("s390x" => "s390x")
1761 ("riscv64" => "riscv64")
1762 ("sparc64" => "sparcv9"))))
1763
1764(define-public ck
1765 (package
1766 (name "ck")
1767 (version "0.7.1")
1768 (source (origin
1769 (method git-fetch)
1770 (uri (git-reference
1771 (url "https://github.com/concurrencykit/ck")
1772 (commit version)))
1773 (file-name (git-file-name name version))
1774 (sha256
1775 (base32
1776 "020yzfpvymdc8lc44znlnxmxb8mvp42g4nb4p8k814klazqvwh0x"))))
1777 (build-system gnu-build-system)
1778 (arguments
1779 (list
1780 #:phases
1781 #~(modify-phases %standard-phases
1782 (replace 'configure
1783 ;; ck uses a custom configure script that stumbles on
1784 ;; '--enable-fast-install', among other things.
1785 (lambda* (#:key parallel-build? #:allow-other-keys)
1786 (define target-machine #$(and=> (%current-target-system)
1787 gnu-triplet->ck-machine))
1788 (when target-machine
1789 ;; The configure script doesn't currently work for
1790 ;; cross-compiling (see:
1791 ;; https://github.com/concurrencykit/ck/issues/191).
1792 (error "ck cannot currently be cross-compiled"))
1793 ;; The custom configure script doesn't make cross-compilation
1794 ;; adjustments itself, so manually set the archiver, compiler
1795 ;; and linker.
1796 (setenv "AR" #$(ar-for-target))
1797 (setenv "CC" #$(cc-for-target))
1798 (setenv "LD" #$(ld-for-target))
1799 (apply invoke "./configure"
1800 `(,@(if target-machine
1801 (list (string-append "--profile=" target-machine))
1802 '())
1803 ,(string-append "--prefix=" #$output)
1804 ,(string-append "--mandir=" #$output "/share/man")
1805 ,(string-append "--cores="
1806 ;; Tests require parallelism, and set upper limit as test
1807 ;; runtime scales superliniearly in the number of cores.
1808 (number->string (max 2 (min 8 (parallel-job-count))))))))))))
1809 (home-page "https://github.com/concurrencykit/ck")
1810 (synopsis "C library for concurrent systems")
1811 (description "Concurrency Kit (@code{ck}) provides concurrency primitives,
1812safe memory reclamation mechanisms and non-blocking (including lock-free) data
1813structures designed to aid in the research, design and implementation of high
1814performance concurrent systems developed in C99+.")
1815 (license (list license:bsd-2 ;everything except...
1816 license:asl2.0)))) ;src/ck_hp.c
1817
1818(define-public tinydir
1819 (package
1820 (name "tinydir")
1821 (version "1.2.6")
1822 (source (origin
1823 (method git-fetch)
1824 (uri (git-reference
1825 (url "https://github.com/cxong/tinydir")
1826 (commit version)))
1827 (file-name (git-file-name name version))
1828 (sha256
1829 (base32
1830 "143n6yabznxk032gv5g2k8glf0kzicarg9cx0714zsbfmzj8lr07"))
1831 (patches (search-patches "tinydir-fix-cbehave-test.patch"))
1832 (modules '((guix build utils)))
1833 (snippet '(delete-file-recursively "tests/cbehave"))))
1834 (build-system cmake-build-system)
1835 (arguments
1836 (list
1837 #:phases
1838 #~(modify-phases %standard-phases
1839 (add-after 'unpack 'path-cmake
1840 (lambda _
1841 (substitute* "tests/CMakeLists.txt"
1842 (("^include_dir.*cbehave.*")
1843 (string-append "include_directories("#$cbehave "/include)"))
1844 (("^add_subdir.*cbeha.*") ""))))
1845 (add-before 'configure 'chdir
1846 (lambda _
1847 (chdir "tests")))
1848 (replace 'install
1849 (lambda _
1850 (install-file "../tinydir.h"
1851 (string-append #$output "/include")))))))
1852 (native-inputs (list cbehave))
1853 (home-page "https://github.com/cxong/tinydir")
1854 (synopsis "List directories programmatically")
1855 (description "@code{tinydir} is a header-only C wrapper for listing
1856directory contents.")
1857 (license license:bsd-2)))
1858
1859(define-public libdispatch
1860 (package
1861 (name "libdispatch")
1862 (version "6.4.0")
1863 (source
1864 (origin
1865 (method git-fetch)
1866 (uri (git-reference
1867 (url "https://github.com/apple/swift-corelibs-libdispatch")
1868 (commit (string-append "swift-" version "-RELEASE"))))
1869 (file-name (git-file-name name version))
1870 (sha256
1871 (base32
1872 "1qai86iz8l1badw9vf3r8vypq9j78lid069b1wa9pj5nlpqvvj9w"))))
1873 (build-system cmake-build-system)
1874 (arguments
1875 (list
1876 #:configure-flags #~(list "-DCMAKE_C_COMPILER=clang"
1877 "-DCMAKE_CXX_COMPILER=clang++")))
1878 (native-inputs (list clang llvm))
1879 (home-page "https://apple.github.io/swift-corelibs-libdispatch/")
1880 (synopsis "Concurrent code execution on multicore hardware")
1881 (description
1882 "Grand Central Dispatch (GCD or libdispatch) implements a concurrency model
1883wherein program tasks are divided into work items. These can be run
1884sequentially or in parallel, with optional synchronization in between, and GCD
1885will take care of dispatching tasks to available cores.")
1886 (license license:asl2.0)))
1887
1888(define-public utf8-h
1889 ;; The latest tag is used as there is no release.
1890 (let ((commit "a6cd7d4329e9336518d2e2a449d4f3cb8def54cc")
1891 (revision "1"))
1892 (package
1893 (name "utf8-h")
1894 (version (git-version "0.0.0" revision commit))
1895 (source (origin
1896 (method git-fetch)
1897 (uri (git-reference
1898 (url "https://github.com/sheredom/utf8.h")
1899 (commit commit)))
1900 (file-name (git-file-name "utf8.h" version))
1901 (sha256
1902 (base32
1903 "095cmlj2522mp3p85nqilzhsg006n29vfzknc7r524c59zadii4x"))))
1904 (build-system cmake-build-system)
1905 (arguments
1906 (list
1907 #:phases
1908 #~(modify-phases %standard-phases
1909 (delete 'build)
1910 (delete 'configure)
1911 (replace 'check
1912 (lambda* (#:key tests? #:allow-other-keys)
1913 (when tests?
1914 (with-directory-excursion "test"
1915 (invoke "cmake" ".")
1916 (invoke "make")))))
1917 (replace 'install
1918 (lambda* (#:key outputs #:allow-other-keys)
1919 (install-file "utf8.h"
1920 (string-append #$output "/include/utf8")))))))
1921 (home-page "https://github.com/sheredom/utf8.h")
1922 (synopsis "Single header UTF-8 string functions for C and C++")
1923 (description "A simple one header solution to supporting UTF-8 strings in
1924C and C++. The functions it provides are like those from the C header
1925string.h, but with a utf8* prefix instead of the str* prefix.")
1926 (license license:unlicense))))
1927
1928(define-public simdutf
1929 (package
1930 (name "simdutf")
1931 (version "9.0.0")
1932 (source
1933 (origin
1934 (method git-fetch)
1935 (uri (git-reference
1936 (url "https://github.com/simdutf/simdutf")
1937 (commit (string-append "v" version))))
1938 (file-name (git-file-name name version))
1939 (sha256
1940 (base32 "0f5ccvqj7pfa69m9y1kxp2v1lybx6x8i9pykdqfkr7dydqbhrhx6"))))
1941 (build-system cmake-build-system)
1942 (arguments (list #:configure-flags
1943 #~(list "-DBUILD_SHARED_LIBS=ON"
1944 "-DSIMDUTF_ATOMIC_REF=ON"
1945 "-DSIMDUTF_ATOMIC_BASE64_TESTS=ON"
1946 ;; Using the C++20 standard is required to get
1947 ;; atomic ref features used in latest Node.
1948 "-DSIMDUTF_CXX_STANDARD=20")))
1949 (synopsis "SIMD Unicode validation and transcoding")
1950 (description
1951 "simdutf is a C++ library providing Unicode routines (UTF8, UTF16,
1952UTF32). These routines are optimized for many specific architectures using
1953SIMD (Single Instruction, Multiple Data) instructions.")
1954 (home-page "https://github.com/simdutf/simdutf")
1955 (license license:asl2.0)))
1956
1957(define-public utest-h
1958 ;; The latest commit is used as there is no release.
1959 (let ((commit "b9c006f31b266408bd53079ce7ad57939a237d9a")
1960 (revision "1"))
1961 (package
1962 (name "utest-h")
1963 (version (git-version "0.0.0" revision commit))
1964 (source (origin
1965 (method git-fetch)
1966 (uri (git-reference
1967 (url "https://github.com/sheredom/utest.h")
1968 (commit commit)))
1969 (file-name (git-file-name "utest.h" version))
1970 (sha256
1971 (base32
1972 "0zsi5bv85gnvq40hfw2vdphrv8bjxns6xs8v0rjhvddafwb1b7il"))))
1973 (build-system cmake-build-system)
1974 (arguments
1975 `(#:phases (modify-phases %standard-phases
1976 (delete 'build)
1977 (delete 'configure)
1978 (replace 'check
1979 (lambda* (#:key tests? #:allow-other-keys)
1980 (when tests?
1981 (with-directory-excursion "test"
1982 (invoke "cmake" ".")
1983 (invoke "make")))))
1984 (replace 'install
1985 (lambda* (#:key outputs #:allow-other-keys)
1986 (let ((out (assoc-ref outputs "out")))
1987 (install-file "utest.h"
1988 (string-append out "/include"))))))))
1989 (home-page "https://www.neilhenning.dev/utest_h/")
1990 (synopsis "Single-header unit testing framework for C and C++")
1991 (description
1992 "This package provides a header-only unit testing library for C/C++.")
1993 (license license:unlicense))))
1994
1995(define-public nsync
1996 (package
1997 (name "nsync")
1998 (version "1.26.0")
1999 (source (origin
2000 (method git-fetch)
2001 (uri (git-reference
2002 (url "https://github.com/google/nsync")
2003 (commit version)))
2004 (file-name (git-file-name name version))
2005 (sha256
2006 (base32
2007 "0qg58kkcbm4zqkql8j5yvrb7fpx09qsf7j93dwqb9s1y69l70kx4"))))
2008 (build-system cmake-build-system)
2009 (home-page "https://github.com/google/nsync")
2010 (synopsis "C library for synchronization primitives")
2011 (description
2012 "nsync is a C library that exports various synchronization primitives:
2013@enumerate
2014@item locks,
2015@item condition variables,
2016@item run-once initialization,
2017@item waitable counter (useful for barriers),
2018@item waitable bit (useful for cancellation, or other conditions).
2019@end enumerate
2020")
2021 (license license:asl2.0)))
2022
2023(define-public ispc
2024 (package
2025 (name "ispc")
2026 (version "1.29.1")
2027 (source
2028 (origin
2029 (method git-fetch)
2030 (uri (git-reference
2031 (url "https://github.com/ispc/ispc")
2032 (commit (string-append "v" version))))
2033 (file-name (git-file-name name version))
2034 (sha256
2035 (base32 "02n14684nqbp1sxpnjkg6r9vwpdzqiwwaqxlp9bjykd125834ip2"))))
2036 (build-system cmake-build-system)
2037 (arguments
2038 (list
2039 #:tests? #f
2040 #:configure-flags
2041 #~(list (string-append "-DCMAKE_C_COMPILER=" #$(cc-for-target))
2042 (string-append "-DCMAKE_CXX_COMPILER=" #$(cxx-for-target))
2043 (string-append "-DCLANG_EXECUTABLE="
2044 (assoc-ref %build-inputs "clang")
2045 "/bin/clang")
2046 (string-append "-DCLANGPP_EXECUTABLE="
2047 (assoc-ref %build-inputs "clang")
2048 "/bin/clang++"))
2049 #:phases
2050 #~(modify-phases %standard-phases
2051 (add-before 'configure 'patch-curses-requirement
2052 (lambda _
2053 (substitute* "CMakeLists.txt"
2054 (("\\bCURSES_CURSES_LIBRARY\\b")
2055 "CURSES_LIBRARY"))))
2056 ;; Note: This works around the following issue:
2057 ;; <https://github.com/ispc/ispc/issues/1865>
2058 ;; Because GCC in Guix does not have multilib support.
2059 (add-before 'configure 'patch-target-archs
2060 (lambda _
2061 (substitute* "cmake/GenerateBuiltins.cmake"
2062 (("\\bforeach \\(bit 32 64\\)")
2063 #$@(if (target-64bit?)
2064 '("foreach (bit 64)")
2065 '("foreach (bit 32)")))
2066 (("\\bforeach \\(arch .*?\\)")
2067 #$@(if (target-x86?)
2068 '("foreach (arch \"x86\")")
2069 '("foreach (arch \"arm\")")))
2070 (("\\bforeach \\(os_name \"windows\" .*?\\)")
2071 "foreach (os_name \"linux\")")))))))
2072 (inputs
2073 (list ncurses onetbb))
2074 (native-inputs
2075 (list bison clang-19 flex m4 python-minimal-wrapper))
2076 (supported-systems
2077 '("x86_64-linux" "i686-linux" "aarch64-linux" "armhf-linux"))
2078 (synopsis "Implicit SPMD Program Compiler")
2079 (description
2080 "ISPC is a compiler for a variant of the C programming language, with
2081extensions for single program, multiple data programming. Under the SPMD
2082model, the programmer writes a program that generally appears to be a regular
2083serial program, though the execution model is actually that a number of
2084program instances execute in parallel on the hardware.")
2085 (home-page "https://github.com/ispc/ispc")
2086 (license license:bsd-3)))
2087
2088(define-public pcg-c
2089 (let ((commit "83252d9c23df9c82ecb42210afed61a7b42402d7")
2090 (revision "1"))
2091 (package
2092 (name "pcg-c")
2093 (version (git-version "0.0.0" revision commit))
2094 (source (origin
2095 (method git-fetch)
2096 (uri (git-reference
2097 (url "https://github.com/imneme/pcg-c")
2098 (commit commit)))
2099 (file-name (git-file-name name version))
2100 (sha256
2101 (base32
2102 "0768h0vw75a3smk39qsz1504v04a43s5w1ili1ijbixxv8gm42nf"))
2103 (modules '((guix build utils)))
2104 ;; Autogenerated files with some tests from test-high. If
2105 ;; 128-bit integers are not supported, the build fails, but
2106 ;; this is checked when building the tests.
2107 (snippet #~(delete-file-recursively "sample"))))
2108 (build-system gnu-build-system)
2109 (arguments
2110 (list
2111 #:test-target "test"
2112 #:make-flags
2113 #~(list
2114 "CC=gcc"
2115 (string-append "PREFIX=" #$output))
2116 #:phases
2117 #~(modify-phases %standard-phases
2118 (delete 'configure)
2119 (add-after 'unpack 'disable-sample
2120 (lambda _
2121 (substitute* "Makefile"
2122 ((".*cd sample.*") ""))))
2123 (add-after 'unpack 'set-shared-library
2124 (lambda _
2125 (substitute* '("Makefile" "src/Makefile")
2126 (("\\.a") "\\.so")
2127 ((".*ar .*") "\t$(CC) $(CFLAGS) -o $@ $(LDFLAGS) -shared $^")
2128 ((".*ranlib.*") "")
2129 ((".*CFLAGS \\+=.*O3.*" orig)
2130 (string-append orig "CFLAGS += -fPIC\n")))))
2131 (add-before 'install 'make-dirs
2132 (lambda _
2133 (mkdir-p (string-append #$output "/lib"))
2134 (mkdir-p (string-append #$output "/include")))))))
2135 (home-page "https://www.pcg-random.org")
2136 (synopsis "C implementation of the PCG random generators")
2137 (description "The Permuted Congruential Generator (PCG) extends the
2138Linear Congruential Generator (LCG) with a permutation function to increase
2139output randomness while retaining speed, simplicity, and conciseness.")
2140 (license (list license:expat license:asl2.0))))) ; dual licensed
2141
2142(define-public xstructs
2143 ;; Project has no release, using latest commit and 1.0 base version
2144 ;; as showed on meson.build.
2145 (let ((commit "c987a686b8b03777e9177df9e9d589a5b16b7bb9")
2146 (revision "0"))
2147 (package
2148 (name "xstructs")
2149 (version (git-version "1.0.0" revision commit))
2150 (source
2151 (origin
2152 (method git-fetch)
2153 (uri (git-reference
2154 (url "https://github.com/64-bitman/xstructs")
2155 (commit commit)))
2156 (file-name (git-file-name name version))
2157 (sha256
2158 (base32 "1mr6f8yj1dgap47l1sslbnjw5qhd9rz9sbkdsd2lbd1rqzvn5c9v"))))
2159 (build-system meson-build-system)
2160 (arguments
2161 (list
2162 #:phases
2163 #~(modify-phases %standard-phases
2164 (add-after 'install 'install-headers-and-pc
2165 (lambda _
2166 (let ((include-dir (string-append #$output "/include"))
2167 (pkgconfig (string-append #$output "/lib/pkgconfig")))
2168 (chdir "../source")
2169 (install-file "xarray.h" include-dir)
2170 (install-file "xlist.h" include-dir)
2171 (with-output-to-file "xstructs.pc"
2172 (lambda ()
2173 (format #t "\
2174prefix=~a
2175includedir=${prefix}/include
2176
2177Name: xstructs
2178Description: Xstructs provides data structures: array and linked list.
2179Version: 1.0
2180Cflags: -I${includedir}
2181" #$output)))
2182 (install-file "xstructs.pc" pkgconfig))))
2183 (add-after 'install 'install-source
2184 (lambda _
2185 (copy-recursively #$source (string-append #$output "/xstructs")))))))
2186 (home-page "https://github.com/64-bitman/xstructs")
2187 (synopsis "Typed data structures")
2188 (description
2189 "Xstructs provides some typed generic data structures: array and linked list.")
2190 (license license:unlicense))))
2191
2192(define-public yyjson
2193 (package
2194 (name "yyjson")
2195 (version "0.12.0")
2196 (source
2197 (origin
2198 (method git-fetch)
2199 (uri (git-reference
2200 (url "https://github.com/ibireme/yyjson")
2201 (commit version)))
2202 (file-name (git-file-name name version))
2203 (sha256
2204 (base32 "1v7vgb0wkhh23vyqnch1aiswrgy8rb7yhbyrm7gcwl8c0l92f9nl"))))
2205 (build-system cmake-build-system)
2206 (arguments
2207 (list
2208 #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON"
2209 "-DYYJSON_BUILD_TESTS=ON")))
2210 (home-page "https://github.com/ibireme/yyjson")
2211 (synopsis "C implementation of JSON RFC 8259")
2212 (description
2213 "This package provides an implementation of JSON in ANSI C as specified
2214in RFC 8259.
2215Features:
2216@itemize
2217@item Fast: can read or write gigabytes per second JSON data on modern CPUs.
2218@item Portable: complies with ANSI C (C89) for cross-platform compatibility.
2219@item Strict: complies with
2220@url{https://datatracker.ietf.org/doc/html/rfc8259,RFC 8259} JSON standard,
2221ensuring strict number format and UTF-8 validation.
2222@item Extendable: offers options to allow comments, trailing commas, NaN/Inf,
2223 and custom memory allocator.
2224@item Accuracy: can accurately read and write @code{int64}, @code{uint64}, and
2225@code{double} numbers.
2226@item Flexible: supports unlimited JSON nesting levels, @code{\\u0000}
2227characters, and non null-terminated strings.
2228@item Manipulation: supports querying and modifying using JSON Pointer,
2229JSON Patch and JSON Merge Patch.
2230@item Developer-Friendly: easy integration with only one @code{.h} and one
2231@code{.c} file.
2232@end itemize")
2233 (license license:expat)))
2234
2235(define-public kefir
2236 (package
2237 (name "kefir")
2238 (version "0.5.0")
2239 (source
2240 (origin
2241 (method git-fetch)
2242 (uri (git-reference
2243 (url "https://git.sr.ht/~jprotopopov/kefir")
2244 (commit (string-append "v" version))))
2245 (file-name (git-file-name name version))
2246 (sha256
2247 (base32
2248 "01jclalg2mz68rcfn287kjd13inbhkgh2kslb54sjyqx3hypq4vb"))))
2249 (build-system gnu-build-system)
2250 (native-inputs
2251 (list m4))
2252 (arguments
2253 (list
2254 #:test-target "test"
2255 #:make-flags
2256 #~(list
2257 (string-append "CC=" #$(cc-for-target))
2258 (string-append "PREFIX=" #$output))
2259 #:phases
2260 #~(modify-phases %standard-phases
2261 (delete 'configure)
2262 (add-after 'unpack 'patch-install
2263 (lambda _
2264 (substitute* "Makefile.mk"
2265 (("^EXTRA_LDFLAGS=.*$")
2266 (string-append "EXTRA_LDFLAGS=-Wl,-rpath,"
2267 #$output
2268 "/lib\n")))
2269 (substitute* "install.mk"
2270 (("^prefix=.*$")
2271 (string-append "prefix=" #$output
2272 "\n"))))))))
2273 (home-page "https://kefir.protopopov.lv/")
2274 (synopsis "C17/C23 programming language compiler")
2275 (description "Kefir is an independent compiler for the C17/C23 programming
2276language, developed by Jevgenij Protopopov. Kefir has been validated with a
2277test suite of 80 software projects, among which are GNU core- and binutils,
2278Curl, Nginx, OpenSSL, Perl, Postgresql, Tcl and many others. The compiler
2279targets x86_64 architecture and System-V AMD64 ABI, supporting Linux, FreeBSD,
2280NetBSD an OpenBSD.")
2281 (license license:gpl3)))
2282
2283(define-public libsais
2284 (package
2285 (name "libsais")
2286 (version "2.10.4")
2287 (source
2288 (origin
2289 (method git-fetch)
2290 (uri (git-reference
2291 (url "https://github.com/IlyaGrebnov/libsais")
2292 (commit (string-append "v" version))))
2293 (file-name (git-file-name name version))
2294 (sha256
2295 (base32 "1w488a43rjg9c6w6gr1nap995zshy45s2girh4fxjz63k0ia5c80"))))
2296 (build-system cmake-build-system)
2297 (arguments
2298 (list
2299 ;; no tests
2300 #:tests? #f
2301 #:configure-flags
2302 #~(list "-DLIBSAIS_BUILD_SHARED_LIB:bool=ON"
2303 "-DLIBSAIS_USE_OPENMP:bool=ON")))
2304 (home-page "https://github.com/IlyaGrebnov/libsais")
2305 (synopsis "Library for Linear Suffix Array Construction")
2306 (description
2307 "The libsais library provides fast linear-time construction of
2308suffix array (SA), generalized suffix array (GSA), longest common prefix (LCP)
2309array, permuted LCP (PLCP) array, Burrows-Wheeler transform (BWT) and inverse
2310BWT based on the induced sorting algorithm with OpenMP support for multi-core
2311parallel construction.")
2312 (properties '((tunable? . #t)))
2313 (license license:asl2.0)))