diff options
Diffstat (limited to 'dev-python/uv')
| -rw-r--r-- | dev-python/uv/Manifest | 2 | ||||
| -rw-r--r-- | dev-python/uv/uv-0.13.4.ebuild | 156 |
2 files changed, 158 insertions, 0 deletions
diff --git a/dev-python/uv/Manifest b/dev-python/uv/Manifest index 944f72f4b4f6..c4a745b045b1 100644 --- a/dev-python/uv/Manifest +++ b/dev-python/uv/Manifest @@ -16,3 +16,5 @@ DIST uv-0.13.1-crates.tar.xz 44234800 BLAKE2B 78e734286467404e4289cff568565e1ef1 DIST uv-0.13.1.gh.tar.gz 8877918 BLAKE2B 43c1726bf6b277b57d154a0bba917cd6762c5dd3e4fbc5293c49372725e12b6980ef34fc44013c68a0956fa9bde368d3a6f45c4e658f27fe98506f22c987a7f2 SHA512 de0bf17d6ddc081e2b3904ed04aeb6ab7e9745880dd2cf78fd9f70e01241d28701246bb2db2b524c76549a0a53af899ad291dec7e957c6a96a344c285c1c4e29 DIST uv-0.13.3-crates.tar.xz 44006060 BLAKE2B f93beea37edc6642d352b1c497cdfbce32e2fc5d7606ebf648c9ad72b1c2a6bd000e9fe3f682794f54fa6c6968559351ddebe29ab4e1dbfc1555f401e0aa994f SHA512 d695cdc1090382cb559665e1c84f5d4f9cc7486437d0de2ac6c71669edc0bdbfa6181b617ca550b0f421ca33db7f308313b2527766f7435e4cf4f8481e769a77 DIST uv-0.13.3.gh.tar.gz 8927836 BLAKE2B f6795d91b43ae3ea8c43b07027f8436c730476355c3e354ed72e9cb92c90e5a9d7480e4c3de008fd9ee317e5c03b257c1e9d6938af48706b530caf5c637a85c7 SHA512 7c91b766ef394fcdf562457516cb6556d29b3a25f84a52f00afd23a4c9399b74a65dec701b13fee06996b77bcec895278683ce1dc967961abd2d46228b8d34cd +DIST uv-0.13.4-crates.tar.xz 44003088 BLAKE2B 671f829d9f64a3f5aa2d1ec7e3f705eadb63529c43f65796a25ef0307f763ce4611f2ee41ee38ffeb19a2eac91d918129be4deb128c6a879c5bcd204862854ea SHA512 94d07b0fa8edbf6364366268be678055125e7baa854c8bc30aaf6721210fc63a1ef0dd5f07e0a511b2cd132f2fcf25690b6c2fa828b97b3893785ed18d40a51e +DIST uv-0.13.4.gh.tar.gz 8930524 BLAKE2B 6db88a4d14037a65f0c2f1a5e98a1a3a6c0697300906af3f753d7ce87320b4086067abe13a60fd335d713f427fc1e2bda7a4917eb1d985daf03aa795672eb188 SHA512 06bc16f6e10b31cbdf1265623990cfe52bc0e040a53edd63b952807b340aec274d412ff7f17111e235596c7f054186fb7024abb0e563f43abb03309df7070f8a diff --git a/dev-python/uv/uv-0.13.4.ebuild b/dev-python/uv/uv-0.13.4.ebuild new file mode 100644 index 000000000000..f2ffd74bfde2 --- /dev/null +++ b/dev-python/uv/uv-0.13.4.ebuild @@ -0,0 +1,156 @@ +# Copyright 2024-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" +" +RUST_MIN_VER="1.97.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+=" + 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 +" +# 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} +" +# git/curl: https://bugs.gentoo.org/984287 +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 + || ( + >=dev-vcs/git-2.57 + <net-misc/curl-8.23 + ) + ) +" + +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 tikv-jemalloc-sys? + + # remove unbundled sources, just in case + find "${ECARGO_VENDOR}"/zstd-sys-*/ -name '*.c' -delete || die +} + +src_configure() { + local myfeatures=( + test-git + test-pypi + test-python + ) + + cargo_src_configure --no-default-features + # otherwise, rustc/llvm runs out of address space + use arm && export RUSTFLAGS="${RUSTFLAGS} -Copt-level=0" +} + +src_compile() { + cd crates/uv || die + cargo_src_compile +} + +src_test() { + cd crates/uv || die + cargo_src_test --no-fail-fast +} + +src_install() { + dobin "$(cargo_target_dir)"/{uv,uvx} + + 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 +} |
