diff --git a/sci-ml/sentencepiece/files/sentencepiece-0.2.0-nostrip.patch b/sci-ml/sentencepiece/files/sentencepiece-0.2.0-nostrip.patch new file mode 100644 index 0000000000000..0cb37fd687f33 --- /dev/null +++ b/sci-ml/sentencepiece/files/sentencepiece-0.2.0-nostrip.patch @@ -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))) diff --git a/sci-ml/sentencepiece/sentencepiece-0.2.0-r3.ebuild b/sci-ml/sentencepiece/sentencepiece-0.2.0-r3.ebuild index c0409ccfc135f..dc440c36b9100 100644 --- a/sci-ml/sentencepiece/sentencepiece-0.2.0-r3.ebuild +++ b/sci-ml/sentencepiece/sentencepiece-0.2.0-r3.ebuild @@ -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 }