about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/mimalloc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-15 10:36:38 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-16 11:37:19 +0000
commitd435710923ac6e6f9fc155534800745004f2ce93 (patch)
tree386f9401476f96bdc6ec25173a090198942b5d5b /nixpkgs/pkgs/development/libraries/mimalloc
parentc725f0011e91ae49d351b981690eb66b862b6104 (diff)
parent3239fd2b8f728106491154b44625662e10259af2 (diff)
downloadnixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.gz
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.bz2
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.lz
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.xz
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.zst
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.zip
Merge commit '3239fd2b8f728106491154b44625662e10259af2'
Conflicts:
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/mimalloc')
-rw-r--r--nixpkgs/pkgs/development/libraries/mimalloc/default.nix26
1 files changed, 20 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/libraries/mimalloc/default.nix b/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
index 1e9e44e09973..22d4567c562d 100644
--- a/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
@@ -1,4 +1,5 @@
 { lib, stdenv, fetchFromGitHub, cmake, ninja
+, fetchpatch
 , secureBuild ? false
 }:
 
@@ -7,14 +8,28 @@ let
 in
 stdenv.mkDerivation rec {
   pname   = "mimalloc";
-  version = "2.0.2";
+  version = "2.0.5";
 
   src = fetchFromGitHub {
     owner  = "microsoft";
     repo   = pname;
     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 ];
   cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ];
@@ -25,10 +40,9 @@ stdenv.mkDerivation rec {
   in ''
     # first, move headers and cmake files, that's easy
     mkdir -p $dev/lib
-    mv $out/include $dev/include
-    mv $out/cmake $dev/lib/
+    mv $out/lib/cmake $dev/lib/
 
-    find $out/lib
+    find $dev $out -type f
   '' + (lib.optionalString secureBuild ''
     # pretend we're normal mimalloc
     ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${suffix}
@@ -44,6 +58,6 @@ stdenv.mkDerivation rec {
     homepage    = "https://github.com/microsoft/mimalloc";
     license     = licenses.bsd2;
     platforms   = platforms.unix;
-    maintainers = with maintainers; [ thoughtpolice ];
+    maintainers = with maintainers; [ kamadorueda thoughtpolice ];
   };
 }