2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, mongoc
|
2024-02-29 20:09:43 +00:00
|
|
|
, openssl
|
|
|
|
, cyrus_sasl
|
2023-08-04 22:07:22 +00:00
|
|
|
, cmake
|
|
|
|
, validatePkgConfig
|
|
|
|
, testers
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "mongocxx";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "3.8.1";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mongodb";
|
|
|
|
repo = "mongo-cxx-driver";
|
|
|
|
rev = "refs/tags/r${finalAttrs.version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-fBZg69jsvXzhllpcPBGXkjYyvUQImnGNkb2Ek5Oi0p4=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/bsoncxx/config/CMakeLists.txt \
|
|
|
|
src/mongocxx/config/CMakeLists.txt \
|
|
|
|
--replace "\\\''${prefix}/" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
validatePkgConfig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
mongoc
|
2024-02-29 20:09:43 +00:00
|
|
|
openssl
|
|
|
|
cyrus_sasl
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_CXX_STANDARD=20"
|
|
|
|
"-DBUILD_VERSION=${finalAttrs.version}"
|
|
|
|
"-DENABLE_UNINSTALL=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Official C++ client library for MongoDB";
|
2023-08-04 22:07:22 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
})
|