Unverified Commit 88f95454 authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

Merge pull request #216226 from tux1c/mongoc-1.23.2

mongoc: 1.23.1 -> 1.23.2
parents 67176fa6 3dbc3b9c
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -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;