mimalloc: Fixes and portability improvements

Co-authored-by: kirillrdy <kirillrdy@gmail.com>
Co-authored-by: SandaruKasa <sandarukasa@ya.ru>
This commit is contained in:
Joshua Leivenzon
2026-02-09 22:38:33 +03:00
committed by SandaruKasa
co-authored by kirillrdy SandaruKasa
parent 41236131f7
commit 9b986c917b
+10 -1
View File
@@ -37,10 +37,19 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = lib.mapAttrsToList lib.cmakeBool {
MI_INSTALL_TOPLEVEL = true;
MI_SECURE = secureBuild;
MI_BUILD_SHARED = !stdenv.hostPlatform.isStatic;
MI_BUILD_SHARED = stdenv.hostPlatform.hasSharedLibraries;
MI_LIBC_MUSL = stdenv.hostPlatform.libc == "musl";
MI_BUILD_TESTS = finalAttrs.doCheck;
};
postPatch = ''
substituteInPlace cmake/mimalloc-config.cmake \
--replace-fail 'string(REPLACE "/lib/cmake" "/lib" MIMALLOC_LIBRARY_DIR "''${MIMALLOC_CMAKE_DIR}")' \
"set(MIMALLOC_LIBRARY_DIR \"$out/lib\")" \
--replace-fail 'string(REPLACE "/lib/cmake/" "/lib/" MIMALLOC_OBJECT_DIR "''${CMAKE_CURRENT_LIST_DIR}")' \
"set(MIMALLOC_OBJECT_DIR \"$out/lib\")"
'';
postInstall =
let
rel = lib.versions.majorMinor finalAttrs.version;