mimalloc: 2.0.2 -> 2.0.5
This commit is contained in:
parent
6cb23bdec7
commit
9ba8bda313
@ -1,4 +1,5 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub, cmake, ninja
|
{ lib, stdenv, fetchFromGitHub, cmake, ninja
|
||||||
|
, fetchpatch
|
||||||
, secureBuild ? false
|
, secureBuild ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -7,14 +8,28 @@ let
|
|||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "mimalloc";
|
pname = "mimalloc";
|
||||||
version = "2.0.2";
|
version = "2.0.5";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "microsoft";
|
owner = "microsoft";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-n4FGld3bq6ZOSLTzXcVlucCGbQ5/eSFbijU0dfBD/T0=";
|
sha256 = "sha256-q3W/w1Ofqt6EbKF/Jf9wcC+7jAxh59B3cOGxudWQXlA=";
|
||||||
};
|
};
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
name = "older-macos-fixes.patch";
|
||||||
|
url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch";
|
||||||
|
sha256 = "15qx2a3axhhwbfzxdis98b8j14y9cfgca0i484aj2pjpqnm0pb8c";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
doCheck = true;
|
||||||
|
preCheck = let
|
||||||
|
ldLibraryPathEnv = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
|
||||||
|
in ''
|
||||||
|
export ${ldLibraryPathEnv}="$(pwd)/build:''${${ldLibraryPathEnv}}"
|
||||||
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ninja ];
|
nativeBuildInputs = [ cmake ninja ];
|
||||||
cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ];
|
cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ];
|
||||||
@ -25,10 +40,9 @@ stdenv.mkDerivation rec {
|
|||||||
in ''
|
in ''
|
||||||
# first, move headers and cmake files, that's easy
|
# first, move headers and cmake files, that's easy
|
||||||
mkdir -p $dev/lib
|
mkdir -p $dev/lib
|
||||||
mv $out/include $dev/include
|
mv $out/lib/cmake $dev/lib/
|
||||||
mv $out/cmake $dev/lib/
|
|
||||||
|
|
||||||
find $out/lib
|
find $dev $out -type f
|
||||||
'' + (lib.optionalString secureBuild ''
|
'' + (lib.optionalString secureBuild ''
|
||||||
# pretend we're normal mimalloc
|
# pretend we're normal mimalloc
|
||||||
ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${suffix}
|
ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${suffix}
|
||||||
@ -44,6 +58,6 @@ stdenv.mkDerivation rec {
|
|||||||
homepage = "https://github.com/microsoft/mimalloc";
|
homepage = "https://github.com/microsoft/mimalloc";
|
||||||
license = licenses.bsd2;
|
license = licenses.bsd2;
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = with maintainers; [ thoughtpolice ];
|
maintainers = with maintainers; [ kamadorueda thoughtpolice ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user