dev-libs/fastText: initial import

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2022-03-31 12:02:51 +05:00
parent 13c5c504aa
commit 33a07cc462
3 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST fastText-0.9.2.tar.gz 4036722 BLAKE2B ea3af92ce18d04241128cfb28773f0785a006e79c861d718c2c6ad788d776ad60b0543a42eb8be5a865cbc12283355521431fe2fba48544399e4a2b1520ff3f1 SHA512 8f0f6e78b3c6b3c7e7d107778952f340cc208b8e0b920dd118a57884cca8ef7007ea88b6f3352cb7e08289a64743f507309e1e1259c785f810af7f5fa09f2656

View File

@@ -0,0 +1,64 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
DISTUTILS_OPTIONAL=1
inherit cmake distutils-r1
DESCRIPTION="Library for fast text representation and classification"
HOMEPAGE="https://fasttext.cc https://github.com/facebookresearch/fastText"
SRC_URI="https://github.com/facebookresearch/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="python"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND="
python? (
${PYTHON_DEPS}
dev-python/pybind11[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
)
"
DOCS=( {CODE_OF_CONDUCT,CONTRIBUTING,README}.md python/{README.rst,doc} docs )
src_prepare() {
cmake_src_prepare
use python && distutils-r1_src_prepare
sed \
-e "/CMAKE_CXX_FLAGS/d" \
-e "s/\(DESTINATION\) lib/\1 $(get_libdir)/g" \
-i CMakeLists.txt || die
sed "/extra_compile_args=/,+1d" -i setup.py || die
}
src_configure() {
cmake_src_configure
use python && distutils-r1_src_configure
}
src_compile() {
cmake_src_compile
use python && distutils-r1_src_compile
}
src_test() {
use python && distutils-r1_src_test
}
python_test() {
${EPYTHON} runtests.py -u || die
}
src_install() {
cmake_src_install
use python && distutils-r1_src_install
find "${ED}" -name '*.a' -delete || die
}

View File

@@ -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">
<email>cyber+gentoo@sysrq.in</email>
<name>Anna</name>
</maintainer>
<upstream>
<remote-id type="github">facebookresearch/fastText</remote-id>
<remote-id type="pypi">fasttext</remote-id>
</upstream>
</pkgmetadata>