depot/third_party/nixpkgs/pkgs/development/libraries/mongocxx/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

57 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, mongoc
, openssl
, cyrus_sasl
, cmake
, validatePkgConfig
, testers
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mongocxx";
version = "3.8.1";
src = fetchFromGitHub {
owner = "mongodb";
repo = "mongo-cxx-driver";
rev = "refs/tags/r${finalAttrs.version}";
hash = "sha256-fBZg69jsvXzhllpcPBGXkjYyvUQImnGNkb2Ek5Oi0p4=";
};
postPatch = ''
substituteInPlace src/bsoncxx/config/CMakeLists.txt \
src/mongocxx/config/CMakeLists.txt \
--replace "\\\''${prefix}/" ""
'';
nativeBuildInputs = [
cmake
validatePkgConfig
];
buildInputs = [
mongoc
openssl
cyrus_sasl
];
cmakeFlags = [
"-DCMAKE_CXX_STANDARD=20"
"-DBUILD_VERSION=${finalAttrs.version}"
"-DENABLE_UNINSTALL=OFF"
];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "Official C++ client library for MongoDB";
homepage = "http://mongocxx.org";
license = licenses.asl20;
maintainers = with maintainers; [ adriandole ];
pkgConfigModules = [ "libmongocxx" "libbsoncxx" ];
platforms = platforms.all;
badPlatforms = [ "x86_64-darwin" ]; # needs sdk >= 10.14
};
})