Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 mongoc, 6 openssl, 7 cyrus_sasl, 8 cmake, 9 validatePkgConfig, 10 testers, 11}: 12 13stdenv.mkDerivation (finalAttrs: { 14 pname = "mongocxx"; 15 version = "4.0.0"; 16 17 src = fetchFromGitHub { 18 owner = "mongodb"; 19 repo = "mongo-cxx-driver"; 20 tag = "r${finalAttrs.version}"; 21 hash = "sha256-fAOOQyXJ6H4Rt8gRGJnvb5I7E505MOAjNDcFqXUdY+U="; 22 }; 23 24 postPatch = '' 25 substituteInPlace src/bsoncxx/cmake/libbsoncxx.pc.in \ 26 src/mongocxx/cmake/libmongocxx.pc.in \ 27 --replace "\''${prefix}/" "" 28 ''; 29 30 nativeBuildInputs = [ 31 cmake 32 validatePkgConfig 33 ]; 34 35 buildInputs = [ 36 mongoc 37 openssl 38 cyrus_sasl 39 ]; 40 41 cmakeFlags = [ 42 "-DCMAKE_CXX_STANDARD=20" 43 "-DBUILD_VERSION=${finalAttrs.version}" 44 "-DENABLE_UNINSTALL=OFF" 45 ]; 46 47 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 48 49 meta = with lib; { 50 description = "Official C++ client library for MongoDB"; 51 homepage = "http://mongocxx.org"; 52 license = licenses.asl20; 53 maintainers = with maintainers; [ 54 adriandole 55 vcele 56 ]; 57 pkgConfigModules = [ 58 "libmongocxx" 59 "libbsoncxx" 60 ]; 61 platforms = platforms.all; 62 badPlatforms = [ "x86_64-darwin" ]; # needs sdk >= 10.14 63 }; 64})