* [gentoo-commits] repo/gentoo:master commit in: dev-python/tlsh/files/, dev-python/tlsh/
@ 2022-06-07 19:58 Sam James
0 siblings, 0 replies; only message in thread
From: Sam James @ 2022-06-07 19:58 UTC (permalink / raw
To: gentoo-commits
commit: bc1f5c409d75ab773dfeee3f284384b82a95cb5d
Author: Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Sat Jun 4 20:37:54 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 7 19:58:40 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc1f5c40
dev-python/tlsh: initial import
The second package to add support for fuzzy matching in diffoscope.
Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/gentoo/pull/25771
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-python/tlsh/Manifest | 1 +
.../tlsh/files/tlsh-4.8.2-setup-sources.patch | 30 ++++++++++++++++++++
dev-python/tlsh/metadata.xml | 12 ++++++++
dev-python/tlsh/tlsh-4.8.2.ebuild | 33 ++++++++++++++++++++++
4 files changed, 76 insertions(+)
diff --git a/dev-python/tlsh/Manifest b/dev-python/tlsh/Manifest
new file mode 100644
index 000000000000..2425a1db29ee
--- /dev/null
+++ b/dev-python/tlsh/Manifest
@@ -0,0 +1 @@
+DIST tlsh-4.8.2.tar.gz 3345458 BLAKE2B 27d5eece16bb36225b9ae8b3d3a9d055a0f214fffae08a58c39211c3d918dd842497315a62237b291ee1055dfadad78826bbd24f7b9d88f510e9a31f74654039 SHA512 5355c7734f5356a3a7a31ccc078254835871fc0369f1889a34131a0f810735201c68f674eb18e975b6a03a32e5c284899ca9ffdc1f583e42192188c172d2aad0
diff --git a/dev-python/tlsh/files/tlsh-4.8.2-setup-sources.patch b/dev-python/tlsh/files/tlsh-4.8.2-setup-sources.patch
new file mode 100644
index 000000000000..4cdb0f864b5b
--- /dev/null
+++ b/dev-python/tlsh/files/tlsh-4.8.2-setup-sources.patch
@@ -0,0 +1,30 @@
+--- a/setup.py
++++ b/setup.py
+@@ -21,26 +21,7 @@ with open(join(realpath('..'), 'CMakeLists.txt'), 'r') as f:
+ if m:
+ tlsh_3b = ''
+
+-if os.name == 'nt':
+- tlsh_module = Extension('tlsh', \
+- sources = ['tlshmodule.cpp', \
+- join(realpath('..'), 'src', 'tlsh.cpp'), \
+- join(realpath('..'), 'src', 'tlsh_impl.cpp'), \
+- join(realpath('..'), 'src', 'tlsh_util.cpp') \
+- ], \
+- include_dirs = [join(realpath('..'), 'include'),
+- join(realpath('..'), 'Windows')],\
+- define_macros = [('WINDOWS', None),], \
+- )
+-else:
+- tlsh_module = Extension('tlsh', \
+- sources = ['tlshmodule.cpp', \
+- join(realpath('..'), 'src', 'tlsh.cpp'), \
+- join(realpath('..'), 'src', 'tlsh_impl.cpp'), \
+- join(realpath('..'), 'src', 'tlsh_util.cpp') \
+- ], \
+- include_dirs = [join(realpath('..'), 'include')],
+- )
++tlsh_module = Extension('tlsh', sources=['tlshmodule.cpp'], libraries=['tlsh'])
+
+ if tlsh_256 != '':
+ tlsh_module.extra_compile_args.append(tlsh_256)
diff --git a/dev-python/tlsh/metadata.xml b/dev-python/tlsh/metadata.xml
new file mode 100644
index 000000000000..89e6a410f9e7
--- /dev/null
+++ b/dev-python/tlsh/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="person" proxied="yes">
+ <email>t@laumann.xyz</email>
+ <name>Thomas Bracht Laumann Jespersen</name>
+ </maintainer>
+ <maintainer type="person" proxied="proxy">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-python/tlsh/tlsh-4.8.2.ebuild b/dev-python/tlsh/tlsh-4.8.2.ebuild
new file mode 100644
index 000000000000..d99d69d0b9c9
--- /dev/null
+++ b/dev-python/tlsh/tlsh-4.8.2.ebuild
@@ -0,0 +1,33 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} )
+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}.tar.gz"
+S=${WORKDIR}/${P}/py_ext
+
+LICENSE="|| ( Apache-2.0 BSD )"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="dev-libs/tlsh"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-setup-sources.patch
+)
+
+src_prepare() {
+ distutils-r1_src_prepare
+ sed -i -e 's:#include "tlsh.h":#include <tlsh/tlsh.h>:' tlshmodule.cpp || die
+}
+
+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:[~2022-06-07 19:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-07 19:58 [gentoo-commits] repo/gentoo:master commit in: dev-python/tlsh/files/, dev-python/tlsh/ Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox