commit:     5b99b9a480ac665132cc8de8a9bf5e7310213f51
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sat Jul  3 03:39:50 2021 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Sat Jul  3 03:39:50 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5b99b9a4

dev-python/uharfbuzz: initial import

Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 dev-python/uharfbuzz/Manifest                      |  1 +
 .../files/uharfbuzz-0.16.1-system-harfbuzz.patch   | 23 +++++++++++++
 dev-python/uharfbuzz/metadata.xml                  | 14 ++++++++
 dev-python/uharfbuzz/uharfbuzz-0.16.1.ebuild       | 38 ++++++++++++++++++++++
 4 files changed, 76 insertions(+)

diff --git a/dev-python/uharfbuzz/Manifest b/dev-python/uharfbuzz/Manifest
new file mode 100644
index 000000000..3c49d7b52
--- /dev/null
+++ b/dev-python/uharfbuzz/Manifest
@@ -0,0 +1 @@
+DIST uharfbuzz-0.16.1.tar.gz 33252 BLAKE2B 
63c036b0884303d724cfc64acb0f44b2705c3ddb35e8132c399535ae0db54744ee8f244aac9e68e73b39969328cbee63d094f4e97908f5e5a007d995176c53cb
 SHA512 
d1c08135a4cc470278726aa6c8c6da7ccac04ab6d0c718c7576c81233834d182c7428c1123abc4f05f094fac2fe4dbb1dd8d264e752cadb3030f7045721ae1ee

diff --git a/dev-python/uharfbuzz/files/uharfbuzz-0.16.1-system-harfbuzz.patch 
b/dev-python/uharfbuzz/files/uharfbuzz-0.16.1-system-harfbuzz.patch
new file mode 100644
index 000000000..66b11c996
--- /dev/null
+++ b/dev-python/uharfbuzz/files/uharfbuzz-0.16.1-system-harfbuzz.patch
@@ -0,0 +1,23 @@
+--- a/setup.py
++++ b/setup.py
+@@ -13,7 +13,7 @@
+ with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
+     long_description = f.read()
+ 
+-define_macros = [('HB_NO_MT', '1'), ('HB_EXPERIMENTAL_API', '1')]
++define_macros = []
+ linetrace = False
+ if int(os.environ.get('CYTHON_LINETRACE', '0')):
+     linetrace = True
+@@ -30,8 +30,9 @@
+ extension = Extension(
+     'uharfbuzz._harfbuzz',
+     define_macros=define_macros,
+-    include_dirs=['harfbuzz/src'],
+-    sources=['src/uharfbuzz/_harfbuzz.pyx', 'harfbuzz/src/harfbuzz.cc'],
++    include_dirs=['/usr/include/harfbuzz'],
++    libraries=['harfbuzz'],
++    sources=['src/uharfbuzz/_harfbuzz.pyx'],
+     language='c++',
+     extra_compile_args=extra_compile_args,
+     extra_link_args=extra_link_args,

diff --git a/dev-python/uharfbuzz/metadata.xml 
b/dev-python/uharfbuzz/metadata.xml
new file mode 100644
index 000000000..d27e3cb7d
--- /dev/null
+++ b/dev-python/uharfbuzz/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+    <maintainer type="person">
+      <description>co-maintainers welcome</description>
+      <email>[email protected]</email>
+      <name>Alessandro Barbieri</name>
+    </maintainer>
+    <upstream>
+        <bugs-to>https://github.com/harfbuzz/uharfbuzz/issues</bugs-to>
+        <remote-id type="github">harfbuzz/uharfbuzz</remote-id>
+        <remote-id type="pypi">uharfbuzz</remote-id>
+    </upstream>
+</pkgmetadata>

diff --git a/dev-python/uharfbuzz/uharfbuzz-0.16.1.ebuild 
b/dev-python/uharfbuzz/uharfbuzz-0.16.1.ebuild
new file mode 100644
index 000000000..96fa0ed49
--- /dev/null
+++ b/dev-python/uharfbuzz/uharfbuzz-0.16.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_SETUPTOOLS="pyproject.toml"
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+
+inherit distutils-r1
+
+SRC_URI="https://github.com/harfbuzz/uharfbuzz/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
+KEYWORDS=""
+DESCRIPTION="Streamlined Cython bindings for the HarfBuzz shaping engine"
+HOMEPAGE="https://github.com/harfbuzz/uharfbuzz";
+LICENSE="Apache-2.0"
+SLOT="0"
+
+RDEPEND=">=media-libs/harfbuzz-2.8.1[experimental]"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       dev-python/setuptools_scm[${PYTHON_USEDEP}]
+       dev-python/cython[${PYTHON_USEDEP}]
+"
+
+PATCHES=( "${FILESDIR}/${P}-system-harfbuzz.patch" )
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+       distutils-r1_python_prepare_all
+       export SETUPTOOLS_SCM_PRETEND_VERSION="${PV%_*}"
+       export USE_SYSTEM_HARFBUZZ=1
+}
+
+python_install() {
+       distutils-r1_python_install
+       python_optimize "$(python_get_sitedir)/${PN}"
+}

Reply via email to