1 |
commit: c949e2c93b6a3ab9394aa6cbb4c26cdbc684b646 |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Jun 18 01:19:07 2021 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Fri Jun 18 02:16:54 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c949e2c9 |
7 |
|
8 |
dev-util/psautohint: initial import |
9 |
|
10 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
11 |
|
12 |
dev-util/psautohint/Manifest | 2 + |
13 |
.../files/psautohint-2.3.0-no-build-library.patch | 39 +++++++++++ |
14 |
.../files/psautohint-2.3.0-no-werror.patch | 11 ++++ |
15 |
.../psautohint/files/psautohint-bininpath.diff | 10 +++ |
16 |
dev-util/psautohint/metadata.xml | 5 ++ |
17 |
dev-util/psautohint/psautohint-2.3.0.ebuild | 77 ++++++++++++++++++++++ |
18 |
6 files changed, 144 insertions(+) |
19 |
|
20 |
diff --git a/dev-util/psautohint/Manifest b/dev-util/psautohint/Manifest |
21 |
new file mode 100644 |
22 |
index 000000000..a96fc7348 |
23 |
--- /dev/null |
24 |
+++ b/dev-util/psautohint/Manifest |
25 |
@@ -0,0 +1,2 @@ |
26 |
+DIST psautohint-2.3.0.tar.gz 181570 BLAKE2B 20127221ccbe890b363aba944ca19f6b126ba7c61f0b5e668288a12f93aebfe3541257e576f2ffce9bd935886f5cb9b4eb5c0dc08c0a8b1953484660fef8868a SHA512 943ac93ea4b0c188135cf2146803c36a3e5aa5b2e14924252281f22f6fc4190b935bdd72785107bbaf36d7503f48fc952fb32cd6965791c4ebebc699c0d7c5f5 |
27 |
+DIST psautohint-testdata-1e4c5061d328105c4dcfcb6fdbc27ec49b3e9d23.tar.gz 21949984 BLAKE2B a5da67eb4b9f3d0ce5d86469bc0a5f771fa743198836db35121e9c62b66c8b8df00fef6e40e8832e33aee065fe3bdd0a24d1b590bce6fb66d7c43f6719236242 SHA512 03d4962958d3551ffdf99463d28723f6b43d42029843da1b40493b0bfc2e586ebf40db3a2497b36b5fde345de4b6998cfc1131c6fb4e8352b05fb59fc4e90e7f |
28 |
|
29 |
diff --git a/dev-util/psautohint/files/psautohint-2.3.0-no-build-library.patch b/dev-util/psautohint/files/psautohint-2.3.0-no-build-library.patch |
30 |
new file mode 100644 |
31 |
index 000000000..44698b6af |
32 |
--- /dev/null |
33 |
+++ b/dev-util/psautohint/files/psautohint-2.3.0-no-build-library.patch |
34 |
@@ -0,0 +1,39 @@ |
35 |
+diff '--color=auto' -ru psautohint-2.3.0/setup.py /var/tmp/portage/dev-util/psautohint-2.3.0/work/psautohint-2.3.0/setup.py |
36 |
+--- psautohint-2.3.0/setup.py 2021-06-18 02:49:14.569282664 +0200 |
37 |
++++ /var/tmp/portage/dev-util/psautohint-2.3.0/work/psautohint-2.3.0/setup.py 2021-06-18 02:51:12.569250040 +0200 |
38 |
+@@ -192,7 +192,7 @@ |
39 |
+ # If we were asked to build any C/C++ libraries, make sure that the |
40 |
+ # directory where we put them is in the library search path for |
41 |
+ # linking executables. |
42 |
+- if self.distribution.has_c_libraries(): |
43 |
++ if False: |
44 |
+ build_clib = self.get_finalized_command('build_clib') |
45 |
+ self.libraries.extend(build_clib.get_library_names() or []) |
46 |
+ self.library_dirs.append(build_clib.build_clib) |
47 |
+@@ -432,15 +432,13 @@ |
48 |
+ class CustomBuildExt(_build_ext): |
49 |
+ |
50 |
+ def run(self): |
51 |
+- if self.distribution.has_c_libraries(): |
52 |
++ if False: |
53 |
+ self.run_command("build_clib") |
54 |
+ _build_ext.run(self) |
55 |
+ |
56 |
+ |
57 |
+ cmdclass = { |
58 |
+- 'build_clib': CustomBuildClib, |
59 |
+ 'build_ext': CustomBuildExt, |
60 |
+- 'build_exe': build_exe, |
61 |
+ } |
62 |
+ |
63 |
+ |
64 |
+@@ -572,9 +570,7 @@ |
65 |
+ license='Apache License, Version 2.0', |
66 |
+ package_dir={'': 'python'}, |
67 |
+ packages=['psautohint'], |
68 |
+- libraries=libraries, |
69 |
+ ext_modules=ext_modules, |
70 |
+- executables=executables, |
71 |
+ entry_points={ |
72 |
+ 'console_scripts': [ |
73 |
+ "psautohint = psautohint.__main__:main", |
74 |
|
75 |
diff --git a/dev-util/psautohint/files/psautohint-2.3.0-no-werror.patch b/dev-util/psautohint/files/psautohint-2.3.0-no-werror.patch |
76 |
new file mode 100644 |
77 |
index 000000000..5032e5782 |
78 |
--- /dev/null |
79 |
+++ b/dev-util/psautohint/files/psautohint-2.3.0-no-werror.patch |
80 |
@@ -0,0 +1,11 @@ |
81 |
+diff '--color=auto' -ru psautohint-2.3.0/libpsautohint/meson.build /var/tmp/portage/dev-util/psautohint-2.3.0/work/psautohint-2.3.0/libpsautohint/meson.build |
82 |
+--- psautohint-2.3.0/libpsautohint/meson.build 2021-06-18 02:49:14.557282566 +0200 |
83 |
++++ /var/tmp/portage/dev-util/psautohint-2.3.0/work/psautohint-2.3.0/libpsautohint/meson.build 2021-06-18 02:54:34.873912737 +0200 |
84 |
+@@ -21,7 +21,6 @@ |
85 |
+ '-Wstringop-truncation', |
86 |
+ '-Wunreachable-code-break', |
87 |
+ '-Wunused-macros', |
88 |
+- '-Werror', |
89 |
+ ] |
90 |
+ |
91 |
+ add_global_arguments(cc.get_supported_arguments(cflags), language : 'c') |
92 |
|
93 |
diff --git a/dev-util/psautohint/files/psautohint-bininpath.diff b/dev-util/psautohint/files/psautohint-bininpath.diff |
94 |
new file mode 100644 |
95 |
index 000000000..fe6b5df3c |
96 |
--- /dev/null |
97 |
+++ b/dev-util/psautohint/files/psautohint-bininpath.diff |
98 |
@@ -0,0 +1,10 @@ |
99 |
+--- a/setup.py |
100 |
++++ b/setup.py |
101 |
+@@ -564,6 +564,7 @@ ext_modules = [ |
102 |
+ sources=[ |
103 |
+ "python/psautohint/_psautohint.c", |
104 |
+ ], |
105 |
++ libraries = ['psautohint'], |
106 |
+ ), |
107 |
+ ] |
108 |
+ |
109 |
|
110 |
diff --git a/dev-util/psautohint/metadata.xml b/dev-util/psautohint/metadata.xml |
111 |
new file mode 100644 |
112 |
index 000000000..6f49eba8f |
113 |
--- /dev/null |
114 |
+++ b/dev-util/psautohint/metadata.xml |
115 |
@@ -0,0 +1,5 @@ |
116 |
+<?xml version="1.0" encoding="UTF-8"?> |
117 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
118 |
+<pkgmetadata> |
119 |
+<!-- maintainer-needed --> |
120 |
+</pkgmetadata> |
121 |
|
122 |
diff --git a/dev-util/psautohint/psautohint-2.3.0.ebuild b/dev-util/psautohint/psautohint-2.3.0.ebuild |
123 |
new file mode 100644 |
124 |
index 000000000..0684247cb |
125 |
--- /dev/null |
126 |
+++ b/dev-util/psautohint/psautohint-2.3.0.ebuild |
127 |
@@ -0,0 +1,77 @@ |
128 |
+# Copyright 1999-2021 Gentoo Authors |
129 |
+# Distributed under the terms of the GNU General Public License v2 |
130 |
+ |
131 |
+EAPI=7 |
132 |
+ |
133 |
+COMMIT="1e4c5061d328105c4dcfcb6fdbc27ec49b3e9d23" |
134 |
+DISTUTILS_IN_SOURCE_BUILD=1 |
135 |
+EMESON_SOURCE="${S}/libpsautohint" |
136 |
+PYTHON_COMPAT=( python3_8 ) |
137 |
+ |
138 |
+inherit meson distutils-r1 |
139 |
+ |
140 |
+SRC_URI=" |
141 |
+ https://github.com/adobe-type-tools/psautohint/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz |
142 |
+ test? ( |
143 |
+ https://github.com/adobe-type-tools/psautohint-testdata/archive/${COMMIT}.tar.gz -> psautohint-testdata-${COMMIT}.tar.gz |
144 |
+ ) |
145 |
+" |
146 |
+KEYWORDS="~amd64 ~x86" |
147 |
+DESCRIPTION="A standalone version of AFDKO autohinter" |
148 |
+HOMEPAGE="https://github.com/adobe-type-tools/psautohint" |
149 |
+LICENSE="Apache-2.0" |
150 |
+SLOT="0" |
151 |
+ |
152 |
+RDEPEND=">=dev-python/fonttools-4.20[${PYTHON_USEDEP}]" |
153 |
+DEPEND="${RDEPEND}" |
154 |
+ |
155 |
+PATCHES=( |
156 |
+ "${FILESDIR}/${PN}-bininpath.diff" |
157 |
+ "${FILESDIR}/${P}-no-build-library.patch" |
158 |
+ "${FILESDIR}/${P}-no-werror.patch" |
159 |
+) |
160 |
+ |
161 |
+distutils_enable_tests pytest |
162 |
+ |
163 |
+pkg_setup() { |
164 |
+ local _v=$(ver_cut 4) |
165 |
+ _v="$(ver_cut 1-3)${_v:0:1}$(ver_cut 5)" |
166 |
+ export SETUPTOOLS_SCM_PRETEND_VERSION="${_v/p/.post}" |
167 |
+ MESON_BUILD_DIR="${WORKDIR}/${P}-build" |
168 |
+} |
169 |
+ |
170 |
+src_unpack() { |
171 |
+ default |
172 |
+ if [ -d "${WORKDIR}/psautohint-testdata-${COMMIT}" ]; then |
173 |
+ mv "${WORKDIR}/psautohint-testdata-${COMMIT}"/* "${S}/tests/integration/data/" || die |
174 |
+ fi |
175 |
+} |
176 |
+ |
177 |
+src_configure() { |
178 |
+ BUILD_DIR="${MESON_BUILD_DIR}" meson_src_configure |
179 |
+ distutils-r1_src_configure |
180 |
+} |
181 |
+ |
182 |
+src_compile() { |
183 |
+ BUILD_DIR="${MESON_BUILD_DIR}" meson_src_compile |
184 |
+ distutils-r1_src_compile |
185 |
+} |
186 |
+ |
187 |
+python_compile() { |
188 |
+ esetup.py build_py build_ext --library-dirs "${MESON_BUILD_DIR}" |
189 |
+} |
190 |
+ |
191 |
+src_install() { |
192 |
+ BUILD_DIR="${MESON_BUILD_DIR}" meson_src_install |
193 |
+ distutils-r1_src_install |
194 |
+ dodoc doc/* |
195 |
+} |
196 |
+ |
197 |
+python_test() { |
198 |
+ local -x PATH="${BUILD_DIR}/test/scripts:${MESON_BUILD_DIR}l:${PATH}" |
199 |
+ local -x LD_LIBRARY_PATH="${MESON_BUILD_DIR}" |
200 |
+ distutils_install_for_testing |
201 |
+ epytest -vv \ |
202 |
+ --deselect tests/integration/test_hint.py::test_hashmap_old_version \ |
203 |
+ || die |
204 |
+} |