New package: python3-sabctools-8.2.4

This commit is contained in:
John 2023-12-05 16:09:10 +01:00 committed by John Zimmermann
parent c541908f55
commit b7022bb830
2 changed files with 49 additions and 0 deletions

View File

@ -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"):

View File

@ -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 <me@johnnynator.dev>"
license="GPL-2.0-or-later"
homepage="https://github.com/sabnzbd/sabctools/"
distfiles="${PYPI_SITE}/s/sabctools/sabctools-${version}.tar.gz"
checksum=a8f8bff90fb12e6f9d8e561e4d7c958b7abf475cc4b5780e63bc312e39e9ec4c