commit:     cf2f416d930f83e727d926216c276cf05a16cac7
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Fri Jan 30 13:52:31 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 11 04:29:27 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf2f416d

dev-python/python-tlsh: add 4.12.1

Main difference is that we can drop a patch for py3.12 (and newer, I
suppose) as upstream included the patch in this release.

Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/34
Merges: https://codeberg.org/gentoo/gentoo/pulls/34
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/python-tlsh/Manifest                    |  1 +
 .../files/python-tlsh-4.12.1-tlshmodule.patch      | 11 +++++++
 dev-python/python-tlsh/python-tlsh-4.12.1.ebuild   | 38 ++++++++++++++++++++++
 3 files changed, 50 insertions(+)

diff --git a/dev-python/python-tlsh/Manifest b/dev-python/python-tlsh/Manifest
index 6fc86ca17aeb..0c9b0e709bce 100644
--- a/dev-python/python-tlsh/Manifest
+++ b/dev-python/python-tlsh/Manifest
@@ -1 +1,2 @@
+DIST tlsh-4.12.1.gh.tar.gz 10243609 BLAKE2B 
96095f897ff68e4e6c738b7df2d11963003b360db2354674803aa68e5b76f25b28cdf3ef9d376f046ab0a2b7663d1e4efe77f1ed6594c3e7692aef614b25c987
 SHA512 
82d6971baacdede7b4e4fd282d861d264e4ae196d1b5f3ea26648e93c0f0884b90bf9cab4dd1cc0f36fd00fb2e2ca3db8128769725a8858c5fcf48c192f33c45
 DIST tlsh-4.8.2.gh.tar.gz 3345458 BLAKE2B 
27d5eece16bb36225b9ae8b3d3a9d055a0f214fffae08a58c39211c3d918dd842497315a62237b291ee1055dfadad78826bbd24f7b9d88f510e9a31f74654039
 SHA512 
5355c7734f5356a3a7a31ccc078254835871fc0369f1889a34131a0f810735201c68f674eb18e975b6a03a32e5c284899ca9ffdc1f583e42192188c172d2aad0

diff --git a/dev-python/python-tlsh/files/python-tlsh-4.12.1-tlshmodule.patch 
b/dev-python/python-tlsh/files/python-tlsh-4.12.1-tlshmodule.patch
new file mode 100644
index 000000000000..3c134e0b5b7c
--- /dev/null
+++ b/dev-python/python-tlsh/files/python-tlsh-4.12.1-tlshmodule.patch
@@ -0,0 +1,11 @@
+--- 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

diff --git a/dev-python/python-tlsh/python-tlsh-4.12.1.ebuild 
b/dev-python/python-tlsh/python-tlsh-4.12.1.ebuild
new file mode 100644
index 000000000000..5e99dfe3197a
--- /dev/null
+++ b/dev-python/python-tlsh/python-tlsh-4.12.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2022-2026 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_{11..14} )
+
+inherit distutils-r1
+
+MY_P=tlsh-${PV}
+DESCRIPTION="Fuzzy matching library - C++ extension for Python"
+HOMEPAGE="
+       https://github.com/trendmicro/tlsh/
+       https://pypi.org/project/python-tlsh/
+"
+SRC_URI="
+       https://github.com/trendmicro/tlsh/archive/${PV}.tar.gz
+               -> ${MY_P}.gh.tar.gz
+"
+S=${WORKDIR}/${MY_P}/py_ext
+
+LICENSE="|| ( Apache-2.0 BSD )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+DEPEND="dev-libs/tlsh"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.8.2-setup-sources.patch
+       "${FILESDIR}"/${P}-tlshmodule.patch
+)
+
+python_test() {
+       ../Testing/python_test.sh "${EPYTHON}" || die
+}

Reply via email to