Something went wrong. Try again.
lol
Something went wrong. Try again.
1.9 kB · 72 lines
Nix
at master
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273{ lib, stdenv, buildPythonPackage, fetchFromGitLab, openssl, pytestCheckHook, setuptools, swig,}:
buildPythonPackage (finalAttrs: { pname = "m2crypto"; version = "0.48.0"; pyproject = true;
src = fetchFromGitLab { owner = "m2crypto"; repo = "m2crypto"; tag = finalAttrs.version; hash = "sha256-Ya1og1x3EPbHkrY74tkdkMOJreS3x8x/1oVfwcpAEOU="; };
# https://lists.sr.ht/~mcepl/m2crypto/%3CCAPhw1+Hg6+OJZoqt1O6aezxnTUFmfFTMzDwkD2bJ74jnmygqrg@mail.gmail.com%3E postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace src/SWIG/_lib.h \ --replace-fail "|| defined(__clang__)" "&& !defined(__clang__)" substituteInPlace src/SWIG/_m2crypto.i \ --replace-fail "PRAGMA_IGNORE_UNUSED_LABEL" "" \ --replace-fail "PRAGMA_WARN_STRICT_PROTOTYPES" "" '';
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" ]); OPENSSL_PATH = lib.optionalString stdenv.hostPlatform.isDarwin "${openssl.dev}"; } // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { CPP = "${stdenv.cc.targetPrefix}cpp"; };
nativeCheckInputs = [ pytestCheckHook openssl ];
disabledTests = [ # Connection refused "test_makefile_err" ];
# Tests require localhost access __darwinAllowLocalNetworking = true;
pythonImportsCheck = [ "M2Crypto" ];
meta = { description = "Python crypto and SSL toolkit"; homepage = "https://gitlab.com/m2crypto/m2crypto"; changelog = "https://gitlab.com/m2crypto/m2crypto/-/tags/${finalAttrs.version}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ sarahec ]; };})