1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_5,3_6} )
8 inherit autotools eutils gnome2 java-pkg-opt-2 python-r1
10 DESCRIPTION="A Syntactic English parser"
11 HOMEPAGE="http://www.abisource.com/projects/link-grammar/ http://www.link.cs.cmu.edu/link/"
12 SRC_URI="http://www.abisource.com/downloads/${PN}/${PV}/${P}.tar.gz"
16 KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ~ppc ~ppc64 sparc x86"
17 IUSE="aspell +hunspell java python static-libs threads" # pcre
18 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
20 # XXX: sqlite is automagic
21 # Does not build with >=sci-mathematics/minisat-2, bug #593662
22 # add pcre support: pcre? ( dev-libs/libpcre )
25 aspell? ( app-text/aspell )
26 hunspell? ( app-text/hunspell )
30 python? ( ${PYTHON_DEPS} )
31 !sci-mathematics/minisat
35 sys-devel/autoconf-archive
39 NORMAL_BUILD_DIR="${WORKDIR}/${P}-normal"
42 if use aspell && use hunspell; then
43 ewarn "You have enabled 'aspell' and 'hunspell' support, but both cannot coexist,"
44 ewarn "only hunspell will be built. Press Ctrl+C and set only 'aspell' USE flag if"
45 ewarn "you want aspell support."
47 use java && java-pkg-opt-2_pkg_setup
51 use java && java-pkg-opt-2_src_prepare
53 # http://bugzilla.abisource.com/show_bug.cgi?id=13806
54 eapply "${FILESDIR}"/${PN}-5.3.9-out-of-source-build.patch
60 mkdir -p "${BUILD_DIR}" || die
62 python_foreach_impl prepare_python
65 mkdir -p "${NORMAL_BUILD_DIR}" || die
72 --disable-perl-bindings
74 --enable-sat-solver=bundled
76 $(use_enable hunspell)
77 $(usex hunspell --with-hunspell-dictdir=/usr/share/myspell)
78 $(use_enable java java-bindings)
79 # $(use_enable pcre regex-tokenizer)
81 $(use_enable static-libs static)
82 $(use_enable threads pthreads)
85 cd "${NORMAL_BUILD_DIR}" || die
86 ECONF_SOURCE="${S}" gnome2_src_configure \
87 --disable-python-bindings \
88 --disable-python3-bindings \
93 if python_is_python3; then
94 ECONF_SOURCE="${S}" gnome2_src_configure \
95 --disable-python-bindings \
96 --enable-python3-bindings \
99 ECONF_SOURCE="${S}" gnome2_src_configure \
100 --enable-python-bindings \
101 --disable-python3-bindings \
105 python_foreach_impl run_in_build_dir prepare_python
110 cd "${NORMAL_BUILD_DIR}" || die
116 if python_is_python3; then
122 emake -C bindings/python$pysuffix \
123 VPATH="${S}:${NORMAL_BUILD_DIR}" \
124 _clinkgrammar_la_DEPENDENCIES="${NORMAL_BUILD_DIR}"/link-grammar/liblink-grammar.la \
125 _clinkgrammar_la_LIBADD="${NORMAL_BUILD_DIR}"/link-grammar/liblink-grammar.la
127 python_foreach_impl run_in_build_dir compile_binding
132 cd "${NORMAL_BUILD_DIR}" || die
133 ln -s "${S}"/data tests/data || die
138 cd "${NORMAL_BUILD_DIR}" || die
144 if python_is_python3; then
150 emake -C bindings/python$pysuffix \
151 VPATH="${S}:${NORMAL_BUILD_DIR}" \
152 _clinkgrammar_la_DEPENDENCIES="${NORMAL_BUILD_DIR}"/link-grammar/liblink-grammar.la \
153 _clinkgrammar_la_LIBADD="${NORMAL_BUILD_DIR}"/link-grammar/liblink-grammar.la \
157 python_foreach_impl run_in_build_dir install_binding
162 use java && java-pkg-opt-2_pkg_preinst