summaryrefslogtreecommitdiff
path: root/dev-libs/fastText
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/fastText')
-rw-r--r--dev-libs/fastText/Manifest4
-rw-r--r--dev-libs/fastText/fastText-0.9.2-r1.ebuild78
-rw-r--r--dev-libs/fastText/files/gcc-13.patch34
-rw-r--r--dev-libs/fastText/metadata.xml12
4 files changed, 128 insertions, 0 deletions
diff --git a/dev-libs/fastText/Manifest b/dev-libs/fastText/Manifest
new file mode 100644
index 0000000..3cd611e
--- /dev/null
+++ b/dev-libs/fastText/Manifest
@@ -0,0 +1,4 @@
+AUX gcc-13.patch 922 BLAKE2B 96919a81e24f638e48ca1b9b5309ae108a0aff53904b9a8dce83798c801d9b1d948e96eddef96a33b0c84486ef4631a5a1f5a06d1152c8331175054aebdc3cad SHA512 eab4138577c8a623aef1bf576594551a806b62574d271ba27dca8acf84c4d1d8d9222b08dc934de5ae64e842809f13678008c6ccd07849086f194b677bf83d46
+DIST fastText-0.9.2.gh.tar.gz 4036722 BLAKE2B ea3af92ce18d04241128cfb28773f0785a006e79c861d718c2c6ad788d776ad60b0543a42eb8be5a865cbc12283355521431fe2fba48544399e4a2b1520ff3f1 SHA512 8f0f6e78b3c6b3c7e7d107778952f340cc208b8e0b920dd118a57884cca8ef7007ea88b6f3352cb7e08289a64743f507309e1e1259c785f810af7f5fa09f2656
+EBUILD fastText-0.9.2-r1.ebuild 1806 BLAKE2B d607441f775af4f034f3fb286759a8c496d578f369293053814787982339788a27faed072dea34f58527b8982e7b2e651f52d994b703e1050a6bf1925cea7f46 SHA512 8a0a6c0f9a60bd1811b947b5404f2c600868e9aa593370d43576240a138a4009d6a89098da157c91bc7c8a97215359b93088273287b8eabc6e7a384dcb0a2c77
+MISC metadata.xml 419 BLAKE2B 40de64b2be1363b9b3fa858362769b46f9852c8b2f0c9ec0070b2e899068e1ac88e97150c8eb22616eaec5567bd5a3e609dfe7de6012c072ec61d04d29863d11 SHA512 bf2b1408bf8f49f73bc7b8bb347624dcb0cba3173ca9198fade0a4d81a381cccb11769242d940d09eff42739e55a25283ea3831bb87f0ea401fc06072bdf7722
diff --git a/dev-libs/fastText/fastText-0.9.2-r1.ebuild b/dev-libs/fastText/fastText-0.9.2-r1.ebuild
new file mode 100644
index 0000000..4198ad6
--- /dev/null
+++ b/dev-libs/fastText/fastText-0.9.2-r1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit cmake distutils-r1
+
+DESCRIPTION="Library for fast text representation and classification"
+HOMEPAGE="https://github.com/facebookresearch/fastText"
+SRC_URI="https://github.com/facebookresearch/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="dev-python/numpy[${PYTHON_USEDEP}]"
+RDEPEND="python? ( ${PYTHON_DEPS}
+ ${CDEPEND} )"
+DEPEND="python? ( ${CDEPEND} )"
+BDEPEND="
+ ${DISTUTILS_DEPS}
+ python? ( dev-python/pybind11[${PYTHON_USEDEP}] )
+"
+PATCHES=( "${FILESDIR}/gcc-13.patch" )
+
+src_prepare() {
+ cmake_src_prepare
+ use python && distutils-r1_src_prepare
+
+ sed -i -e "/CMAKE_CXX_FLAGS/d" \
+ -e "s/\(DESTINATION\) lib/\1 $(get_libdir)/g" \
+ CMakeLists.txt || die "sed failed for CMakeLists.txt"
+ sed -i "/extra_compile_args=/,+1d" setup.py \
+ || die "sed failed for setup.py"
+}
+
+python_prepare_all() {
+ # fix QA
+ sed -i '/description/s/-/_/' setup.cfg || die "sed failed for setup.cfg"
+ distutils-r1_python_prepare_all
+}
+
+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 "test fails"
+}
+
+src_install() {
+ cmake_src_install
+ use python && distutils-r1_src_install
+
+ find "${ED}" -name '*.a' -delete || die "find failed"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ find "${ED}" -type d -name "tests" -exec rm -rv {} + \
+ || die "test removing failed"
+}
diff --git a/dev-libs/fastText/files/gcc-13.patch b/dev-libs/fastText/files/gcc-13.patch
new file mode 100644
index 0000000..0f895f4
--- /dev/null
+++ b/dev-libs/fastText/files/gcc-13.patch
@@ -0,0 +1,34 @@
+From 6c2204ba66776b700095ff73e3e599a908ffd9c3 Mon Sep 17 00:00:00 2001
+From: Cherilyn Buren <88433283+NiuBlibing@users.noreply.github.com>
+Date: Mon, 27 Nov 2023 15:41:10 -0800
+Subject: [PATCH] fix compile error with gcc13 #1281 (#1340)
+
+Summary:
+Due to[ header dependency changes](https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes) in GCC 13, we need to include the <cstdint> header.
+
+Pull Request resolved: https://github.com/facebookresearch/fastText/pull/1340
+
+Reviewed By: jmp84
+
+Differential Revision: D51602433
+
+Pulled By: alexkosau
+
+fbshipit-source-id: cc9bffb276cb00f1db8ec97a36784c484ae4563a
+---
+ src/args.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/args.cc b/src/args.cc
+index 313e9816e..5f65f6693 100644
+--- a/src/args.cc
++++ b/src/args.cc
+@@ -9,6 +9,7 @@
+ #include "args.h"
+
+-#include <stdlib.h>
++#include <cstdlib>
++#include <cstdint>
+
+ #include <iostream>
+ #include <stdexcept>
diff --git a/dev-libs/fastText/metadata.xml b/dev-libs/fastText/metadata.xml
new file mode 100644
index 0000000..8316474
--- /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>marcin.deranek@slonko.net</email>
+ <name>Marcin Deranek</name>
+ </maintainer>
+ <upstream>
+ <bugs-to>https://github.com/facebookresearch/fastText/issues</bugs-to>
+ <remote-id type="github">facebookresearch/fastText</remote-id>
+ </upstream>
+</pkgmetadata>