summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-08-12 05:12:49 +0200
committerMichał Górny <mgorny@gentoo.org>2023-08-12 05:19:08 +0200
commit0f342742dd3dda55abd4e1d1e754b664f3ff8af2 (patch)
treef9b25415dc776199fdb21ddd5a9deb6f7f91a72a /dev-python/kerberos
parentdev-python/pytest-check: Bump to 2.2.1 (diff)
downloadgentoo-0f342742dd3dda55abd4e1d1e754b664f3ff8af2.tar.gz
gentoo-0f342742dd3dda55abd4e1d1e754b664f3ff8af2.tar.bz2
gentoo-0f342742dd3dda55abd4e1d1e754b664f3ff8af2.zip
Rename dev-python/{pykerberos → kerberos}
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/kerberos')
-rw-r--r--dev-python/kerberos/Manifest1
-rw-r--r--dev-python/kerberos/files/kerberos-1.3.1-python3.10.patch33
-rw-r--r--dev-python/kerberos/kerberos-1.3.1-r2.ebuild58
-rw-r--r--dev-python/kerberos/metadata.xml12
4 files changed, 104 insertions, 0 deletions
diff --git a/dev-python/kerberos/Manifest b/dev-python/kerberos/Manifest
new file mode 100644
index 000000000000..f513511d400a
--- /dev/null
+++ b/dev-python/kerberos/Manifest
@@ -0,0 +1 @@
+DIST ccs-pykerberos-PyKerberos-1.3.1.gh.tar.gz 41954 BLAKE2B b95a3473c5803ebcb461db7f2589caa03e92f4cb3ba3a4890a31db99b687aa4c77ae4e58f09ae2339a1fd8acf6fe9ab5797e3b7178dfeb2ee7a95bb851fff402 SHA512 dcadc5c3b095d8bba947a745ac84cc558d7eebad139a0e86260891966786506a7a62600fde93fa14683971e436da8cc5cd3795817b20ba45ce7e39f8c05deb53
diff --git a/dev-python/kerberos/files/kerberos-1.3.1-python3.10.patch b/dev-python/kerberos/files/kerberos-1.3.1-python3.10.patch
new file mode 100644
index 000000000000..7e760187de56
--- /dev/null
+++ b/dev-python/kerberos/files/kerberos-1.3.1-python3.10.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/867421
+https://github.com/apple/ccs-pykerberos/pull/89
+
+From 1e1666af51bb11ea5c6dd442415ce765073737c3 Mon Sep 17 00:00:00 2001
+From: stevenpackardblp <77253966+stevenpackardblp@users.noreply.github.com>
+Date: Sun, 24 Oct 2021 23:03:41 -0400
+Subject: [PATCH] Use Py_ssize_t type
+
+Python 3.10 requires that the `Py_ssize_t` type is used for string lengths instead of `int`.
+--- a/src/kerberos.c
++++ b/src/kerberos.c
+@@ -14,6 +14,7 @@
+ * limitations under the License.
+ **/
+
++#define PY_SSIZE_T_CLEAN
+ #include <Python.h>
+
+ #include "kerberosbasic.h"
+@@ -244,9 +245,9 @@ static PyObject *channelBindings(PyObject *self, PyObject *args, PyObject* keywd
+ char *initiator_address = NULL;
+ char *acceptor_address = NULL;
+ char *application_data = NULL;
+- int initiator_length = 0;
+- int acceptor_length = 0;
+- int application_length = 0;
++ Py_ssize_t initiator_length = 0;
++ Py_ssize_t acceptor_length = 0;
++ Py_ssize_t application_length = 0;
+
+ PyObject *pychan_bindings = NULL;
+ struct gss_channel_bindings_struct *input_chan_bindings;
+
diff --git a/dev-python/kerberos/kerberos-1.3.1-r2.ebuild b/dev-python/kerberos/kerberos-1.3.1-r2.ebuild
new file mode 100644
index 000000000000..052f9184ca4a
--- /dev/null
+++ b/dev-python/kerberos/kerberos-1.3.1-r2.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit distutils-r1
+
+MY_P=ccs-pykerberos-PyKerberos-${PV}
+DESCRIPTION="A high-level Python wrapper for Kerberos/GSSAPI operations"
+HOMEPAGE="
+ https://www.calendarserver.org/PyKerberos.html
+ https://github.com/apple/ccs-pykerberos/
+ https://pypi.org/project/kerberos/
+"
+SRC_URI="
+ https://github.com/apple/ccs-pykerberos/archive/PyKerberos-${PV}.tar.gz
+ -> ${MY_P}.gh.tar.gz
+"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 ~arm arm64 ~hppa ~ppc64 ~riscv x86"
+# test environment is non-trivial to set up, so just use docker
+# (see python_test below)
+# also for alpha/beta Python releases support:
+# https://github.com/apple/ccs-pykerberos/pull/83/commits/5f1130a1305b5f6e7d7d8b41067c4713f0c8950f
+RESTRICT="test"
+
+DEPEND="
+ app-crypt/mit-krb5
+"
+RDEPEND="
+ ${DEPEND}
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.1-python3.10.patch
+)
+
+python_test() {
+ set -- docker run \
+ -v "${PWD}:/app" \
+ -w /app \
+ -e PYENV=$("${EPYTHON}" -c 'import sys; print(sys.version.split()[0])') \
+ -e KERBEROS_USERNAME=administrator \
+ -e KERBEROS_PASSWORD=Password01 \
+ -e KERBEROS_REALM=example.com \
+ -e KERBEROS_PORT=80 \
+ ubuntu:16.04 \
+ /bin/bash .travis.sh
+ echo "${@}" >&2
+ "${@}" || die "Tests failed with ${EPYTHON}"
+}
diff --git a/dev-python/kerberos/metadata.xml b/dev-python/kerberos/metadata.xml
new file mode 100644
index 000000000000..2224354698e0
--- /dev/null
+++ b/dev-python/kerberos/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">kerberos</remote-id>
+ <remote-id type="github">apple/ccs-pykerberos</remote-id>
+ </upstream>
+</pkgmetadata>