58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{
|
|
stdenv,
|
|
versionCheckHook,
|
|
lib,
|
|
installShellFiles,
|
|
autoPatchelfHook,
|
|
}:
|
|
stdenv.mkDerivation rec {
|
|
pname = "uv-bin";
|
|
version = "0.5.8";
|
|
|
|
src = fetchTarball {
|
|
url = "https://github.com/astral-sh/uv/releases/download/${version}/uv-x86_64-unknown-linux-gnu.tar.gz";
|
|
sha256 = "1akyn28x8hgyi9l588vcscs7z72g8zhgia1h2jr5d3rrjdnxssrh";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
autoPatchelfHook
|
|
stdenv.cc.cc.lib
|
|
];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp * $out/bin
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
dontAutoPatchelf = true;
|
|
|
|
postFixup = ''
|
|
autoPatchelf -- "$out"
|
|
|
|
export HOME=$TMPDIR
|
|
installShellCompletion --cmd uv \
|
|
--bash <($out/bin/uv --generate-shell-completion bash) \
|
|
--fish <($out/bin/uv --generate-shell-completion fish) \
|
|
--zsh <($out/bin/uv --generate-shell-completion zsh)
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
versionCheckHook
|
|
];
|
|
versionCheckProgramArg = [ "--version" ];
|
|
|
|
meta = {
|
|
description = "Extremely fast Python package installer and resolver, written in Rust";
|
|
homepage = "https://github.com/astral-sh/uv";
|
|
license = with lib.licenses; [
|
|
asl20
|
|
mit
|
|
];
|
|
};
|
|
}
|