diff --git a/dev-python/uv/Manifest b/dev-python/uv/Manifest index e9ab08d769c5a..7e80be454f3e9 100644 --- a/dev-python/uv/Manifest +++ b/dev-python/uv/Manifest @@ -1,5 +1,7 @@ DIST uv-0.10.0-crates.tar.xz 40475984 BLAKE2B 8146350fd684ac9aeadda44142b8fb0b0dd8652530de27b61100178c7095a2bd75ea4005b120dc978c468e0f896fe4a7d54ee38d86754c9e05648e05c5358ce2 SHA512 8ce9f23b552ff002b52e74ae85638b5ac139341a3045f35c4721e339590c2edc96e09614718d1278b39ea4661f36e6d1598f2b892b7e41961bb131c7352bfff1 DIST uv-0.10.0.gh.tar.gz 4924383 BLAKE2B 957a9ab408ad5f07416a76a97f23d0bb41b22a1d1ebffc6a84e41c382b8cf271094bce08be19d5649fd9866d22c75619c3561b79659c65c99fa45ea318b6bf95 SHA512 84bf1ecfa730cbb4fe4c602dba3ef3d58bf070472cde5f160291fabfdd7630fd8dcbb45b10e7abcb00db6898d5cefa8ac616c68dfa56bb15640ce6211caff51d +DIST uv-0.10.10-crates.tar.xz 41709176 BLAKE2B b37f5b1f94c697866885418071c268fe9ff9fa3585000b8a64fab5aa86054b1f2386f0629b5d6213f13a4a0974cd730be17ebf56d1674cce5b563c5fe3ce2d2e SHA512 b4c1914e0a9ed398e1544a80e053c49f2e38a75778e86e881710acdfb758159b1f521538876a5120c8561c0b370da9d797f4c58bccefb2ee6a6bc829e1cd5eff +DIST uv-0.10.10.gh.tar.gz 5085650 BLAKE2B 98a1a3d9cef9f54977a9da42bd02b163185ca4181f0f7c73b09a3d3c2a7fe600f9ee65fa6e9f792bcaa6ea1676480e82c2aeda89719115214095a7937b40b069 SHA512 b95ad2534ecc57f2a4e4235d632c006283cdf0ccb8c629be880f45137cbc17ed2ee3b0a6459bbedc0603ee9b044044495a67752c549daabd9e49484afc343635 DIST uv-0.10.2-crates.tar.xz 40488272 BLAKE2B 7b60ce55ac335b4f22c14e4029451e5931a52d2fbd2342d53d444a84ea50383ba79c5152b0f394d49937dd5e0d7449f92bf69fd6a32e3509f682403533eb9f8b SHA512 7fdac474d6b6cbd4ff22e40396b47edcf050ace6d7d74885c90e6833169ba2051d392b2f70f7a8dc9d12cecb7fc81102a556c5b5510cd678be996a3e90ff2e08 DIST uv-0.10.2.gh.tar.gz 4927786 BLAKE2B bdbc9014a9362121205f12046eea0999838c9a72bf6d3cb347c51c13f92cb7b5b4524b4abcc81caac297645f2863e577981b033a4ee6a29166cd818aec06a6ad SHA512 7592217ce76cd0a418a4979df045890e215c5bcff53d18e34924e0d57ec388fc8ce56b3fdc7ee473f131de5d04a4349b1dbb9d5a585493a0cd9a22dfd51e9cfc DIST uv-0.10.3-crates.tar.xz 40664424 BLAKE2B 78f8834b7f78b74448d77dbb9e12f31c472561e8104fee73fdd70b449818b2deaa6e6600ffec1e65b533fa1b39c3703f43a71996e90036b4e045c1ec786184f0 SHA512 e79f416a6afc01cafca081e34759ee3f873239f321a17147b1ee1badbb22289feea29d003da79ca2274ef151f4f42947be4675182be4912a9590ee7f84a9165d diff --git a/dev-python/uv/uv-0.10.10.ebuild b/dev-python/uv/uv-0.10.10.ebuild new file mode 100644 index 0000000000000..ea2607714c56a --- /dev/null +++ b/dev-python/uv/uv-0.10.10.ebuild @@ -0,0 +1,164 @@ +# Copyright 2024-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" +" +RUST_MIN_VER="1.92.0" + +inherit cargo check-reqs + +CRATE_PV=${PV} +DESCRIPTION="A Python package installer and resolver, written in Rust" +HOMEPAGE=" + https://github.com/astral-sh/uv/ + https://pypi.org/project/uv/ +" +# pypi sdist misses scripts/, needed for tests +SRC_URI=" + https://github.com/astral-sh/uv/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz + ${CARGO_CRATE_URIS} +" +if [[ ${PKGBUMPING} != ${PVR} ]]; then + SRC_URI+=" + https://github.com/gentoo-crate-dist/uv/releases/download/${CRATE_PV}/uv-${CRATE_PV}-crates.tar.xz + " +fi + +# most of the code +LICENSE="|| ( Apache-2.0 MIT )" +# crates/pep508-rs is || ( Apache-2.0 BSD-2 ) which is covered below +# Dependent crate licenses +LICENSE+=" + 0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD CC0-1.0 + CDLA-Permissive-2.0 ISC MIT MPL-2.0 Unicode-3.0 Unicode-DFS-2016 + ZLIB BZIP2 +" +# ring crate +LICENSE+=" openssl" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86" +IUSE="test" +RESTRICT="test" +PROPERTIES="test_network" + +DEPEND=" + app-arch/bzip2:= + app-arch/xz-utils:= + app-arch/zstd:= +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + virtual/pkgconfig + test? ( + dev-lang/python:3.9 + dev-lang/python:3.10 + dev-lang/python:3.11 + dev-lang/python:3.12 + dev-lang/python:3.13 + !!~dev-python/uv-0.5.0 + ) +" + +QA_FLAGS_IGNORED="usr/bin/.*" + +check_space() { + local CHECKREQS_DISK_BUILD=3G + use debug && CHECKREQS_DISK_BUILD=9G + check-reqs_pkg_setup +} + +pkg_pretend() { + check_space +} + +pkg_setup() { + check_space + rust_pkg_setup +} + +src_prepare() { + default + + # force thin lto, makes build much faster and less memory hungry + # (i.e. makes it possible to actually build uv on 32-bit PPC) + sed -i -e '/lto/s:fat:thin:' Cargo.toml || die + + # enable system libraries where supported + export ZSTD_SYS_USE_PKG_CONFIG=1 + # TODO: unbundle libz-ng-sys, tikv-jemalloc-sys? + + # remove unbundled sources, just in case + find "${ECARGO_VENDOR}"/{bzip2,lzma,zstd}-sys-*/ -name '*.c' -delete || die + + # bzip2-sys requires a pkg-config file + # https://github.com/alexcrichton/bzip2-rs/issues/104 + mkdir "${T}/pkg-config" || die + export PKG_CONFIG_PATH=${T}/pkg-config${PKG_CONFIG_PATH+:${PKG_CONFIG_PATH}} + cat >> "${T}/pkg-config/bzip2.pc" <<-EOF || die + Name: bzip2 + Version: 9999 + Description: + Libs: -lbz2 + EOF + + # uv is now forcing bundled liblzma, sigh + sed -i -e '/xz/s:"static"::' Cargo.toml || die +} + +src_configure() { + local myfeatures=( + test-git + test-pypi + test-python + ) + + cargo_src_configure --no-default-features +} + +src_compile() { + cd crates/uv || die + cargo_src_compile +} + +src_test() { + cd crates/uv || die + cargo_src_test --no-fail-fast +} + +src_install() { + cd crates/uv || die + cargo_src_install + + insinto /etc/xdg/uv + newins - uv.toml <<-EOF || die + # These defaults match Fedora, see: + # https://src.fedoraproject.org/rpms/uv/pull-request/18 + + # By default ("automatic"), uv downloads missing Python versions + # automatically and keeps them in the user's home directory. + # Disable that to make downloading opt-in, and especially + # to avoid unnecessarily fetching custom Python when the distro + # package would be preferable. Python builds can still be + # downloaded manually via "uv python install". + # + # https://docs.astral.sh/uv/reference/settings/#python-downloads + python-downloads = "manual" + + # By default ("managed"), uv always prefers self-installed + # Python versions over the system Python, independently + # of versions. Since we generally expect users to use that + # to install old Python versions not in ::gentoo anymore, + # this effectively means that uv would end up preferring very + # old Python versions over the newer ones that are provided + # by the system. Default to using the system versions to avoid + # this counter-intuitive behavior. + # + # https://docs.astral.sh/uv/reference/settings/#python-preference + python-preference = "system" + EOF +}