sci-ml/sentencepiece: fix lto and pre-stripped

Closes: https://bugs.gentoo.org/959086
Closes: https://bugs.gentoo.org/955576
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
This commit is contained in:
Alfredo Tupone 2025-07-04 08:05:50 +02:00
parent 771151d5e2
commit 563ef48833
No known key found for this signature in database
GPG Key ID: FBE5925C5B02CE58
2 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1,12 @@
--- a/python/setup.py 2025-07-04 07:49:02.451080540 +0200
+++ b/python/setup.py 2025-07-04 07:49:50.934572275 +0200
@@ -91,9 +91,6 @@
# See: https://github.com/neulab/xnmt/issues/199
if sys.platform == 'darwin':
cflags.append('-mmacosx-version-min=10.9')
- else:
- cflags.append('-Wl,-strip-all')
- libs.append('-Wl,-strip-all')
if sys.platform == 'linux':
libs.append('-Wl,-Bsymbolic')
print('## cflags={}'.format(' '.join(cflags)))

View File

@ -6,7 +6,7 @@ EAPI=8
DISTUTILS_USE_PEP517=setuptools
DISTUTILS_EXT=1
PYTHON_COMPAT=( python3_{11..13} )
inherit cmake distutils-r1
inherit cmake distutils-r1 dot-a
DESCRIPTION="Text tokenizer for Neural Network-based text generation"
HOMEPAGE="https://github.com/google/sentencepiece"
@ -46,7 +46,8 @@ src_prepare() {
src/builder.cc \
|| die
eapply "${FILESDIR}"/${P}-gcc15.patch \
"${FILESDIR}"/${P}-cmake.patch
"${FILESDIR}"/${P}-cmake.patch \
"${FILESDIR}"/${P}-nostrip.patch
cmake_src_prepare
distutils-r1_src_prepare
sed \
@ -59,6 +60,7 @@ src_prepare() {
}
src_configure() {
lto-guarantee-fat
local mycmakeargs=(
-DSPM_ABSL_PROVIDER=package
-DSPM_PROTOBUF_PROVIDER=package
@ -84,4 +86,5 @@ python_test() {
src_install() {
cmake_src_install
distutils-r1_src_install
strip-lto-bytecode
}