From b7022bb8308d1ac9e35e57367a7a38b7c60d7c53 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 5 Dec 2023 16:09:10 +0100 Subject: [PATCH] New package: python3-sabctools-8.2.4 --- srcpkgs/python3-sabctools/patches/cross.patch | 35 +++++++++++++++++++ srcpkgs/python3-sabctools/template | 14 ++++++++ 2 files changed, 49 insertions(+) create mode 100644 srcpkgs/python3-sabctools/patches/cross.patch create mode 100644 srcpkgs/python3-sabctools/template diff --git a/srcpkgs/python3-sabctools/patches/cross.patch b/srcpkgs/python3-sabctools/patches/cross.patch new file mode 100644 index 00000000000..96c3d0c4c42 --- /dev/null +++ b/srcpkgs/python3-sabctools/patches/cross.patch @@ -0,0 +1,35 @@ +--- a/setup.py 2024-07-28 00:42:16.501461696 +0200 ++++ - 2024-07-28 00:51:45.867441942 +0200 +@@ -17,7 +17,6 @@ + + import os + import sys +-import platform + import re + import tempfile + from setuptools import distutils +@@ -73,10 +72,10 @@ + class SABCToolsBuild(build_ext): + def build_extension(self, ext: Extension): + # Try to determine the architecture to build for +- machine = platform.machine().lower() +- IS_X86 = machine in ["i386", "i686", "x86", "x86_64", "x64", "amd64"] ++ xbps_target_machine = os.getenv("XBPS_TARGET_MACHINE") ++ IS_X86 = any(arch in xbps_target_machine for arch in ["i386", "i686", "x86", "x86_64", "x64", "amd64"]) + IS_MACOS = sys.platform == "darwin" +- IS_ARM = machine.startswith("arm") or machine.startswith("aarch64") ++ IS_ARM = any(arch in xbps_target_machine for arch in ["arm", "aarch64"]) + IS_AARCH64 = True + + log.info("==> Baseline detection: ARM=%s, x86=%s, macOS=%s", IS_ARM, IS_X86, IS_MACOS) +@@ -168,8 +167,8 @@ + if IS_X86 and autoconf_check(self.compiler, flag_check="-mno-evex512"): + gcc_avx10_flags = ["-mno-evex512"] + +- if machine.startswith("riscv"): +- arch_flag = "-march=rv" + ("32" if machine.startswith("riscv32") else "64") + "gc" ++ if "riscv" in xbps_target_machine: ++ arch_flag = "-march=rv" + ("32" if "riscv32" in xbps_target_machine else "64") + "gc" + if autoconf_check(self.compiler, flag_check=arch_flag+"v"): + gcc_rvv_flags = [arch_flag+"v"] + if autoconf_check(self.compiler, flag_check=arch_flag+"_zbkc"): diff --git a/srcpkgs/python3-sabctools/template b/srcpkgs/python3-sabctools/template new file mode 100644 index 00000000000..0407756a009 --- /dev/null +++ b/srcpkgs/python3-sabctools/template @@ -0,0 +1,14 @@ +# Template file for 'python3-sabctools' +pkgname=python3-sabctools +version=8.2.4 +revision=1 +build_style=python3-pep517 +hostmakedepends="python3-setuptools python3-wheel" +makedepends="python3-devel" +depends="python3" +short_desc="C implementations of functions for use within SABnzbd" +maintainer="John " +license="GPL-2.0-or-later" +homepage="https://github.com/sabnzbd/sabctools/" +distfiles="${PYPI_SITE}/s/sabctools/sabctools-${version}.tar.gz" +checksum=a8f8bff90fb12e6f9d8e561e4d7c958b7abf475cc4b5780e63bc312e39e9ec4c