2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-02-29 20:09:43 +00:00
|
|
|
, python
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
# build system
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
|
|
|
|
|
|
|
# tests
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
# Switch version based on python version, as the situation isn't easy:
|
|
|
|
# https://github.com/wbond/asn1crypto/issues/269
|
|
|
|
# https://github.com/MatthiasValvekens/certomancer/issues/12
|
2024-04-21 15:54:59 +00:00
|
|
|
let
|
|
|
|
provenance = if lib.versionOlder python.version "3.12" then rec {
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.5.1";
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-M8vASxhaJPgkiTrAckxz7gk/QHkrFlNz7fFbnLEBT+M=";
|
|
|
|
} else {
|
|
|
|
version = "1.5.1-unstable-2023-11-03";
|
|
|
|
rev = "b763a757bb2bef2ab63620611ddd8006d5e9e4a2";
|
|
|
|
hash = "sha256-11WajEDtisiJsKQjZMSd5sDog3DuuBzf1PcgSY+uuXY=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
in
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "asn1crypto";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit (provenance) version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# Pulling from Github to run tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wbond";
|
|
|
|
repo = "asn1crypto";
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit (provenance) rev hash;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
homepage = "https://github.com/wbond/asn1crypto";
|
2024-02-29 20:09:43 +00:00
|
|
|
maintainers = with lib.maintainers; [ dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|