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-02-29 20:09:43 +00:00
|
|
|
version = "1.26.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-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-uXHCd7KDnx3n6KO0opoITpf8LtUS67bc94tPHioeb4o=";
|
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
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
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; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The 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;
|
|
|
|
};
|
|
|
|
}
|