mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-13 11:30:35 +08:00
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" ```
41 lines
1.0 KiB
Nix
41 lines
1.0 KiB
Nix
{
|
||
lib,
|
||
stdenv,
|
||
buildPythonPackage,
|
||
fetchPypi,
|
||
libmaxminddb,
|
||
pytestCheckHook,
|
||
pythonOlder,
|
||
}:
|
||
|
||
buildPythonPackage rec {
|
||
pname = "maxminddb";
|
||
version = "2.6.2";
|
||
format = "setuptools";
|
||
|
||
disabled = pythonOlder "3.7";
|
||
|
||
src = fetchPypi {
|
||
inherit pname version;
|
||
hash = "sha256-fYQtMuJiCryJS315paEAemnfLGzyeaBrlMnDkT9m8mQ=";
|
||
};
|
||
|
||
buildInputs = [ libmaxminddb ];
|
||
|
||
nativeCheckInputs = [ pytestCheckHook ];
|
||
|
||
pythonImportsCheck = [ "maxminddb" ];
|
||
|
||
# The multiprocessing tests fail on Darwin because multiprocessing uses spawn instead of fork,
|
||
# resulting in an exception when it can’t pickle the `lookup` local function.
|
||
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ "multiprocessing" ];
|
||
|
||
meta = with lib; {
|
||
description = "Reader for the MaxMind DB format";
|
||
homepage = "https://github.com/maxmind/MaxMind-DB-Reader-python";
|
||
changelog = "https://github.com/maxmind/MaxMind-DB-Reader-python/blob/v${version}/HISTORY.rst";
|
||
license = licenses.asl20;
|
||
maintainers = [ ];
|
||
};
|
||
}
|