git.iko.soy/typeable/nixpkgs
on master help sign in
mimalloc: un-break dynamic linking

Previous versions of the build assumed libmimalloc.so would be a hard copy of mimalloc-secure.so iff secureBuild == true, but in 1.1.0 and later it seems libmimalloc.so is a symlink to the -secure variant. This apparently rectifies some behavior I noticed that was strange previously. This breakage wasn't caught because the 1.1.0 update was automatic in 5596317d4; there should be a checkPhase to ensure this doesn't happen again... Signed-off-by: Austin Seipp <aseipp@pobox.com>

commit4d3920996105278ffa6c2a88e78afb6243bef719 authorAustin Seipp <aseipp@pobox.com> dateTue 3 Dec 2019, 13:41 (7 years ago) parenta431ee8
1 file changed+9−8
pkgs/development/libraries/mimalloc/default.nix+9−8
pkgs/development/libraries/mimalloc/default.nix+9−8
@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, cmake
1+{ stdenv, fetchFromGitHub, cmake, ninja
22, secureBuild ? true
33}:
44
@@ -6,32 +6,33 @@ let
66 soext = stdenv.hostPlatform.extensions.sharedLibrary;
77in
88stdenv.mkDerivation rec {
9− name = "mimalloc-${version}";
9+ pname = "mimalloc";
1010 version = "1.1.0";
1111
1212 src = fetchFromGitHub {
1313 owner = "microsoft";
14− repo = "mimalloc";
14+ repo = pname;
1515 rev = "refs/tags/v${version}";
1616 sha256 = "1i8pwzpcmbf7dxncb984xrnczn1737xqhf1jaizlyw0k1hpiam4v";
1717 };
1818
19− nativeBuildInputs = [ cmake ];
19+ nativeBuildInputs = [ cmake ninja ];
2020 enableParallelBuilding = true;
21−
2221 cmakeFlags = stdenv.lib.optional secureBuild [ "-DMI_SECURE=ON" ];
2322
2423 postInstall = ''
24+ # first, install headers, that's easy
2525 mkdir -p $dev
2626 mv $out/lib/*/include $dev/include
2727
28− rm -f $out/lib/libmimalloc*${soext} # weird duplicate
29−
28+ # move everything else into place
3029 mv $out/lib/*/libmimalloc*${soext} $out/lib/libmimalloc${soext}
3130 mv $out/lib/*/libmimalloc*.a $out/lib/libmimalloc.a
3231 mv $out/lib/*/mimalloc*.o $out/lib/mimalloc.o
3332
34− rm -rf $out/lib/mimalloc-*
33+ # remote duplicate dir. FIXME: try to fix the .cmake file distribution
34+ # so we can re-use it for dependencies...
35+ rm -r $out/lib/mimalloc-1.0/
3536 '';
3637
3738 outputs = [ "out" "dev" ];