2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-01-20 10:41:00 +00:00
|
|
|
, fetchPypi
|
2021-03-09 03:18:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, rustPlatform
|
2021-01-15 22:18:51 +00:00
|
|
|
, llvmPackages
|
|
|
|
, pkg-config
|
|
|
|
, pcsclite
|
|
|
|
, nettle
|
2022-11-21 17:40:18 +00:00
|
|
|
, httpx
|
2021-01-15 22:18:51 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-01-20 10:41:00 +00:00
|
|
|
, vcrpy
|
2021-01-15 22:18:51 +00:00
|
|
|
, PCSC
|
2021-12-06 16:07:01 +00:00
|
|
|
, libiconv
|
2021-01-15 22:18:51 +00:00
|
|
|
}:
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
buildPythonPackage rec {
|
2021-01-15 22:18:51 +00:00
|
|
|
pname = "johnnycanencrypt";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.12.0";
|
|
|
|
disabled = pythonOlder "3.8";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-aGhM/uyYE7l0h6L00qp+HRUVaj7s/tnHWIHJpLAkmR4=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
2023-01-20 10:41:00 +00:00
|
|
|
inherit src;
|
2021-03-09 03:18:52 +00:00
|
|
|
name = "${pname}-${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-fcwDxkUFtA6LS77xdLktNnZJXmyl/ZzArvIW69SPpmI=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-11-21 17:40:18 +00:00
|
|
|
httpx
|
2021-01-15 22:18:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
llvmPackages.clang
|
|
|
|
pkg-config
|
2021-03-09 03:18:52 +00:00
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
]);
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
nettle
|
2022-11-21 17:40:18 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
pcsclite
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
PCSC
|
|
|
|
libiconv
|
|
|
|
];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-01-15 22:18:51 +00:00
|
|
|
pytestCheckHook
|
2023-01-20 10:41:00 +00:00
|
|
|
vcrpy
|
2021-01-15 22:18:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
2023-01-20 10:41:00 +00:00
|
|
|
# import from $out
|
|
|
|
rm -r johnnycanencrypt
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "johnnycanencrypt" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-15 22:18:51 +00:00
|
|
|
homepage = "https://github.com/kushaldas/johnnycanencrypt";
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/kushaldas/johnnycanencrypt/blob/v${version}/changelog.md";
|
2021-01-15 22:18:51 +00:00
|
|
|
description = "Python module for OpenPGP written in Rust";
|
2023-01-20 10:41:00 +00:00
|
|
|
license = licenses.lgpl3Plus;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with maintainers; [ _0x4A6F ];
|
|
|
|
};
|
|
|
|
}
|