commit:     f7adbdf82e5916dbad4b53e415ac66bceb0fd938
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Fri Mar  1 03:40:08 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 14 06:39:44 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7adbdf8

dev-util/ruff: cut down on number of programs built / installed

It is neither necessary nor desirable to compile and install every
conceivable crate in the ruff source code.

- ruff_dev is "an internal CLI for developers of Ruff"
- ruff_python_formatter is just the source code for `ruff format`, but
  compiled standalone with a barebones main.rs for faster dev iteration
- libruff_wasm.so exists solely to implement https://play.ruff.rs which
  would matter if we were packaging www-apps/ruff, or if we were using
  `--target web`, neither of which is true
- libruff_macros.so is an internal proc-macro and it makes no sense that
  it should build a .so to begin with...

We only care about two things:

- ruff, the cli program
- ruff_shrinking, which is a debug tool for producing minimal testcases
  of an issue. It is theoretically useful, so can't hurt to distribute.

 *  FILES:-usr/bin/ruff_dev
 *  FILES:-usr/bin/ruff_python_formatter
 *  FILES:-usr/lib64/libruff_macros.so
 *  FILES:-usr/lib64/libruff_wasm.so
 *  SONAME:-libruff_macros.so(64)
 *  SONAME:-libruff_wasm.so(64)
 *   SIZE: 77.00MiB -> 37.74MiB, 33 -> 29 files
 * ------> FILES(-4) SONAME(-2) SIZE(-50.99%)

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/ruff/ruff-0.3.0-r1.ebuild | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/dev-util/ruff/ruff-0.3.0-r1.ebuild 
b/dev-util/ruff/ruff-0.3.0-r1.ebuild
index abcdb9b15d4c..4129d7112c39 100644
--- a/dev-util/ruff/ruff-0.3.0-r1.ebuild
+++ b/dev-util/ruff/ruff-0.3.0-r1.ebuild
@@ -395,11 +395,10 @@ SLOT="0"
 KEYWORDS="~amd64 ~loong"
 
 BDEPEND="
-       dev-util/patchelf
        >=virtual/rust-1.71
 "
 
-QA_FLAGS_IGNORED="usr/bin/.* usr/lib.*/libruff.*.so"
+QA_FLAGS_IGNORED="usr/bin/.*"
 
 PATCHES=(
        "${FILESDIR}/ruff-0.1.14-tests.patch"
@@ -421,15 +420,11 @@ src_configure() {
 }
 
 src_compile() {
-       cargo_src_compile
+       cargo_src_compile --bin ruff --bin ruff_shrinking
 
-       local solib releasedir
+       local releasedir
        releasedir=target/$(usex 'debug' 'debug' 'release')
 
-       for solib in "target/$(usex 'debug' 'debug' 'release')"/*.so; do
-               patchelf --set-soname "${solib##*/}" "${solib}" || die
-       done
-
        ${releasedir}/ruff generate-shell-completion bash > 
ruff-completion.bash || die
        ${releasedir}/ruff generate-shell-completion zsh > ruff-completion.zsh 
|| die
 }
@@ -441,8 +436,7 @@ src_test() {
 src_install() {
        local releasedir=target/$(usex 'debug' 'debug' 'release')
 
-       dobin ${releasedir}/ruff{,_{dev,python_formatter,shrinking}}
-       dolib.so "${releasedir}"/*.so
+       dobin ${releasedir}/ruff{,_shrinking}
 
        newbashcomp ruff-completion.bash ruff
        newzshcomp ruff-completion.zsh _ruff

Reply via email to