From 8104ab2b4eb144d8e938505d535f6a76ae41feba Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 4 Nov 2023 22:01:36 +0200 Subject: [PATCH] gnu: Add rust-jemalloc-ctl-0.5. * gnu/packages/crates-io.scm (rust-jemalloc-ctl-0.5): New variable. Change-Id: I3e6c1aa07970bfa80ee6b5abba37710b7398af47 --- gnu/packages/crates-io.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index fa3aec9253..4adfe8eda4 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -37565,6 +37565,41 @@ (define-public rust-javascriptcore-rs-sys-0.2 "Sys functions for the Rust bindings of the javacriptcore library.") (license license:expat))) +(define-public rust-jemalloc-ctl-0.5 + (package + (name "rust-jemalloc-ctl") + (version "0.5.4") + (source + (origin + (method url-fetch) + (uri (crate-uri "jemalloc-ctl" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "0g5nb2aam7kc9vbbps25j99z80hlb7p14p8k9q2lqd2a882wgzvw")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs (("rust-jemalloc-sys" ,rust-jemalloc-sys-0.5) + ("rust-libc" ,rust-libc-0.2) + ("rust-paste" ,rust-paste-1)) + #:cargo-development-inputs (("rust-jemallocator" ,rust-jemallocator-0.5)) + #:phases + (modify-phases %standard-phases + (add-after 'configure 'override-jemalloc + (lambda* (#:key inputs #:allow-other-keys) + (let ((jemalloc (assoc-ref inputs "jemalloc"))) + ;; This flag is needed when not using the bundled jemalloc. + ;; https://github.com/tikv/jemallocator/issues/19 + (setenv "CARGO_FEATURE_UNPREFIXED_MALLOC_ON_SUPPORTED_PLATFORMS" "1") + (setenv "JEMALLOC_OVERRIDE" + (string-append jemalloc "/lib/libjemalloc_pic.a")))))))) + (native-inputs (list jemalloc)) + (home-page "https://github.com/tikv/jemallocator") + (synopsis "Wrapper over jemalloc's control and introspection APIs") + (description + "This package provides a safe wrapper over jemalloc's control and +introspection APIs.") + (license (list license:expat license:asl2.0)))) + (define-public rust-jemalloc-sys-0.5 (package (name "rust-jemalloc-sys")