Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 24.05-beta 24 lines 719 B view raw
1{ lib 2, stdenv 3, jemalloc 4, writeText 5 6, unprefixed ? false 7}: 8 9let 10 # On some platforms the unprefixed feature will be ignored: 11 # https://github.com/tikv/jemallocator/blob/ab0676d77e81268cd09b059260c75b38dbef2d51/jemalloc-sys/src/env.rs 12 unprefixed' = unprefixed && !stdenv.hostPlatform.isMusl && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isAndroid; 13 14in jemalloc.overrideAttrs (oldAttrs: { 15 configureFlags = oldAttrs.configureFlags ++ [ 16 "--with-private-namespace=_rjem_" 17 ] ++ lib.optionals (!unprefixed') [ 18 "--with-jemalloc-prefix=_rjem_" 19 ]; 20 21 setupHook = writeText "setup-hook.sh" '' 22 export JEMALLOC_OVERRIDE="@out@/lib/libjemalloc${stdenv.hostPlatform.extensions.library}" 23 ''; 24})