diff options
Diffstat (limited to 'gnu/packages/c.scm')
-rw-r--r-- | gnu/packages/c.scm | 66 |
1 files changed, 62 insertions, 4 deletions
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index ea58c68262..ac83336ba5 100644 --- a/gnu/packages/c.scm +++ b/gnu/packages/c.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2016, 2017, 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2018, 2020–2022 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz> -;;; Copyright © 2019, 2020, 2022 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2019, 2020, 2022, 2023 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2019, 2021 Guillaume Le Vaillant <glv@posteo.net> ;;; Copyright © 2019 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> @@ -20,6 +20,7 @@ ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org> ;;; Copyright © 2023 zamfofex <zamfofex@twdb.moe> ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com> +;;; Copyright © 2023 David Elsing <david.elsing@posteo.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1198,7 +1199,7 @@ Telemetry Transport (MQTT) publish-subscribe messaging protocol.") (define-public mimalloc (package (name "mimalloc") - (version "2.0.9") + (version "2.1.2") (source (origin (method git-fetch) (uri (git-reference @@ -1207,10 +1208,13 @@ Telemetry Transport (MQTT) publish-subscribe messaging protocol.") (file-name (git-file-name name version)) (sha256 (base32 - "19w0i28p6knjd192rrcw1ayc3x0qp6rcm48cwkls4kwn8fng81fj")))) + "1pyf05snc1ib7zjjm9kspvbmynd8lmxqw72qcpz8lcyzyywmz24i")))) (build-system cmake-build-system) (arguments - `(#:build-type "Release")) + `(#:build-type "Release" + ,@(if (target-ppc32?) + `(#:configure-flags '("-DMI_USE_LIBATOMIC=ON")) + '()))) (synopsis "General purpose memory allocator") (description "@code{mimalloc} is a drop-in replacement for @code{malloc}.") (home-page "https://microsoft.github.io/mimalloc/") @@ -1585,3 +1589,57 @@ serial program, though the execution model is actually that a number of program instances execute in parallel on the hardware.") (home-page "https://github.com/ispc/ispc") (license license:bsd-3))) + +(define-public pcg-c + (let ((commit "83252d9c23df9c82ecb42210afed61a7b42402d7") + (revision "1")) + (package + (name "pcg-c") + (version (git-version "0.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/imneme/pcg-c") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0768h0vw75a3smk39qsz1504v04a43s5w1ili1ijbixxv8gm42nf")) + (modules '((guix build utils))) + ;; Autogenerated files with some tests from test-high. If + ;; 128-bit integers are not supported, the build fails, but + ;; this is checked when building the tests. + (snippet #~(delete-file-recursively "sample")))) + (build-system gnu-build-system) + (arguments + (list + #:test-target "test" + #:make-flags + #~(list + "CC=gcc" + (string-append "PREFIX=" #$output)) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'disable-sample + (lambda _ + (substitute* "Makefile" + ((".*cd sample.*") "")))) + (add-after 'unpack 'set-shared-library + (lambda _ + (substitute* '("Makefile" "src/Makefile") + (("\\.a") "\\.so") + ((".*ar .*") "\t$(CC) $(CFLAGS) -o $@ $(LDFLAGS) -shared $^") + ((".*ranlib.*") "") + ((".*CFLAGS \\+=.*O3.*" orig) + (string-append orig "CFLAGS += -fPIC\n"))))) + (add-before 'install 'make-dirs + (lambda _ + (mkdir-p (string-append #$output "/lib")) + (mkdir-p (string-append #$output "/include"))))))) + (home-page "https://www.pcg-random.org") + (synopsis "C implementation of the PCG random generators") + (description "The Permuted Congruential Generator (PCG) extends the +Linear Congruential Generator (LCG) with a permutation function to increase +output randomness while retaining speed, simplicity, and conciseness.") + (license (list license:expat license:asl2.0))))) ; dual licensed |