1 |
commit: f895567e762f8f068a525b9294446f14938eab0e |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Aug 16 11:46:33 2020 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 16 11:46:33 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f895567e |
7 |
|
8 |
dev-libs/link-grammar: Version bump to 5.8.0 |
9 |
|
10 |
* EAPI 7 |
11 |
* Supports Python 3.6/3.7/3.8/3.9 |
12 |
|
13 |
Bug: https://bugs.gentoo.org/718282 |
14 |
Package-Manager: Portage-3.0.2, Repoman-2.3.23 |
15 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
16 |
|
17 |
dev-libs/link-grammar/Manifest | 1 + |
18 |
.../files/link-grammar-5.8.0-dont-inject-O3.patch | 23 ++++ |
19 |
.../link-grammar-5.8.0-out-of-source-build.patch | 33 ++++++ |
20 |
dev-libs/link-grammar/link-grammar-5.8.0.ebuild | 125 +++++++++++++++++++++ |
21 |
4 files changed, 182 insertions(+) |
22 |
|
23 |
diff --git a/dev-libs/link-grammar/Manifest b/dev-libs/link-grammar/Manifest |
24 |
index 97d340e7ab7..8e5e8d34970 100644 |
25 |
--- a/dev-libs/link-grammar/Manifest |
26 |
+++ b/dev-libs/link-grammar/Manifest |
27 |
@@ -1 +1,2 @@ |
28 |
DIST link-grammar-5.3.11.tar.gz 3632617 BLAKE2B 07fe951743096a0d6b906c9b7174b58fcc54b0e2c54805d15731de783888327799fd77f64a2ae7f4e09327feb08d91cb95471e9c0c3c2fe00fca3553f40b1905 SHA512 09671d187deac3b9530dd63eb4497de9c2c9db32d79da06c677bdbccac015adef06813819692a92d15499c7cb347071c58b73c52505af154bdc8a8fcd409ddd2 |
29 |
+DIST link-grammar-5.8.0.tar.gz 3782125 BLAKE2B 8027e91212d3269b8e3ceaa5c837ad961cd2dfd92849d3989094ab771d97d30f4b228cfc1e32e9e843676aa439d790fb444823f7db69004538ad068c7bf28a45 SHA512 1262e2faf1de6f05a62f9d622f43c02253b4c241342df9b443a70ae04bd328d1fc49cd2f91c881e694f67215005833fec8b1fa9d395b1e547985b376c7415d2e |
30 |
|
31 |
diff --git a/dev-libs/link-grammar/files/link-grammar-5.8.0-dont-inject-O3.patch b/dev-libs/link-grammar/files/link-grammar-5.8.0-dont-inject-O3.patch |
32 |
new file mode 100644 |
33 |
index 00000000000..2d97b7cc762 |
34 |
--- /dev/null |
35 |
+++ b/dev-libs/link-grammar/files/link-grammar-5.8.0-dont-inject-O3.patch |
36 |
@@ -0,0 +1,23 @@ |
37 |
+--- a/configure.ac |
38 |
++++ b/configure.ac |
39 |
+@@ -137,8 +137,7 @@ |
40 |
+ AC_SUBST(HOST_OS) |
41 |
+ # ==================================================================== |
42 |
+ |
43 |
+-CFLAGS="${CFLAGS} -O3" |
44 |
+-CXXFLAGS="${CXXFLAGS} -O3 -Wall" |
45 |
++CXXFLAGS="${CXXFLAGS} -Wall" |
46 |
+ |
47 |
+ # The std=c11 flag provides the proper float-pt math decls working, |
48 |
+ # e.g. fmax However, it also undefined _BSD_SOURCE, etc. which is |
49 |
+@@ -908,10 +907,6 @@ |
50 |
+ |
51 |
+ AC_FUNC_STRERROR_R |
52 |
+ |
53 |
+-AC_SUBST(CFLAGS) |
54 |
+-AC_SUBST(CPPFLAGS) |
55 |
+-AC_SUBST(CXXFLAGS) |
56 |
+- |
57 |
+ dnl Save the compilation definitions for an extended version printout |
58 |
+ AC_OUTPUT_MAKE_DEFS() |
59 |
+ LG_DEFS=`$ECHO "$DEFS" | $SED 's/\\\\//g'` |
60 |
|
61 |
diff --git a/dev-libs/link-grammar/files/link-grammar-5.8.0-out-of-source-build.patch b/dev-libs/link-grammar/files/link-grammar-5.8.0-out-of-source-build.patch |
62 |
new file mode 100644 |
63 |
index 00000000000..1616e933664 |
64 |
--- /dev/null |
65 |
+++ b/dev-libs/link-grammar/files/link-grammar-5.8.0-out-of-source-build.patch |
66 |
@@ -0,0 +1,33 @@ |
67 |
+--- a/bindings/python/Makefile.am |
68 |
++++ b/bindings/python/Makefile.am |
69 |
+@@ -4,8 +4,8 @@ |
70 |
+ # Created by Linas Vepstas February 2014 |
71 |
+ # |
72 |
+ # |
73 |
+-SWIG_SOURCES = ../swig/link_grammar.i |
74 |
+-SWIG_INCLUDES = ../../link-grammar/link-includes.h |
75 |
++SWIG_SOURCES = $(top_srcdir)/bindings/swig/link_grammar.i |
76 |
++SWIG_INCLUDES = $(top_srcdir)/link-grammar/link-includes.h |
77 |
+ built_c_sources = lg_python_wrap.cc |
78 |
+ built_py_sources = $(top_builddir)/bindings/python/clinkgrammar.py |
79 |
+ |
80 |
+@@ -18,16 +18,16 @@ |
81 |
+ |
82 |
+ # Files that get installed in $pkgpythondir |
83 |
+ pkgpython_PYTHON = \ |
84 |
+- linkgrammar.py \ |
85 |
++ $(srcdir)/linkgrammar.py \ |
86 |
+ $(top_builddir)/bindings/python/__init__.py \ |
87 |
+- $(top_builddir)/bindings/python/clinkgrammar.py |
88 |
++ $(built_py_sources) |
89 |
+ |
90 |
+ # Apparently, anaconda does not work without this!? |
91 |
+ # This seems wrong and lame to me, but see issue #298 |
92 |
+ # https://github.com/opencog/link-grammar/issues/298 |
93 |
+ pkgpypathdir=$(pythondir) |
94 |
+ pkgpypath_PYTHON = \ |
95 |
+- linkgrammar.pth |
96 |
++ $(srcdir)/linkgrammar.pth |
97 |
+ |
98 |
+ # The make uninstall target should remove directories we created. |
99 |
+ uninstall-hook: |
100 |
|
101 |
diff --git a/dev-libs/link-grammar/link-grammar-5.8.0.ebuild b/dev-libs/link-grammar/link-grammar-5.8.0.ebuild |
102 |
new file mode 100644 |
103 |
index 00000000000..6434d2d8be2 |
104 |
--- /dev/null |
105 |
+++ b/dev-libs/link-grammar/link-grammar-5.8.0.ebuild |
106 |
@@ -0,0 +1,125 @@ |
107 |
+# Copyright 1999-2020 Gentoo Authors |
108 |
+# Distributed under the terms of the GNU General Public License v2 |
109 |
+ |
110 |
+EAPI=7 |
111 |
+ |
112 |
+PYTHON_COMPAT=( python3_{6..9} ) |
113 |
+ |
114 |
+inherit autotools java-pkg-opt-2 python-r1 out-of-source |
115 |
+ |
116 |
+DESCRIPTION="A Syntactic English parser" |
117 |
+HOMEPAGE="https://www.abisource.com/projects/link-grammar/ https://www.link.cs.cmu.edu/link/" |
118 |
+SRC_URI="https://www.abisource.com/downloads/${PN}/${PV}/${P}.tar.gz" |
119 |
+ |
120 |
+LICENSE="LGPL-2.1" |
121 |
+SLOT="0" |
122 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
123 |
+IUSE="aspell +hunspell java python" # pcre |
124 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
125 |
+ |
126 |
+# XXX: sqlite is automagic |
127 |
+# Does not build with >=sci-mathematics/minisat-2, bug #593662 |
128 |
+# add pcre support: pcre? ( dev-libs/libpcre ) |
129 |
+RDEPEND=" |
130 |
+ dev-db/sqlite:3 |
131 |
+ aspell? ( app-text/aspell ) |
132 |
+ hunspell? ( app-text/hunspell ) |
133 |
+ java? ( |
134 |
+ >=virtual/jdk-1.6:* |
135 |
+ dev-java/ant-core |
136 |
+ ) |
137 |
+ python? ( ${PYTHON_DEPS} ) |
138 |
+ !sci-mathematics/minisat" |
139 |
+DEPEND="${RDEPEND}" |
140 |
+BDEPEND=" |
141 |
+ dev-lang/swig:0 |
142 |
+ sys-devel/autoconf-archive |
143 |
+ virtual/pkgconfig" |
144 |
+ |
145 |
+pkg_setup() { |
146 |
+ if use aspell && use hunspell; then |
147 |
+ ewarn "You have enabled 'aspell' and 'hunspell' support, but both cannot coexist," |
148 |
+ ewarn "only hunspell will be built. Press Ctrl+C and set only 'aspell' USE flag if" |
149 |
+ ewarn "you want aspell support." |
150 |
+ fi |
151 |
+ use java && java-pkg-opt-2_pkg_setup |
152 |
+} |
153 |
+ |
154 |
+src_prepare() { |
155 |
+ use java && java-pkg-opt-2_src_prepare |
156 |
+ |
157 |
+ # http://bugzilla.abisource.com/show_bug.cgi?id=13806 |
158 |
+ eapply "${FILESDIR}"/${PN}-5.8.0-out-of-source-build.patch |
159 |
+ eapply "${FILESDIR}"/${PN}-5.8.0-dont-inject-O3.patch |
160 |
+ eapply_user |
161 |
+ |
162 |
+ eautoreconf |
163 |
+} |
164 |
+ |
165 |
+my_src_configure() { |
166 |
+ local myconf=( |
167 |
+ --disable-maintainer-mode |
168 |
+ --disable-editline |
169 |
+ --disable-perl-bindings |
170 |
+ --disable-static |
171 |
+ --enable-sat-solver=bundled |
172 |
+ $(use_enable aspell) |
173 |
+ $(use_enable hunspell) |
174 |
+ $(usex hunspell --with-hunspell-dictdir="${EPREFIX}"/usr/share/myspell '') |
175 |
+ $(use_enable java java-bindings) |
176 |
+ # $(use_enable pcre regex-tokenizer) |
177 |
+ # $(use_with pcre) |
178 |
+ ) |
179 |
+ |
180 |
+ econf \ |
181 |
+ --disable-python-bindings \ |
182 |
+ "${myconf[@]}" |
183 |
+ |
184 |
+ if use python; then |
185 |
+ python_configure() { |
186 |
+ econf \ |
187 |
+ --enable-python-bindings \ |
188 |
+ "${myconf[@]}" |
189 |
+ } |
190 |
+ python_foreach_impl run_in_build_dir python_configure |
191 |
+ fi |
192 |
+} |
193 |
+ |
194 |
+my_src_compile() { |
195 |
+ local -x MAIN_BUILD_DIR="${BUILD_DIR}" |
196 |
+ default |
197 |
+ |
198 |
+ if use python; then |
199 |
+ python_compile() { |
200 |
+ emake -C bindings/python \ |
201 |
+ VPATH="${S}:${MAIN_BUILD_DIR}" \ |
202 |
+ _clinkgrammar_la_DEPENDENCIES="${MAIN_BUILD_DIR}"/link-grammar/liblink-grammar.la \ |
203 |
+ _clinkgrammar_la_LIBADD="${MAIN_BUILD_DIR}"/link-grammar/liblink-grammar.la |
204 |
+ } |
205 |
+ python_foreach_impl run_in_build_dir python_compile |
206 |
+ fi |
207 |
+} |
208 |
+ |
209 |
+my_src_install() { |
210 |
+ local -x MAIN_BUILD_DIR="${BUILD_DIR}" |
211 |
+ default |
212 |
+ |
213 |
+ if use python; then |
214 |
+ python_install() { |
215 |
+ emake -C bindings/python \ |
216 |
+ VPATH="${S}:${MAIN_BUILD_DIR}" \ |
217 |
+ _clinkgrammar_la_DEPENDENCIES="${MAIN_BUILD_DIR}"/link-grammar/liblink-grammar.la \ |
218 |
+ _clinkgrammar_la_LIBADD="${MAIN_BUILD_DIR}"/link-grammar/liblink-grammar.la \ |
219 |
+ DESTDIR="${D}" \ |
220 |
+ install |
221 |
+ } |
222 |
+ python_foreach_impl run_in_build_dir python_install |
223 |
+ fi |
224 |
+ |
225 |
+ # no static archives |
226 |
+ find "${ED}" -name '*.la' -delete || die |
227 |
+} |
228 |
+ |
229 |
+pkg_preinst() { |
230 |
+ use java && java-pkg-opt-2_pkg_preinst |
231 |
+} |