summary refs log tree commit diff
path: root/pkgs/development/libraries/mongoc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/mongoc/default.nix')
-rw-r--r--pkgs/development/libraries/mongoc/default.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/development/libraries/mongoc/default.nix b/pkgs/development/libraries/mongoc/default.nix
index ecb247de0ba..905d8330fe4 100644
--- a/pkgs/development/libraries/mongoc/default.nix
+++ b/pkgs/development/libraries/mongoc/default.nix
@@ -10,21 +10,35 @@
   cyrus_sasl,
   libbson,
   snappy,
+  darwin,
 }:
+let
+  inherit (darwin.apple_sdk.frameworks) Security;
+in
 stdenv.mkDerivation rec {
   pname = "mongoc";
-  version = "1.23.1";
+  version = "1.23.2";
 
   src = fetchzip {
     url = "https://github.com/mongodb/mongo-c-driver/releases/download/${version}/mongo-c-driver-${version}.tar.gz";
-    sha256 = "1vnnk3pwbcmwva1010bl111kdcdx3yb2w7j7a78hhvrm1k9r1wp8";
+    sha256 = "08v7xc5m86apd338swd8g83ccvd6ni75xbdhqqwkrjbznljf8fjf";
   };
 
   # https://github.com/NixOS/nixpkgs/issues/25585
   preFixup = ''rm -rf "$(pwd)" '';
+  # https://github.com/mongodb/mongo-c-driver/pull/1157
+  # related:
+  # https://github.com/NixOS/nixpkgs/issues/144170
+  # mongoc's cmake incorrectly injects a prefix to library paths, breaking Nix. This removes the prefix from paths.
+  postPatch = ''
+    substituteInPlace src/libmongoc/CMakeLists.txt \
+      --replace "\\\''${prefix}/" ""
+    substituteInPlace src/libbson/CMakeLists.txt \
+      --replace "\\\''${prefix}/" ""
+  '';
 
   nativeBuildInputs = [cmake pkg-config perl];
-  buildInputs = [openssl zlib cyrus_sasl];
+  buildInputs = [openssl zlib cyrus_sasl] ++ lib.optionals stdenv.isDarwin [Security];
   propagatedBuildInputs = [libbson snappy];
 
   # -DMONGOC_TEST_USE_CRYPT_SHARED=OFF
@@ -35,6 +49,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with lib; {
+    broken = stdenv.isDarwin && stdenv.isx86_64;
     description = "The official C client library for MongoDB";
     homepage = "http://mongoc.org";
     license = licenses.asl20;