summaryrefslogtreecommitdiffstats
path: root/python/python3-soxr
diff options
context:
space:
mode:
author Jeremy Hansen <jebrhansen+github@gmail.com>2023-07-02 20:15:13 -0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2023-07-08 16:41:54 +0700
commitf79a3415d5ac9d53a640403a5687e6f54891a89b (patch)
treecdff8d4f38adfd115025aace674a01f8e1132f8d /python/python3-soxr
parent76d29b375ae5f55dc1c397f61aa8134df4fc2c4e (diff)
downloadslackbuilds-f79a3415d5ac9d53a640403a5687e6f54891a89b.tar.gz
slackbuilds-f79a3415d5ac9d53a640403a5687e6f54891a89b.tar.xz
python/python3-soxr: Fix builds on i686 and arm.
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/python3-soxr')
-rw-r--r--python/python3-soxr/fix_arm_and_i686.patch59
-rw-r--r--python/python3-soxr/python3-soxr.SlackBuild7
2 files changed, 65 insertions, 1 deletions
diff --git a/python/python3-soxr/fix_arm_and_i686.patch b/python/python3-soxr/fix_arm_and_i686.patch
new file mode 100644
index 0000000000..c3aff84b20
--- /dev/null
+++ b/python/python3-soxr/fix_arm_and_i686.patch
@@ -0,0 +1,59 @@
+From 20c26bb5f8402f12f1a2452a7228c258c64d5b95 Mon Sep 17 00:00:00 2001
+From: dofuuz <dofu@nate.com>
+Date: Wed, 14 Jul 2021 19:15:15 +0900
+Subject: [PATCH] Fix ARM, linux_i686 compile
+
+---
+ .github/workflows/build-dist.yml | 2 +-
+ setup.py | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml
+index 1cccbec..3a406a7 100644
+--- a/.github/workflows/build-dist.yml
++++ b/.github/workflows/build-dist.yml
+@@ -33,7 +33,7 @@ jobs:
+ uses: joerick/cibuildwheel@v1.11.0
+ env:
+ # Skip build errors
+- CIBW_SKIP: "*-manylinux_i686 pp*-macosx_x86_64 pp*-win32"
++ CIBW_SKIP: "pp*-macosx_x86_64 pp*-win32"
+
+ - uses: actions/upload-artifact@v2
+ with:
+diff --git a/setup.py b/setup.py
+index b7b6a85..66f8ff1 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,6 +1,8 @@
+ from setuptools import find_packages
+ from setuptools import setup, Extension
+
++import distutils.util
++
+
+ class CySoxrExtension(Extension):
+ def __init__(self, *args, **kwargs):
+@@ -48,13 +50,21 @@ def include_dirs(self, dirs):
+ 'soxr/cysoxr.pyx'
+ ]
+
++compile_args = ['-DSOXR_LIB']
++platform = distutils.util.get_platform()
++
++if '-arm' in platform or '-aarch' in platform:
++ compile_args.append('-mfpu=neon')
++elif '-i686' in platform:
++ compile_args.append('-msse')
++
+ extensions = [
+ CySoxrExtension(
+ "soxr.cysoxr",
+ src,
+ include_dirs=['libsoxr/src', 'soxr'],
+ language="c",
+- extra_compile_args=['-DSOXR_LIB'])
++ extra_compile_args=compile_args)
+ ]
+
+
diff --git a/python/python3-soxr/python3-soxr.SlackBuild b/python/python3-soxr/python3-soxr.SlackBuild
index d5500d692e..f02dd8dd89 100644
--- a/python/python3-soxr/python3-soxr.SlackBuild
+++ b/python/python3-soxr/python3-soxr.SlackBuild
@@ -27,7 +27,7 @@ PRGNAM=python3-soxr
VERSION=${VERSION:-0.2.4}
SOXRVER=${SOXRVER:-0.1.3}
SRCNAM=${SRCNAM:-python-soxr}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -82,6 +82,11 @@ find -L . \
export SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION
+# Fix builds on i686 and possibly arm
+# Thanks to dofuuz
+# https://github.com/dofuuz/python-soxr/issues/17
+patch -p1 < $CWD/fix_arm_and_i686.patch
+
python3 setup.py install --root=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \