diff --git a/python-uv.changes b/python-uv.changes index d80d8f1..ab953df 100644 --- a/python-uv.changes +++ b/python-uv.changes @@ -90,6 +90,12 @@ Sat Sep 21 16:04:19 UTC 2024 - Soc Virnyl Estela * Avoid treating `.whl` sources as source distributions * Clarify Python requirement source for script incompatibilities +------------------------------------------------------------------- +Fri Sep 13 11:11:48 UTC 2024 - Soc Virnyl Estela + +- Attempt to use clang+mold for faster and less memory intensive linking + * fallback to ld and gcc if leap. + ------------------------------------------------------------------- Fri Sep 13 07:12:55 UTC 2024 - Adrian Schröter diff --git a/python-uv.spec b/python-uv.spec index 511bb52..1dd700d 100644 --- a/python-uv.spec +++ b/python-uv.spec @@ -20,6 +20,16 @@ %global force_gcc_version 13 %endif +%if 0%{?suse_version} > 1600 +%bcond_without mold +%else +%bcond_with mold +%endif + +%if %{with mold} +%global build_rustflags "-C" "linker=clang" "-C" "link-arg='-fuse-ld=/usr/bin/mold -Wl,-z,relro,-z,now'" "-C" "debuginfo=2" "-C" "incremental=false" "-C" "strip=none" +%endif + %bcond_without libalternatives %{?sle15_python_module_pythons} Name: python-uv @@ -38,7 +48,17 @@ BuildRequires: cargo >= 1.80 BuildRequires: cargo-packaging BuildRequires: cmake BuildRequires: fdupes -BuildRequires: gcc%{?force_gcc_version}-c++ +%if 0%{?suse_version} > 1600 +BuildRequires: c++_compiler +BuildRequires: c_compiler +BuildRequires: clang +BuildRequires: mold +%else +BuildRequires: gcc13 +BuildRequires: gcc13-c++ +BuildRequires: libstdc++6-devel-gcc13 +%endif +BuildRequires: cargo >= 1.80 BuildRequires: python-rpm-macros BuildRequires: zstd Obsoletes: uv < %{version} @@ -86,6 +106,10 @@ drop-in replacement for common pip and pip-tools workflows. %autosetup -p1 -a1 -n uv-%{version} %build +export CARGO_AUDITABLE="auditable" +export CARGO_INCREMENTAL=0 +export CARGO_FEATURE_VENDORED=1 +export RUSTFLAGS="%build_rustflags" export CARGO_NET_OFFLINE=true %ifarch %rust_tier1_arches export CARGO_PROFILE_RELEASE_DEBUG=full @@ -101,12 +125,24 @@ export CXX="g++-%{?force_gcc_version}" %pyproject_wheel %install +export PATH="%{buildroot}%{_bindir}:${PATH}" +mkdir -p %{buildroot}%{_datadir}/bash-completion/completions +mkdir -p %{buildroot}%{_datadir}/fish/vendor_completions.d +mkdir -p %{buildroot}%{_datadir}/zsh/site-functions +export CARGO_AUDITABLE="auditable" +export CARGO_INCREMENTAL=0 +export CARGO_FEATURE_VENDORED=1 +export RUSTFLAGS="%build_rustflags" export CARGO_NET_OFFLINE=true %ifarch %rust_tier1_arches export CARGO_PROFILE_RELEASE_DEBUG=full %else export CARGO_PROFILE_RELEASE_DEBUG=limited %endif +%if 0%{?force_gcc_version} +export CC="gcc-%{?force_gcc_version}" +export CXX="g++-%{?force_gcc_version}" +%endif export CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO=off export CARGO_PROFILE_RELEASE_STRIP=false %pyproject_install @@ -116,21 +152,12 @@ export CARGO_PROFILE_RELEASE_STRIP=false %python_clone -a %{buildroot}%{_bindir}/uvx %python_group_libalternatives uvx -export PATH="%{buildroot}%{_bindir}:${PATH}" -mkdir -p %{buildroot}%{_datadir}/bash-completion/completions -mkdir -p %{buildroot}%{_datadir}/fish/vendor_completions.d -mkdir -p %{buildroot}%{_datadir}/zsh/site-functions -%{python_expand # add whitespace when using this macro so it works so putting random comment for that - uv-%{$python_bin_suffix} --generate-shell-completion bash > %{buildroot}%{_datadir}/bash-completion/completions/uv-%{$python_bin_suffix} - uv-%{$python_bin_suffix} --generate-shell-completion fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/uv-%{$python_bin_suffix}.fish - uv-%{$python_bin_suffix} --generate-shell-completion zsh > %{buildroot}%{_datadir}/zsh/site-functions/_uv-%{$python_bin_suffix} -} - -%{python_expand - uvx-%{$python_bin_suffix} --generate-shell-completion bash > %{buildroot}%{_datadir}/bash-completion/completions/uvx-%{$python_bin_suffix} - uvx-%{$python_bin_suffix} --generate-shell-completion fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/uvx-%{$python_bin_suffix}.fish - uvx-%{$python_bin_suffix} --generate-shell-completion zsh > %{buildroot}%{_datadir}/zsh/site-functions/_uvx-%{$python_bin_suffix} -} +%python_expand uv-%{$python_bin_suffix} --generate-shell-completion bash > %{buildroot}%{_datadir}/bash-completion/completions/uv-%{$python_bin_suffix} +%python_expand uv-%{$python_bin_suffix} --generate-shell-completion fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/uv-%{$python_bin_suffix}.fish +%python_expand uv-%{$python_bin_suffix} --generate-shell-completion zsh > %{buildroot}%{_datadir}/zsh/site-functions/_uv-%{$python_bin_suffix} +%python_expand uv-%{$python_bin_suffix} tool uvx --generate-shell-completion bash > %{buildroot}%{_datadir}/bash-completion/completions/uvx-%{$python_bin_suffix} +%python_expand uv-%{$python_bin_suffix} tool uvx --generate-shell-completion fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/uvx-%{$python_bin_suffix}.fish +%python_expand uv-%{$python_bin_suffix} tool uvx --generate-shell-completion zsh > %{buildroot}%{_datadir}/zsh/site-functions/_uvx-%{$python_bin_suffix} %pre %python_libalternatives_reset_alternative uv