Merge pull request #128579 from mikroskeem/mimalloc-update
mimalloc: 2.0.0 -> 2.0.2
This commit is contained in:
commit
fd8d53587c
1 changed files with 15 additions and 23 deletions
|
@ -7,42 +7,35 @@ let
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "mimalloc";
|
pname = "mimalloc";
|
||||||
version = "2.0.0";
|
version = "2.0.2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "microsoft";
|
owner = "microsoft";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-BMDCreY41CxJaPo9BdSRZlqh/YjtPC9aI/Zxt501e+0=";
|
sha256 = "sha256-n4FGld3bq6ZOSLTzXcVlucCGbQ5/eSFbijU0dfBD/T0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ninja ];
|
nativeBuildInputs = [ cmake ninja ];
|
||||||
cmakeFlags = lib.optional secureBuild [ "-DMI_SECURE=ON" ];
|
cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ];
|
||||||
|
|
||||||
postInstall = let
|
postInstall = let
|
||||||
rel = lib.versions.majorMinor version;
|
rel = lib.versions.majorMinor version;
|
||||||
|
suffix = if stdenv.isLinux then "${soext}.${rel}" else ".${rel}${soext}";
|
||||||
in ''
|
in ''
|
||||||
# first, install headers, that's easy
|
# first, move headers and cmake files, that's easy
|
||||||
mkdir -p $dev
|
mkdir -p $dev/lib
|
||||||
mv $out/lib/*/include $dev/include
|
mv $out/include $dev/include
|
||||||
|
mv $out/cmake $dev/lib/
|
||||||
|
|
||||||
# move .a and .o files into place
|
|
||||||
find $out/lib
|
find $out/lib
|
||||||
mv $out/lib/mimalloc-${rel}/libmimalloc*.a $out/lib/libmimalloc.a
|
'' + (lib.optionalString secureBuild ''
|
||||||
mv $out/lib/mimalloc-${rel}/mimalloc*.o $out/lib/mimalloc.o
|
# pretend we're normal mimalloc
|
||||||
|
ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${suffix}
|
||||||
'' + (if secureBuild then ''
|
ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${soext}
|
||||||
mv $out/lib/mimalloc-${rel}/libmimalloc-secure${soext}.${rel} $out/lib/libmimalloc-secure${soext}.${rel}
|
ln -sfv $out/lib/libmimalloc-secure.a $out/lib/libmimalloc.a
|
||||||
ln -sfv $out/lib/libmimalloc-secure${soext}.${rel} $out/lib/libmimalloc-secure${soext}
|
ln -sfv $out/lib/mimalloc-secure.o $out/lib/mimalloc.o
|
||||||
ln -sfv $out/lib/libmimalloc-secure${soext}.${rel} $out/lib/libmimalloc${soext}
|
'');
|
||||||
'' else ''
|
|
||||||
mv $out/lib/mimalloc-${rel}/libmimalloc${soext}.${rel} $out/lib/libmimalloc${soext}.${rel}
|
|
||||||
ln -sfv $out/lib/libmimalloc${soext}.${rel} $out/lib/libmimalloc${soext}
|
|
||||||
'') + ''
|
|
||||||
# remote duplicate dir. FIXME: try to fix the .cmake file distribution
|
|
||||||
# so we can re-use it for dependencies...
|
|
||||||
rm -rf $out/lib/mimalloc-${rel}
|
|
||||||
'';
|
|
||||||
|
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
|
@ -52,6 +45,5 @@ stdenv.mkDerivation rec {
|
||||||
license = licenses.bsd2;
|
license = licenses.bsd2;
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = with maintainers; [ thoughtpolice ];
|
maintainers = with maintainers; [ thoughtpolice ];
|
||||||
badPlatforms = platforms.darwin;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue