diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/mongoc')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/mongoc/default.nix | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/mongoc/default.nix b/nixpkgs/pkgs/development/libraries/mongoc/default.nix new file mode 100644 index 000000000000..0e8e5cb8771f --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/mongoc/default.nix @@ -0,0 +1,66 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, openssl +, zlib +, zstd +, icu +, cyrus_sasl +, snappy +, darwin +}: + +stdenv.mkDerivation rec { + pname = "mongoc"; + version = "1.24.2"; + + src = fetchFromGitHub { + owner = "mongodb"; + repo = "mongo-c-driver"; + rev = "refs/tags/${version}"; + hash = "sha256-gey+/DAfAK69f5q568giLNL4R1UqGD6eiImkjyvnZys="; + }; + + postPatch = '' + substituteInPlace src/libbson/CMakeLists.txt src/libmongoc/CMakeLists.txt \ + --replace "\\\''${prefix}/" "" + ''; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + openssl + zlib + zstd + icu + cyrus_sasl + snappy + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk_11_0.frameworks.Security + ]; + + cmakeFlags = [ + "-DBUILD_VERSION=${version}" + "-DENABLE_UNINSTALL=OFF" + "-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF" + ]; + + # remove forbidden reference to $TMPDIR + preFixup = '' + rm -rf src/{libmongoc,libbson} + ''; + + meta = with lib; { + description = "The official C client library for MongoDB"; + homepage = "http://mongoc.org"; + license = licenses.asl20; + mainProgram = "mongoc-stat"; + maintainers = with maintainers; [ archer-65 ]; + platforms = platforms.all; + }; +} |