* [gentoo-commits] repo/gentoo:master commit in: dev-python/tlsh/, dev-python/tlsh/files/
@ 2024-06-02 0:41 Sam James
0 siblings, 0 replies; only message in thread
From: Sam James @ 2024-06-02 0:41 UTC (permalink / raw
To: gentoo-commits
commit: 0831a84172d0ee0499070a8c1212ef9780197b1f
Author: Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Fri Apr 19 10:18:15 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 2 00:38:30 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0831a841
dev-python/tlsh: fix build for python 3.12 + musl
Closes: https://bugs.gentoo.org/927058
Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/gentoo/pull/36321
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-python/tlsh/Manifest | 1 +
dev-python/tlsh/files/tlsh-4.8.2-r1-py312.patch | 25 +++++++++++++++++++++
dev-python/tlsh/tlsh-4.8.2-r1.ebuild | 30 +++++++++++++++++++++++++
3 files changed, 56 insertions(+)
diff --git a/dev-python/tlsh/Manifest b/dev-python/tlsh/Manifest
index 2425a1db29ee..7f54384d66a4 100644
--- a/dev-python/tlsh/Manifest
+++ b/dev-python/tlsh/Manifest
@@ -1 +1,2 @@
+DIST tlsh-4.8.2.gh.tar.gz 3345458 BLAKE2B 27d5eece16bb36225b9ae8b3d3a9d055a0f214fffae08a58c39211c3d918dd842497315a62237b291ee1055dfadad78826bbd24f7b9d88f510e9a31f74654039 SHA512 5355c7734f5356a3a7a31ccc078254835871fc0369f1889a34131a0f810735201c68f674eb18e975b6a03a32e5c284899ca9ffdc1f583e42192188c172d2aad0
DIST tlsh-4.8.2.tar.gz 3345458 BLAKE2B 27d5eece16bb36225b9ae8b3d3a9d055a0f214fffae08a58c39211c3d918dd842497315a62237b291ee1055dfadad78826bbd24f7b9d88f510e9a31f74654039 SHA512 5355c7734f5356a3a7a31ccc078254835871fc0369f1889a34131a0f810735201c68f674eb18e975b6a03a32e5c284899ca9ffdc1f583e42192188c172d2aad0
diff --git a/dev-python/tlsh/files/tlsh-4.8.2-r1-py312.patch b/dev-python/tlsh/files/tlsh-4.8.2-r1-py312.patch
new file mode 100644
index 000000000000..56c4766bd711
--- /dev/null
+++ b/dev-python/tlsh/files/tlsh-4.8.2-r1-py312.patch
@@ -0,0 +1,25 @@
+Use PyVarObject_HEAD_INIT instead PyObject_HEAD_INIT
+
+--- a/tlshmodule.cpp
++++ b/tlshmodule.cpp
+@@ -59,7 +59,7 @@
+ #include <Python.h>
+ #include <new>
+ #include <bytesobject.h>
+-#include "tlsh.h"
++#include <tlsh/tlsh.h>
+
+ // to generate the "T1" hashes introduced in TLSH 4.0.0
+ // see 4.0.0 from 26/Mar/2020 at https://github.com/trendmicro/tlsh/blob/master/Change_History.md
+@@ -286,10 +286,7 @@ static PyGetSetDef Tlsh_getsetters[] = {
+ };
+
+ static PyTypeObject tlsh_TlshType = {
+- PyObject_HEAD_INIT(NULL)
+-#if PY_MAJOR_VERSION < 3
+- 0, /* ob_size */
+-#endif
++ PyVarObject_HEAD_INIT(NULL, 0)
+ "tlsh.Tlsh", /* tp_name */
+ sizeof(tlsh_TlshObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
diff --git a/dev-python/tlsh/tlsh-4.8.2-r1.ebuild b/dev-python/tlsh/tlsh-4.8.2-r1.ebuild
new file mode 100644
index 000000000000..94ebb2d03eab
--- /dev/null
+++ b/dev-python/tlsh/tlsh-4.8.2-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_EXT=1
+inherit distutils-r1
+
+DESCRIPTION="Fuzzy matching library - C++ extension for Python"
+HOMEPAGE="https://pypi.org/project/python-tlsh/"
+SRC_URI="https://github.com/trendmicro/${PN}/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
+S=${WORKDIR}/${P}/py_ext
+
+LICENSE="|| ( Apache-2.0 BSD )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc64 ~x86"
+
+DEPEND="dev-libs/tlsh"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-setup-sources.patch
+ "${FILESDIR}"/${P}-r1-py312.patch
+)
+
+python_test() {
+ "${EPYTHON}" test.py test.py test.py &> /dev/null || die
+}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-06-02 0:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-02 0:41 [gentoo-commits] repo/gentoo:master commit in: dev-python/tlsh/, dev-python/tlsh/files/ Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox