Accepting request 841790 from home:Guillaume_G:branches:openSUSE:Factory:ARM

- Fix aarch64 build and test:
  * sherpa-fix-aarch64.patch

OBS-URL: https://build.opensuse.org/request/show/841790
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-sherpa?expand=0&rev=11
This commit is contained in:
Tomáš Chvátal 2020-10-15 08:08:32 +00:00 committed by Git OBS Bridge
parent 9af53e5796
commit 2e12bdc119
3 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 14 13:39:10 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Fix aarch64 build and test:
* sherpa-fix-aarch64.patch
-------------------------------------------------------------------
Mon Sep 14 09:33:07 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com>

View File

@ -26,6 +26,8 @@ License: GPL-3.0-only
URL: https://github.com/sherpa/sherpa/
Source: https://github.com/sherpa/sherpa/archive/%{version}.tar.gz#/sherpa-%{version}.tar.gz
Patch1: reproducible.patch
# PATCH-FIX-UPSTREAM - https://github.com/sherpa/sherpa/issues/970
Patch2: sherpa-fix-aarch64.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module setuptools}

25
sherpa-fix-aarch64.patch Normal file
View File

@ -0,0 +1,25 @@
diff -purN sherpa-4.12.1.orig/sherpa/utils/src/cephes/mconf.h sherpa-4.12.1/sherpa/utils/src/cephes/mconf.h
--- sherpa-4.12.1.orig/sherpa/utils/src/cephes/mconf.h 2020-06-26 20:27:19.000000000 +0200
+++ sherpa-4.12.1/sherpa/utils/src/cephes/mconf.h 2020-10-14 14:44:53.565068804 +0200
@@ -173,6 +173,10 @@ typedef struct
/* Define to support tiny denormal numbers, else undefine. */
#define DENORMAL 1
+/* https://github.com/sherpa/sherpa/issues/970 */
+#define NOINFINITIES
+#define NONANS
+
/* Define to ask for infinity support, else undefine. */
#define INFINITIES 1
#ifdef NOINFINITIES
--- sherpa-4.12.1.orig/sherpa/tests/test_fit_unit.py 2020-06-26 20:27:19.000000000 +0200
+++ sherpa-4.12.1/sherpa/tests/test_fit_unit.py 2020-10-14 15:08:34.798995079 +0200
@@ -1867,7 +1867,7 @@ def test_fit_single(stat, usestat, usesy
assert fit.method.name == 'levmar'
fr = fit.fit()
assert fr.succeeded
- assert_almost_equal(fr.statval, finalstat)
+ assert fr.statval == pytest.approx(finalstat, rel=7e-5)
@pytest.mark.parametrize("stat,usestat,usesys,finalstat", [