diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
| commit | bfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch) | |
| tree | 0d7a74b4463ee387f9cf9368ceb1b757f694f72a /dev-libs/fastText | |
| parent | f716a9fe6455d39eef01e718aae68dae61c19704 (diff) | |
| download | baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip | |
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'dev-libs/fastText')
| -rw-r--r-- | dev-libs/fastText/Manifest | 1 | ||||
| -rw-r--r-- | dev-libs/fastText/fastText-0.9.2.ebuild | 78 | ||||
| -rw-r--r-- | dev-libs/fastText/files/fastText-0.9.2-gcc13.patch | 13 | ||||
| -rw-r--r-- | dev-libs/fastText/files/fastText-0.9.2-numpy2.patch | 30 | ||||
| -rw-r--r-- | dev-libs/fastText/files/fastText-0.9.2-pep517.patch | 9 | ||||
| -rw-r--r-- | dev-libs/fastText/metadata.xml | 12 |
6 files changed, 143 insertions, 0 deletions
diff --git a/dev-libs/fastText/Manifest b/dev-libs/fastText/Manifest new file mode 100644 index 000000000000..a6779ea0979b --- /dev/null +++ b/dev-libs/fastText/Manifest @@ -0,0 +1 @@ +DIST fastText-0.9.2.gh.tar.gz 4036722 BLAKE2B ea3af92ce18d04241128cfb28773f0785a006e79c861d718c2c6ad788d776ad60b0543a42eb8be5a865cbc12283355521431fe2fba48544399e4a2b1520ff3f1 SHA512 8f0f6e78b3c6b3c7e7d107778952f340cc208b8e0b920dd118a57884cca8ef7007ea88b6f3352cb7e08289a64743f507309e1e1259c785f810af7f5fa09f2656 diff --git a/dev-libs/fastText/fastText-0.9.2.ebuild b/dev-libs/fastText/fastText-0.9.2.ebuild new file mode 100644 index 000000000000..def2a77feef0 --- /dev/null +++ b/dev-libs/fastText/fastText-0.9.2.ebuild @@ -0,0 +1,78 @@ +# Copyright 2022-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +DISTUTILS_EXT=1 +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_PEP517=setuptools +inherit cmake distutils-r1 edo + +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}.gh.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}] + ) +" +BDEPEND=" + python? ( ${DISTUTILS_DEPS} ) +" + +DOCS=( {CODE_OF_CONDUCT,CONTRIBUTING,README}.md python/{README.rst,doc} docs ) +PATCHES=( + "${FILESDIR}/${P}-gcc13.patch" + "${FILESDIR}/${P}-numpy2.patch" + "${FILESDIR}/${P}-pep517.patch" +) + +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() { + local mycmakeargs=( + -DPROJECT_VERSION=${PV} + ) + + 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() { + edo ${EPYTHON} runtests.py -u +} + +src_install() { + cmake_src_install + use python && distutils-r1_src_install + + find "${ED}" -name '*.a' -delete || die +} diff --git a/dev-libs/fastText/files/fastText-0.9.2-gcc13.patch b/dev-libs/fastText/files/fastText-0.9.2-gcc13.patch new file mode 100644 index 000000000000..ba00466f34d4 --- /dev/null +++ b/dev-libs/fastText/files/fastText-0.9.2-gcc13.patch @@ -0,0 +1,13 @@ +https://bugs.gentoo.org/905908 +https://github.com/facebookresearch/fastText/commit/6c2204ba66776b700095ff73e3e599a908ffd9c3 + +--- a/src/args.cc ++++ b/src/args.cc +@@ -9,6 +9,7 @@ + #include "args.h" + + #include <stdlib.h> ++#include <cstdint> + + #include <iostream> + #include <stdexcept> diff --git a/dev-libs/fastText/files/fastText-0.9.2-numpy2.patch b/dev-libs/fastText/files/fastText-0.9.2-numpy2.patch new file mode 100644 index 000000000000..4fe744aca289 --- /dev/null +++ b/dev-libs/fastText/files/fastText-0.9.2-numpy2.patch @@ -0,0 +1,30 @@ +https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword +--- a/python/fasttext_module/fasttext/FastText.py ++++ b/python/fasttext_module/fasttext/FastText.py +@@ -43,7 +43,7 @@ class _Meter(object): + else: + y_scores, y_true = ([], ()) + +- return np.array(y_scores, copy=False), np.array(y_true, copy=False) ++ return np.asarray(y_scores), np.asarray(y_true) + + def precision_recall_curve(self, label=None): + """Return precision/recall curve""" +@@ -58,7 +58,7 @@ class _Meter(object): + else: + precision, recall = ([], ()) + +- return np.array(precision, copy=False), np.array(recall, copy=False) ++ return np.asarray(precision), np.asarray(recall) + + def precision_at_recall(self, recall, label=None): + """Return precision for a given recall""" +@@ -229,7 +229,7 @@ class _FastText(object): + else: + probs, labels = ([], ()) + +- return labels, np.array(probs, copy=False) ++ return labels, np.asarray(probs) + + def get_input_matrix(self): + """ diff --git a/dev-libs/fastText/files/fastText-0.9.2-pep517.patch b/dev-libs/fastText/files/fastText-0.9.2-pep517.patch new file mode 100644 index 000000000000..aff5ddbfc76b --- /dev/null +++ b/dev-libs/fastText/files/fastText-0.9.2-pep517.patch @@ -0,0 +1,9 @@ +Fix SetuptoolsDeprecationWarning: Invalid dash-separated options +https://github.com/facebookresearch/fastText/pull/1316 + +--- a/setup.cfg ++++ b/setup.cfg +@@ -1,2 +1,2 @@ + [metadata] +-description-file = README.md ++description_file = README.md diff --git a/dev-libs/fastText/metadata.xml b/dev-libs/fastText/metadata.xml new file mode 100644 index 000000000000..2e0aa32c6a6d --- /dev/null +++ b/dev-libs/fastText/metadata.xml @@ -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>pastalian46@gmail.com</email> + <name>Takuya Wakazono</name> + </maintainer> + <upstream> + <remote-id type="github">facebookresearch/fastText</remote-id> + <remote-id type="pypi">fasttext</remote-id> + </upstream> +</pkgmetadata> |
