2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, zlib
|
|
|
|
, zstd
|
|
|
|
, icu
|
|
|
|
, cyrus_sasl
|
|
|
|
, snappy
|
|
|
|
, darwin
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mongoc";
|
2024-09-26 11:04:55 +00:00
|
|
|
version = "1.28.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mongodb";
|
|
|
|
repo = "mongo-c-driver";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-09-26 11:04:55 +00:00
|
|
|
hash = "sha256-cfet+A2i33iHbVRouPS4Ul8TmHolrcIMTRba6Olqfeg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
zlib
|
|
|
|
zstd
|
|
|
|
icu
|
|
|
|
cyrus_sasl
|
|
|
|
snappy
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-07-15 17:15:38 +00:00
|
|
|
darwin.apple_sdk_11_0.frameworks.Security
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_VERSION=${version}"
|
|
|
|
"-DENABLE_UNINSTALL=OFF"
|
|
|
|
"-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF"
|
2024-02-29 20:09:43 +00:00
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# remove forbidden reference to $TMPDIR
|
|
|
|
preFixup = ''
|
|
|
|
rm -rf src/{libmongoc,libbson}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Official C client library for MongoDB";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "http://mongoc.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "mongoc-stat";
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ archer-65 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|