Merge pull request #210903 from yu-re-ka/mimalloc-static

mimalloc: fix static build
This commit is contained in:
Jörg Thalheim 2023-01-16 01:02:13 +01:00 committed by GitHub
commit 876b1d46f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-0gX0rEOWT6Lp5AyRyrK5GPTBvAqc5SxSaNJOc5GIgKc="; sha256 = "sha256-0gX0rEOWT6Lp5AyRyrK5GPTBvAqc5SxSaNJOc5GIgKc=";
}; };
doCheck = true; doCheck = !stdenv.hostPlatform.isStatic;
preCheck = let preCheck = let
ldLibraryPathEnv = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; ldLibraryPathEnv = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in '' in ''
@ -24,7 +24,11 @@ stdenv.mkDerivation rec {
''; '';
nativeBuildInputs = [ cmake ninja ]; nativeBuildInputs = [ cmake ninja ];
cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optionals secureBuild [ "-DMI_SECURE=ON" ]; cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ]
++ lib.optionals secureBuild [ "-DMI_SECURE=ON" ]
++ lib.optionals stdenv.hostPlatform.isStatic [ "-DMI_BUILD_SHARED=OFF" ]
++ lib.optionals (!doCheck) [ "-DMI_BUILD_TESTS=OFF" ]
;
postInstall = let postInstall = let
rel = lib.versions.majorMinor version; rel = lib.versions.majorMinor version;