summaryrefslogtreecommitdiff
path: root/dev-util/pixi/pixi-0.80.0.ebuild
blob: 8913b7bf42ccbe98a1c76a7d61a1eb956d6af7c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

RUST_MIN_VER="1.95.0"
CRATES="
"

declare -A GIT_CRATES=(
	[uv-auth]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-auth'
	[uv-build-backend]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-build-backend'
	[uv-build-frontend]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-build-frontend'
	[uv-cache-info]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-cache-info'
	[uv-cache-key]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-cache-key'
	[uv-cache]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-cache'
	[uv-client]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-client'
	[uv-configuration]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-configuration'
	[uv-console]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-console'
	[uv-dirs]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-dirs'
	[uv-dispatch]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-dispatch'
	[uv-distribution-filename]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-distribution-filename'
	[uv-distribution-types]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-distribution-types'
	[uv-distribution]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-distribution'
	[uv-extract]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-extract'
	[uv-fastid]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-fastid'
	[uv-flags]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-flags'
	[uv-fs]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-fs'
	[uv-git-types]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-git-types'
	[uv-git]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-git'
	[uv-globfilter]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-globfilter'
	[uv-install-wheel]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-install-wheel'
	[uv-installer]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-installer'
	[uv-keyring]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-keyring'
	[uv-macros]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-macros'
	[uv-metadata]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-metadata'
	[uv-netrc]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-netrc'
	[uv-normalize]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-normalize'
	[uv-once-map]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-once-map'
	[uv-options-metadata]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-options-metadata'
	[uv-pep440]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-pep440'
	[uv-pep508]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-pep508'
	[uv-platform-tags]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-platform-tags'
	[uv-platform]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-platform'
	[uv-preview]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-preview'
	[uv-pypi-types]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-pypi-types'
	[uv-python]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-python'
	[uv-redacted]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-redacted'
	[uv-requirements-txt]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-requirements-txt'
	[uv-requirements]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-requirements'
	[uv-resolver]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-resolver'
	[uv-scripts]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-scripts'
	[uv-settings]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-settings'
	[uv-shell]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-shell'
	[uv-small-str]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-small-str'
	[uv-state]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-state'
	[uv-static]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-static'
	[uv-toml]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-toml'
	[uv-torch]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-torch'
	[uv-trampoline-builder]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-trampoline-builder'
	[uv-types]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-types'
	[uv-version]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-version'
	[uv-virtualenv]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-virtualenv'
	[uv-warnings]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-warnings'
	[uv-windows]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-windows'
	[uv-workspace]='https://github.com/astral-sh/uv;3cffe97c2e48c9e49422c738da3af95919dd0bf5;uv-%commit%/crates/uv-workspace'
	[version-ranges]='https://github.com/astral-sh/pubgrub;d8efd77673c9a90792da9da31b6c0da7ea8a324b;pubgrub-%commit%/version-ranges'
)

inherit cargo multiprocessing

CRATE_P=${P}
DESCRIPTION="A package management and workflow tool"
HOMEPAGE="
	https://pixi.prefix.dev/
	https://github.com/prefix-dev/pixi/
"
SRC_URI="
	https://github.com/prefix-dev/pixi/releases/download/v${PV}/source.tar.gz
		-> ${P}.tar.gz
	${CARGO_CRATE_URIS}
	https://github.com/gentoo-crate-dist/pixi/releases/download/v${PV}/${P}-crates.tar.xz
"

LICENSE="BSD"
# Dependent crate licenses
LICENSE+="
	0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD Boost-1.0
	CC0-1.0 CDLA-Permissive-2.0 ISC MIT MIT-0 MPL-2.0 Unicode-3.0 ZLIB
	BZIP2
"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+rustls test"
RESTRICT="test"
PROPERTIES="test? ( test_network )"

RDEPEND="
	app-arch/bzip2:=
	app-arch/xz-utils:=
	app-arch/zstd:=
	sys-apps/dbus
	!rustls? ( dev-libs/openssl:= )
"
BDEPEND="
	test? ( dev-util/cargo-nextest )
"

QA_PREBUILT="usr/bin/pixi"

src_prepare() {
	default

	# replace upstream crate substitution with our crate substitution, sigh
	local pkg
	for pkg in version-ranges; do
		local dep=$(grep "^${pkg}" "${ECARGO_HOME}"/config.toml || die)
		sed -i -e "/\[patch\.crates-io\]/,\$s;^${pkg}.*$;${dep};" Cargo.toml || die
	done

}

src_configure() {
	local myfeatures=(
		$(usex rustls rustls native-tls)
	)
	cargo_src_configure --no-default-features

	export ZSTD_SYS_USE_PKG_CONFIG=1

	# 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 forcing bundled liblzma, sigh
	sed -i -e '/xz/s:"static"::' "${WORKDIR}"/uv-*/Cargo.toml || die

	# rattler-build is forcing bundled libdbus
	sed -i -e '/"vendored"/d' -e 's:"crypto-rust":"crypto-openssl":' \
		"${ECARGO_VENDOR}"/rattler_networking-*/Cargo.toml || die
}

src_test() {
	# tests use it to test preserving envvars, apparently assuming
	# it will be always set
	local -x USER=${USER}
	local -x NEXTEST_TEST_THREADS="$(makeopts_jobs)"
	set -- cargo nextest run --verbose --no-fail-fast \
		"${ECARGO_ARGS[@]}" $(usev !debug '--release')
	echo "${@@Q}" >&2
	"${@}" || die "cargo nextest failed"
}

src_install() {
	dobin "$(cargo_target_dir)/pixi"
}