uv: build with python builder to include python module

This commit is contained in:
aleksana
2024-05-24 16:49:09 +08:00
parent 2098d845d7
commit 05e3b4fa4d
+14 -2
View File
@@ -3,16 +3,19 @@
, darwin
, fetchFromGitHub
, installShellFiles
, libiconv
, openssl
, pkg-config
, python3Packages
, rustPlatform
, stdenv
, nix-update-script
}:
rustPlatform.buildRustPackage rec {
python3Packages.buildPythonApplication rec {
pname = "uv";
version = "0.1.45";
pyproject = true;
src = fetchFromGitHub {
owner = "astral-sh";
@@ -21,7 +24,7 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-PJeUndpD7jHcpM66dMIyXpDx95Boc01rzovS0Y7io7w=";
};
cargoLock = {
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"async_zip-0.0.17" = "sha256-Q5fMDJrQtob54CTII3+SXHeozy5S5s3iLOzntevdGOs=";
@@ -33,14 +36,19 @@ rustPlatform.buildRustPackage rec {
cmake
installShellFiles
pkg-config
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
buildInputs = [
libiconv
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
dontUseCmakeConfigure = true;
cargoBuildFlags = [ "--package" "uv" ];
# Tests require network access
@@ -58,6 +66,10 @@ rustPlatform.buildRustPackage rec {
--zsh <($out/bin/uv --generate-shell-completion zsh)
'';
pythonImportsCheck = [
"uv"
];
passthru.updateScript = nix-update-script { };
meta = with lib; {