From 063c0859736e0f358c4c0fd287d7afec328d6c3e Mon Sep 17 00:00:00 2001 From: misaka00251 Date: Mon, 23 Dec 2024 18:40:24 +0800 Subject: [PATCH] Use patch macro instead of patch command --- tensorflow.spec | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tensorflow.spec b/tensorflow.spec index ac923a0..c7b91d2 100644 --- a/tensorflow.spec +++ b/tensorflow.spec @@ -1,7 +1,7 @@ %global _empty_manifest_terminate_build 0 Name: tensorflow Version: 2.12.1 -Release: 2 +Release: 3 Summary: An Open Source Machine Learning Framework for Everyone License: Apache License 2.0 URL: https://www.tensorflow.org/ @@ -9,10 +9,14 @@ Source0: https://github.com/tensorflow/tensorflow/archive/v%{version}.tar Source1: external.tar.bz2.partaa Source2: external.tar.bz2.partab Source3: external.tar.bz2.partac -Source4: aarch64_external_files.patch -Source5: riscv64_external_files.patch Patch0: modify-deps-on-libclang-gcsfs-gast.patch Patch1: fix-boringssl-compile.patch +%ifarch aarch64 +Patch1000: aarch64_external_files.patch +%endif +%ifarch riscv64 +Patch1100: riscv64_external_files.patch +%endif Requires: python3-future python3-numpy python3-six python3-astunparse python3-google-pasta python3-opt-einsum Requires: python3-typing-extensions python3-wrapt python3-h5py python3-protobuf python3-grpcio python3-absl-py Requires: python3-flatbuffers python3-gast @@ -39,17 +43,19 @@ TensorFlow was originally developed by researchers and engineers working on the TensorFlow provides stable Python and C++ APIs, as well as non-guaranteed backward compatible API for other languages. %prep -%autosetup -p1 +%setup -n %{name}-%{version} +%patch 0 -p1 +%patch 1 -p1 extdir=$(bazel --output_user_root=`pwd`/../output_user_root info output_base) mkdir -p ${extdir} instdir=$(bazel --output_user_root=`pwd`/../output_user_root info install_base) cat %{SOURCE1} %{SOURCE2} %{SOURCE3} > external.tar.bz2 tar xf external.tar.bz2 -C ${extdir} %ifarch aarch64 -patch -d ${extdir} -p0 < %{SOURCE4} +%patch 1000 -p0 -d ${extdir} %endif %ifarch riscv64 -patch -d ${extdir} -p0 < %{SOURCE5} +%patch 1100 -p0 -d ${extdir} %endif ln -sfn ${instdir}/embedded_tools ${extdir}/external/bazel_tools for f in $(find $extdir/external -lname "*/external/*"); do OLDLINK=$(readlink $f); echo $OLDLINK; NEWLINK=${extdir}/external/${OLDLINK#*external}; ln -sf $NEWLINK $f-newlink; mv -Tf $f-newlink $f; done @@ -76,6 +82,9 @@ bazel --output_user_root=`pwd`/../output_user_root build --nofetch --host_copt=- %{_bindir}/* %changelog +* Mon Dec 23 2024 misaka00251 - 2.12.1-3 +- Use patch macro instead of patch command + * Thu Dec 12 2024 Dingli Zhang - 2.12.1-2 - Add support for riscv64 -- Gitee