mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-14 20:10:25 +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" ```
78 lines
1.5 KiB
Nix
78 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
pythonOlder,
|
|
|
|
# build-system
|
|
distutils,
|
|
setuptools,
|
|
|
|
# native dependencies
|
|
openldap,
|
|
cyrus_sasl,
|
|
|
|
# dependencies
|
|
pyasn1,
|
|
pyasn1-modules,
|
|
|
|
# tests
|
|
pytestCheckHook,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "python-ldap";
|
|
version = "3.4.4";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "python-ldap";
|
|
repo = "python-ldap";
|
|
rev = "refs/tags/python-ldap-${version}";
|
|
hash = "sha256-v1cWoRGxbvvFnHqnwoIfmiQQcxfaA8Bf3+M5bE5PtuU=";
|
|
};
|
|
|
|
build-system = [
|
|
distutils
|
|
setuptools
|
|
];
|
|
|
|
buildInputs = [
|
|
openldap
|
|
cyrus_sasl
|
|
];
|
|
|
|
dependencies = [
|
|
pyasn1
|
|
pyasn1-modules
|
|
];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
preCheck = ''
|
|
# Needed by tests to setup a mockup ldap server.
|
|
export BIN="${openldap}/bin"
|
|
export SBIN="${openldap}/bin"
|
|
export SLAPD="${openldap}/libexec/slapd"
|
|
export SCHEMA="${openldap}/etc/schema"
|
|
'';
|
|
|
|
disabledTests = [
|
|
# https://github.com/python-ldap/python-ldap/issues/501
|
|
"test_tls_ext_noca"
|
|
];
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
meta = with lib; {
|
|
changelog = "https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-${version}";
|
|
description = "Python modules for implementing LDAP clients";
|
|
downloadPage = "https://github.com/python-ldap/python-ldap";
|
|
homepage = "https://www.python-ldap.org/";
|
|
license = licenses.psfl;
|
|
};
|
|
}
|