From 1b268dd6890d46e01faf7405ac7a874cf48bc218 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sun, 14 Apr 2024 07:29:10 +0000 Subject: automatic import of python-safetensors --- python-safetensors.spec | 17 ++++++++++++++--- 1 file 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} -- cgit v1.2.3