From b49858b724d2ab352f93db399822428f84e05d31 Mon Sep 17 00:00:00 2001 From: Marcin Deranek Date: Sat, 9 Dec 2023 13:23:29 +0100 Subject: dev-libs/fastText gcc-13 patch --- dev-libs/fastText/Manifest | 3 +- dev-libs/fastText/fastText-0.9.2-r1.ebuild | 78 ++++++++++++++++++++++++++++++ dev-libs/fastText/fastText-0.9.2.ebuild | 77 ----------------------------- dev-libs/fastText/files/gcc-13.patch | 34 +++++++++++++ 4 files changed, 114 insertions(+), 78 deletions(-) create mode 100644 dev-libs/fastText/fastText-0.9.2-r1.ebuild delete mode 100644 dev-libs/fastText/fastText-0.9.2.ebuild create mode 100644 dev-libs/fastText/files/gcc-13.patch (limited to 'dev-libs') diff --git a/dev-libs/fastText/Manifest b/dev-libs/fastText/Manifest index dfcda97..3cd611e 100644 --- a/dev-libs/fastText/Manifest +++ b/dev-libs/fastText/Manifest @@ -1,3 +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.ebuild 1767 BLAKE2B 2958ddc4cddd2dbab3137da2201dd3327d1b92c7de4313d8ca8341147143ad0544c84f98c81c8b0e889a4f8458fc970fa6dee459cad705539296b014b0c628be SHA512 35edda2d83ee06e7100205b1905f4f0ff3590697200136537e33d973c0e60463d6ab6da8f33f85e526dbebd7322786d81cf88d53e4f681a1171bb90d3fc822b7 +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/fastText-0.9.2.ebuild b/dev-libs/fastText/fastText-0.9.2.ebuild deleted file mode 100644 index 4b5e7bb..0000000 --- a/dev-libs/fastText/fastText-0.9.2.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# 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}] ) -" - -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 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 ++#include ++#include + + #include + #include -- cgit v1.2.3