diff options
author | Austin Seipp <aseipp@pobox.com> | 2019-12-03 13:41:28 -0600 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2019-12-03 13:50:14 -0600 |
commit | 4d3920996105278ffa6c2a88e78afb6243bef719 (patch) | |
tree | 0af01ee08c7cd600b30810dbbe5235c9c963fa89 /pkgs/development/libraries/mimalloc | |
parent | a431ee8441bd666aefeba784a79040dedcc1c344 (diff) |
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>
Diffstat (limited to 'pkgs/development/libraries/mimalloc')
-rw-r--r-- | pkgs/development/libraries/mimalloc/default.nix | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/pkgs/development/libraries/mimalloc/default.nix b/pkgs/development/libraries/mimalloc/default.nix index 460be100b166e..17b53c88e9fb7 100644 --- a/pkgs/development/libraries/mimalloc/default.nix +++ b/pkgs/development/libraries/mimalloc/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, cmake +{ stdenv, fetchFromGitHub, cmake, ninja , secureBuild ? true }: @@ -6,32 +6,33 @@ let soext = stdenv.hostPlatform.extensions.sharedLibrary; in stdenv.mkDerivation rec { - name = "mimalloc-${version}"; + pname = "mimalloc"; version = "1.1.0"; src = fetchFromGitHub { owner = "microsoft"; - repo = "mimalloc"; + repo = pname; rev = "refs/tags/v${version}"; sha256 = "1i8pwzpcmbf7dxncb984xrnczn1737xqhf1jaizlyw0k1hpiam4v"; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake ninja ]; enableParallelBuilding = true; - cmakeFlags = stdenv.lib.optional secureBuild [ "-DMI_SECURE=ON" ]; postInstall = '' + # first, install headers, that's easy mkdir -p $dev mv $out/lib/*/include $dev/include - rm -f $out/lib/libmimalloc*${soext} # weird duplicate - + # move everything else into place mv $out/lib/*/libmimalloc*${soext} $out/lib/libmimalloc${soext} mv $out/lib/*/libmimalloc*.a $out/lib/libmimalloc.a mv $out/lib/*/mimalloc*.o $out/lib/mimalloc.o - rm -rf $out/lib/mimalloc-* + # remote duplicate dir. FIXME: try to fix the .cmake file distribution + # so we can re-use it for dependencies... + rm -r $out/lib/mimalloc-1.0/ ''; outputs = [ "out" "dev" ]; |