johnnycanencrypt: init at 0.5.0

This commit is contained in:
0x4A6F 2021-01-05 18:07:10 +00:00
parent e6f00abb56
commit e149a5c90c
No known key found for this signature in database
GPG Key ID: 8DEDBA5BE07080E1
3 changed files with 1290 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
{ stdenv
, rustPlatform
, fetchFromGitHub
, pipInstallHook
, llvmPackages
, pkg-config
, maturin
, pcsclite
, nettle
, python
, requests
, vcrpy
, numpy
, pytestCheckHook
, pythonOlder
, PCSC
}:
rustPlatform.buildRustPackage rec {
pname = "johnnycanencrypt";
version = "0.5.0";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "kushaldas";
repo = "johnnycanencrypt";
rev = "v${version}";
sha256 = "192wfrlyylrpzq70yki421mi1smk8q2cyki2a1d03q7h6apib3j4";
};
cargoPatches = [ ./Cargo.lock.patch ];
cargoSha256 = "0ifvpdizcdp2c5x2x2j1bhhy5a75q0pk7a63dmh52mlpmh45fy6r";
LIBCLANG_PATH = llvmPackages.libclang + "/lib";
propagatedBuildInputs = [
requests
vcrpy
];
nativeBuildInputs = [
llvmPackages.clang
pkg-config
python
maturin
pipInstallHook
];
buildInputs = [
pcsclite
nettle
] ++ stdenv.lib.optionals stdenv.isDarwin [ PCSC ];
# Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage)
doCheck = false;
doInstallCheck = true;
installCheckInputs = [
pytestCheckHook
numpy
];
buildPhase = ''
runHook preBuild
maturin build --release --manylinux off --strip --cargo-extra-args="-j $NIX_BUILD_CORES --frozen"
runHook postBuild
'';
installPhase = ''
install -Dm644 -t dist target/wheels/*.whl
pipInstallPhase
'';
preCheck = ''
export TESTDIR=$(mktemp -d)
cp -r tests/ $TESTDIR
pushd $TESTDIR
'';
postCheck = ''
popd
'';
pythonImportsCheck = [ "johnnycanencrypt" ];
meta = with stdenv.lib; {
homepage = "https://github.com/kushaldas/johnnycanencrypt";
description = "Python module for OpenPGP written in Rust";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ _0x4A6F ];
};
}

View File

@ -3180,6 +3180,10 @@ in {
joblib = callPackage ../development/python-modules/joblib { };
johnnycanencrypt = callPackage ../development/python-modules/johnnycanencrypt {
inherit (pkgs.darwin.apple_sdk.frameworks) PCSC;
};
josepy = callPackage ../development/python-modules/josepy { };
journalwatch = callPackage ../tools/system/journalwatch { inherit (self) systemd pytest; };