diff options
-rw-r--r-- | python-safetensors.spec | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/python-safetensors.spec b/python-safetensors.spec index 6208d56..ad1dac9 100644 --- a/python-safetensors.spec +++ b/python-safetensors.spec @@ -13,9 +13,8 @@ License: Apache-2.0 URL: https://github.com/huggingface/safetensors Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/safetensors-%{version}.tar.gz -BuildRequires: cmake -BuildRequires: ninja-build -BuildRequires: g++ +BuildRequires: rust +BuildRequires: cargo BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -35,12 +34,24 @@ Summary: %{pkg_summary} %{pkg_description} %prep +# 设置 cargo 镜像源 +mkdir -vp ${CARGO_HOME:-$HOME/.cargo} + +cat << EOF | tee -a ${CARGO_HOME:-$HOME/.cargo}/config +[source.crates-io] +replace-with = 'mirror' + +[source.mirror] +registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git" +EOF %autosetup -p1 -n %{pypi_name}-%{pypi_version} %build +cd ./bindings/python %pyproject_build %install +cd ./bindings/python %pyproject_install %files -n python3-%{pypi_name} |