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" ```
58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
openssl,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
setuptools,
|
|
swig,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "m2crypto";
|
|
version = "0.41.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchPypi {
|
|
pname = "M2Crypto";
|
|
inherit version;
|
|
hash = "sha256-OhNYx+6EkEbZF4Knd/F4a/AnocHVG1+vjxlDW/w/FJU=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
nativeBuildInputs = [ swig ];
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
env =
|
|
{
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
|
|
"-Wno-error=implicit-function-declaration"
|
|
"-Wno-error=incompatible-pointer-types"
|
|
]);
|
|
}
|
|
// lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
|
|
CPP = "${stdenv.cc.targetPrefix}cpp";
|
|
};
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
openssl
|
|
];
|
|
|
|
pythonImportsCheck = [ "M2Crypto" ];
|
|
|
|
meta = with lib; {
|
|
description = "Python crypto and SSL toolkit";
|
|
homepage = "https://gitlab.com/m2crypto/m2crypto";
|
|
changelog = "https://gitlab.com/m2crypto/m2crypto/-/blob/${version}/CHANGES";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
};
|
|
}
|