public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anna Vyalkova" <cyber+gentoo@sysrq.in>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/python-pkcs11/
Date: Sun,  5 Mar 2023 09:30:38 +0000 (UTC)	[thread overview]
Message-ID: <1678008609.d5e640996541b525416a1e2436a2241db7f21e90.cybertailor@gentoo> (raw)

commit:     d5e640996541b525416a1e2436a2241db7f21e90
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Sun Mar  5 08:26:02 2023 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Sun Mar  5 09:30:09 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d5e64099

dev-python/python-pkcs11: enable py3.11

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 .../python-pkcs11/python-pkcs11-0.7.0-r1.ebuild    | 40 -------------
 .../python-pkcs11/python-pkcs11-0.7.0-r2.ebuild    | 65 ++++++++++++++++++++++
 2 files changed, 65 insertions(+), 40 deletions(-)

diff --git a/dev-python/python-pkcs11/python-pkcs11-0.7.0-r1.ebuild b/dev-python/python-pkcs11/python-pkcs11-0.7.0-r1.ebuild
deleted file mode 100644
index 3a4e4a120..000000000
--- a/dev-python/python-pkcs11/python-pkcs11-0.7.0-r1.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DOCS_BUILDER="sphinx"
-DOCS_DIR="${S}/docs"
-DOCS_DEPEND="dev-python/sphinx-rtd-theme"
-PYTHON_COMPAT=( python3_{8..10} )
-
-inherit distutils-r1 docs
-
-DESCRIPTION="PKCS#11 (Cryptoki) support for Python"
-HOMEPAGE="
-	https://github.com/danni/python-pkcs11
-	https://pypi.org/project/python-pkcs11/
-"
-SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-#hardware device needed for tests
-RESTRICT="test"
-
-RDEPEND="
-	>=dev-python/asn1crypto-1.0.0[${PYTHON_USEDEP}]
-	dev-python/cached-property[${PYTHON_USEDEP}]
-"
-DEPEND="
-	${RDEPEND}
-	dev-python/cython[${PYTHON_USEDEP}]
-	test? (
-		dev-python/cryptography[${PYTHON_USEDEP}]
-		dev-python/oscrypto[${PYTHON_USEDEP}]
-		dev-python/parameterized[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_tests pytest

diff --git a/dev-python/python-pkcs11/python-pkcs11-0.7.0-r2.ebuild b/dev-python/python-pkcs11/python-pkcs11-0.7.0-r2.ebuild
new file mode 100644
index 000000000..2dc8abe7f
--- /dev/null
+++ b/dev-python/python-pkcs11/python-pkcs11-0.7.0-r2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+DISTUTILS_USE_PEP517=setuptools
+PYPI_NO_NORMALIZE=1
+inherit edo distutils-r1 pypi
+
+DESCRIPTION="PKCS#11 (Cryptoki) support for Python"
+HOMEPAGE="
+	https://pypi.org/project/python-pkcs11/
+	https://github.com/danni/python-pkcs11
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+	>=dev-python/asn1crypto-1.0.0[${PYTHON_USEDEP}]
+	dev-python/cached-property[${PYTHON_USEDEP}]
+"
+BDEPEND="
+	dev-python/cython[${PYTHON_USEDEP}]
+	dev-python/setuptools-scm[${PYTHON_USEDEP}]
+	test? (
+		dev-libs/openssl
+		dev-libs/softhsm
+		dev-python/cryptography[${PYTHON_USEDEP}]
+		dev-python/oscrypto[${PYTHON_USEDEP}]
+		dev-python/parameterized[${PYTHON_USEDEP}]
+	)
+"
+
+distutils_enable_tests pytest
+
+distutils_enable_sphinx docs
+
+python_test() {
+	cd "${S}" || die
+	epytest
+}
+
+src_test() {
+	local -x PKCS11_MODULE="${BROOT}/usr/$(get_libdir)/softhsm/libsofthsm2.so"
+	local -x PKCS11_TOKEN_LABEL="TEST"
+	local -x PKCS11_TOKEN_PIN="1234"
+	local -x PKCS11_TOKEN_SO_PIN="5678"
+
+	mkdir -p "${HOME}/.config/softhsm2" || die
+	cat > "${HOME}/.config/softhsm2/softhsm2.conf" <<- EOF || die "Failed to create config"
+		directories.tokendir = ${T}
+		objectstore.backend = file
+	EOF
+
+	edo softhsm2-util --init-token --free \
+		--label ${PKCS11_TOKEN_LABEL} \
+		--pin ${PKCS11_TOKEN_PIN} \
+		--so-pin ${PKCS11_TOKEN_SO_PIN}
+
+	rm -r pkcs11 || die
+	distutils-r1_src_test
+}


             reply	other threads:[~2023-03-05  9:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05  9:30 Anna Vyalkova [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-29 21:04 [gentoo-commits] repo/proj/guru:dev commit in: dev-python/python-pkcs11/ Alessandro Barbieri
2020-12-18 16:26 [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
2020-12-18 15:25 ` [gentoo-commits] repo/proj/guru:dev " Andrew Ammerlaan
2020-12-02  1:44 Alessandro Barbieri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1678008609.d5e640996541b525416a1e2436a2241db7f21e90.cybertailor@gentoo \
    --to=cyber+gentoo@sysrq.in \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox