projects/guix·blob ruby-team · refs

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