From 934d43aaca5b4dbd2ed14c5a94485a6639ddbd18 Mon Sep 17 00:00:00 2001
From: "Tuan M. Hoang" <tmhoang@flatglobe.org>
Date: Sat, 10 Feb 2018 03:15:35 +0000
Subject: [PATCH] testing/[various]: fixes on s390x

need py-numpy   : py-cpuinfo, websockify, py-gnuplot, py-scipy,
                  py-fonttools, py-matplotlib, py-opengl
need openblas   : harminv
no jit support  : texlive
no arch support : tcc, nim, perl-sys-syscall

radare2         : need disabling debugger
thermald        : seems to be intel-only thing
lazperf         : io tests hang
---
 testing/harminv/APKBUILD          | 2 +-
 testing/lazperf/APKBUILD          | 2 +-
 testing/nim/APKBUILD              | 2 +-
 testing/perl-sys-syscall/APKBUILD | 2 +-
 testing/py-cpuinfo/APKBUILD       | 2 +-
 testing/py-fonttools/APKBUILD     | 2 +-
 testing/py-gnuplot/APKBUILD       | 2 +-
 testing/py-matplotlib/APKBUILD    | 2 +-
 testing/py-opengl/APKBUILD        | 2 +-
 testing/py-scipy/APKBUILD         | 2 +-
 testing/radare2/APKBUILD          | 2 ++
 testing/tcc/APKBUILD              | 2 +-
 testing/texlive/APKBUILD          | 2 +-
 testing/thermald/APKBUILD         | 2 +-
 testing/websockify/APKBUILD       | 2 +-
 15 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/testing/harminv/APKBUILD b/testing/harminv/APKBUILD
index ee1c385bb789..cca41dddf554 100644
--- a/testing/harminv/APKBUILD
+++ b/testing/harminv/APKBUILD
@@ -5,7 +5,7 @@ pkgver=1.4.1
 pkgrel=1
 pkgdesc="Free program to solve the problem of harmonic inversion"
 url="https://github.com/stevengj/harminv"
-arch="all"
+arch="all !s390x"
 license="GPL"
 depends_dev="openblas-dev"
 makedepends="$depends_dev gfortran"
diff --git a/testing/lazperf/APKBUILD b/testing/lazperf/APKBUILD
index a272ce56978a..2194a97a08a5 100644
--- a/testing/lazperf/APKBUILD
+++ b/testing/lazperf/APKBUILD
@@ -5,7 +5,7 @@ pkgver=1.1.0
 pkgrel=0
 pkgdesc="Alternative LAZ implementation for C++ and JavaScript"
 url="https://github.com/hobu/laz-perf"
-arch="all !armhf"  # armhf: io_test segfaults
+arch="all !armhf !s390x"  # armhf: io_test segfaults
 license="LGPL-2.0-or-later"
 makedepends="cmake"
 install=""
diff --git a/testing/nim/APKBUILD b/testing/nim/APKBUILD
index 709ea5eb384a..a0575cd3e4c6 100644
--- a/testing/nim/APKBUILD
+++ b/testing/nim/APKBUILD
@@ -7,7 +7,7 @@ pkgver=0.17.2
 pkgrel=1
 pkgdesc="A systems and applications programming language"
 url="https://nim-lang.org/"
-arch="all"
+arch="all !s390x"
 license="MIT"
 checkdepends="sqlite-libs nodejs"
 subpackages="$pkgname-doc nimsuggest niminst"
diff --git a/testing/perl-sys-syscall/APKBUILD b/testing/perl-sys-syscall/APKBUILD
index b1db87687edf..f5f405e3cf17 100644
--- a/testing/perl-sys-syscall/APKBUILD
+++ b/testing/perl-sys-syscall/APKBUILD
@@ -7,7 +7,7 @@ pkgver=0.25
 pkgrel=1
 pkgdesc="Invoke system calls that are otherwise difficult to do from Perl"
 url="http://search.cpan.org/dist/Sys-Syscall/"
-arch="all !aarch64 !ppc64le"
+arch="all !aarch64 !ppc64le !s390x"
 license="GPL PerlArtistic"
 cpandepends=""
 cpanmakedepends=""
diff --git a/testing/py-cpuinfo/APKBUILD b/testing/py-cpuinfo/APKBUILD
index d06bbe40d351..1e42bb313c2f 100644
--- a/testing/py-cpuinfo/APKBUILD
+++ b/testing/py-cpuinfo/APKBUILD
@@ -6,7 +6,7 @@ pkgver=3.3.0
 pkgrel=0
 pkgdesc="A module for getting CPU info"
 url="https://github.com/workhorsy/py-cpuinfo"
-arch="noarch"
+arch="noarch !s390x"
 license="MIT"
 makedepends="python2-dev py-setuptools python3-dev"
 subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
diff --git a/testing/py-fonttools/APKBUILD b/testing/py-fonttools/APKBUILD
index d79737eca514..cf2f034a9a03 100644
--- a/testing/py-fonttools/APKBUILD
+++ b/testing/py-fonttools/APKBUILD
@@ -5,7 +5,7 @@ pkgver=3.21.2
 pkgrel=0
 pkgdesc="Converts OpenType and TrueType fonts to and from XML"
 url="https://github.com/fonttools/fonttools"
-arch="noarch"
+arch="noarch !s390x"
 license="BSD"
 depends="py-numpy"
 makedepends="python2-dev python3-dev py-setuptools"
diff --git a/testing/py-gnuplot/APKBUILD b/testing/py-gnuplot/APKBUILD
index e7a998156ab4..c187c4408063 100644
--- a/testing/py-gnuplot/APKBUILD
+++ b/testing/py-gnuplot/APKBUILD
@@ -6,7 +6,7 @@ pkgver=1.8
 pkgrel=0
 pkgdesc="A Python interface to the gnuplot plotting program."
 url="http://gnuplot-py.sourceforge.net"
-arch="noarch"
+arch="noarch !s390x"
 license="LGPL"
 depends="python2 py-numpy gnuplot"
 depends_dev=""
diff --git a/testing/py-matplotlib/APKBUILD b/testing/py-matplotlib/APKBUILD
index 99425bcf32ca..45e057e3f689 100644
--- a/testing/py-matplotlib/APKBUILD
+++ b/testing/py-matplotlib/APKBUILD
@@ -6,7 +6,7 @@ pkgver=1.5.1
 pkgrel=2
 pkgdesc="A Python library for plots"
 url="http://matplotlib.org"
-arch="all"
+arch="all !s390x"
 license="custom"
 depends="python2 py-numpy python2-tkinter py-dateutil py-parsing py-tz py-cycler"
 makedepends="python2-dev gfortran py-numpy-dev freetype-dev libpng-dev tk-dev
diff --git a/testing/py-opengl/APKBUILD b/testing/py-opengl/APKBUILD
index 174aea8816d2..69566737bae5 100644
--- a/testing/py-opengl/APKBUILD
+++ b/testing/py-opengl/APKBUILD
@@ -6,7 +6,7 @@ pkgver=3.1.1a1
 pkgrel=1
 pkgdesc="Standard OpenGL bindings for Python"
 url="http://pyopengl.sourceforge.net"
-arch="noarch"
+arch="noarch !s390x"
 license="BSD"
 depends="python2 freeglut mesa-gles py-pillow py-numpy"
 depends_dev=""
diff --git a/testing/py-scipy/APKBUILD b/testing/py-scipy/APKBUILD
index 3060a33ba34a..11aa32447107 100644
--- a/testing/py-scipy/APKBUILD
+++ b/testing/py-scipy/APKBUILD
@@ -5,7 +5,7 @@ pkgver=0.19.1
 pkgrel=1
 pkgdesc="Python library for scientific computing"
 url="http://www.scipy.org"
-arch="all"
+arch="all !s390x"
 license="BSD"
 depends="py-numpy-f2py"
 makedepends="python2-dev python3-dev py-setuptools gfortran py-numpy-dev openblas-dev cython-dev"
diff --git a/testing/radare2/APKBUILD b/testing/radare2/APKBUILD
index 4e869da8d1da..d3c94f7200b7 100644
--- a/testing/radare2/APKBUILD
+++ b/testing/radare2/APKBUILD
@@ -20,6 +20,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/radare/$pkgname/archive/${pk
 builddir="$srcdir"/$pkgname-$pkgver
 
 build() {
+	[ "$CARCH" = "s390x" ] && _disable_debugger="--disable-debugger"
 	cd "$builddir"
 	./configure \
 		--build=$CBUILD \
@@ -28,6 +29,7 @@ build() {
 		--sysconfdir=/etc \
 		--mandir=/usr/share/man \
 		--localstatedir=/var \
+		$_disable_debugger \
 		--with-syscapstone \
 		--with-openssl \
 		--with-syszip
diff --git a/testing/tcc/APKBUILD b/testing/tcc/APKBUILD
index c8bde7628e74..046df9eb8a4b 100644
--- a/testing/tcc/APKBUILD
+++ b/testing/tcc/APKBUILD
@@ -7,7 +7,7 @@ _commit=fc0188ffbcf29f856caedee8cef07d88be01e439
 pkgrel=0
 pkgdesc="Tiny C Compiler"
 url="http://repo.or.cz/tinycc.git"
-arch="all !ppc64le"
+arch="all !ppc64le !s390x"
 license="LGPL-2.1"
 makedepends="texinfo"
 options="!check" # test suite currently fails on the server
diff --git a/testing/texlive/APKBUILD b/testing/texlive/APKBUILD
index cb5f837f3e86..b945b737fbf8 100644
--- a/testing/texlive/APKBUILD
+++ b/testing/texlive/APKBUILD
@@ -26,7 +26,7 @@ _xetex="xelatex xelollipop"
 build() {
 	cd "$builddir"
 
-	if [ "$CARCH" = "ppc64le" ] ; then
+	if [ "$CARCH" = "ppc64le" ] || [ "$CARCH" = "s390x" ] ; then
 		EXTRA="--disable-luajittex --disable-mfluajit"
 	fi
 
diff --git a/testing/thermald/APKBUILD b/testing/thermald/APKBUILD
index f525d2eb510f..bd5f12285b4b 100644
--- a/testing/thermald/APKBUILD
+++ b/testing/thermald/APKBUILD
@@ -6,7 +6,7 @@ pkgver=1.6
 pkgrel=0
 pkgdesc="Thermal daemon for IA"
 url="https://github.com/01org/thermal_daemon"
-arch="all !armhf !aarch64"
+arch="all !armhf !aarch64 !s390x"
 license="GPL-2.0"
 depends=""
 makedepends="autoconf automake libtool dbus-glib-dev libxml2-dev linux-headers"
diff --git a/testing/websockify/APKBUILD b/testing/websockify/APKBUILD
index e65bac5ddc20..5557ecdb58fd 100644
--- a/testing/websockify/APKBUILD
+++ b/testing/websockify/APKBUILD
@@ -5,7 +5,7 @@ pkgver=0.8.0
 pkgrel=1
 pkgdesc="WebSockets support for any application/server"
 url="https://github.com/kanaka/websockify"
-arch="noarch"
+arch="noarch !s390x"
 license="LGPL-3.0"
 depends="py2-$pkgname=$pkgver-r$pkgrel py-setuptools py2-numpy"
 makedepends="python2-dev"
-- 
GitLab