mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
63 lines
1.1 KiB
Nix
63 lines
1.1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, pkg-config
|
|
, openssl
|
|
, zlib
|
|
, zstd
|
|
, icu
|
|
, cyrus_sasl
|
|
, snappy
|
|
, darwin
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mongoc";
|
|
version = "1.28.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mongodb";
|
|
repo = "mongo-c-driver";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-cfet+A2i33iHbVRouPS4Ul8TmHolrcIMTRba6Olqfeg=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
openssl
|
|
zlib
|
|
zstd
|
|
icu
|
|
cyrus_sasl
|
|
snappy
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk_11_0.frameworks.Security
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DBUILD_VERSION=${version}"
|
|
"-DENABLE_UNINSTALL=OFF"
|
|
"-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF"
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
];
|
|
|
|
# remove forbidden reference to $TMPDIR
|
|
preFixup = ''
|
|
rm -rf src/{libmongoc,libbson}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Official C client library for MongoDB";
|
|
homepage = "http://mongoc.org";
|
|
license = licenses.asl20;
|
|
mainProgram = "mongoc-stat";
|
|
maintainers = with maintainers; [ archer-65 ];
|
|
platforms = platforms.all;
|
|
};
|
|
}
|