diff --git a/lal.changes b/lal.changes index 6568a8f..a3c4475 100644 --- a/lal.changes +++ b/lal.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Sat Jan 28 06:06:33 UTC 2023 - Stefan Brüns + +- Fix build after numpy 1.24 API changes, add + replace_numpy_object.patch +- Explicitly add python3-py dependency, no longer pulled in by + pytest +- Replace broken python_compileall macro by correct compileall + invocation (>= 3.9 only, skip with 3.8), make reproducible +- Disable build on all architecture where char is unsigned + ------------------------------------------------------------------- Sat Nov 26 02:40:59 UTC 2022 - Stefan Brüns diff --git a/lal.spec b/lal.spec index bb0aff8..4ac096d 100644 --- a/lal.spec +++ b/lal.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package lal # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -45,6 +45,8 @@ URL: https://wiki.ligo.org/Computing/LALSuite Source: https://software.igwn.org/sources/source/lalsuite/lal-%{version}.tar.xz # PATCH-FIX-UPSTREAM -- See https://git.ligo.org/lscsoft/lalsuite/-/commit/847f9f1bf9c8e029db6426de098a963d542ab08b.patch Patch0: swig_4_1_compat.patch +# PATCH-FIX-UPSTREAM -- https://git.ligo.org/lscsoft/lalsuite/-/commit/e4269307540b.patch +Patch1: replace_numpy_object.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy-devel} BuildRequires: %{python_module numpy} @@ -65,7 +67,10 @@ Requires: python-scipy Requires: python-six Recommends: python-ligo-lw Recommends: python-ligo-segments -ExcludeArch: %{ix86} +# Broken on all archs where 'char' is unsigned +# https://git.ligo.org/lscsoft/lalsuite/-/issues/581 +# Also broken on x86 +ExcludeArch: %{ix86} %{arm} %{ppc} aarch64 ppc64 ppc64le riscv64 %if %{with octave} BuildRequires: octave-devel BuildRequires: swig >= 4.0 @@ -77,6 +82,8 @@ BuildRequires: swig >= 3.0 BuildRequires: python3-freezegun BuildRequires: python3-ligo-lw BuildRequires: python3-ligo-segments +# python3-py - remove with next update -- https://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2033 +BuildRequires: python3-py BuildRequires: python3-pytest BuildRequires: python3-python-dateutil BuildRequires: python3-scipy @@ -171,11 +178,27 @@ find %{buildroot} -type f -name "*.la" -delete -print find %{buildroot}%{_libdir} -name "*.a" -delete -print %{python_expand # FIX env HASHBANGS -sed -Ei "1{/^#!\/usr\/bin\/env python/d}" %{buildroot}%{$python_sitearch}/lal/gpstime.py -sed -Ei "1{/^#!\/usr\/bin\/env python/d}" %{buildroot}%{$python_sitearch}/lal/series.py -sed -Ei "1{/^#!\/usr\/bin\/env python/d}" %{buildroot}%{$python_sitearch}/lal/antenna.py +sed -Ei "1{/^#!\/usr\/bin\/env python/d}" \ + %{buildroot}%{$python_sitearch}/lal/{gpstime,series,antenna}.py +rm %{buildroot}%{$python_sitearch}/lal/__pycache__/{gpstime,series,antenna}*.pyc + +# Only compileall >= 3.9 has '-s strip_prefix' option +if [ %{$python_version_nodots} -ge 39 ]; then \ + for d in %{buildroot}%{$python_sitelib} %{buildroot}%{$python_sitearch}; do \ + if [ -d $d ]; then \ + $python -m compileall -s %{buildroot} $d; \ + $python -O -m compileall -s %{buildroot} $d; \ + fi; \ + done \ +fi; +} +# python_compileall is broken, see https://github.com/openSUSE/python-rpm-macros/issues/150 +#%%{?python_compileall} + +%{python_expand # Verify we don't have broken cache files +# "-exec false {} +" makes the return code nonzero on match +find %{buildroot}%{$python_sitearch} -iname \*pyc -type f \( -exec grep 'home/abuild' '{}' \; -and -exec false '{}' \+ \) } -%{?python_compileall} %python_expand %fdupes %{buildroot}%{$python_sitearch}/ %endif diff --git a/replace_numpy_object.patch b/replace_numpy_object.patch new file mode 100644 index 0000000..561f311 --- /dev/null +++ b/replace_numpy_object.patch @@ -0,0 +1,27 @@ +From e4269307540b77ffc015c7be54191cf3350c798b Mon Sep 17 00:00:00 2001 +From: "duncan.macleod" +Date: Tue, 10 Jan 2023 16:30:46 +0000 +Subject: [PATCH] lal: replace numpy.object with builtin object + +numpy.object was a deprecated alias to object, see +https://numpy.org/devdocs/release/1.20.0-notes.html#using-the-aliases-of-builtin-types-like-np-int-is-deprecated +--- + lal/swig/SWIGTestLALPython.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lal/swig/SWIGTestLALPython.py b/lal/swig/SWIGTestLALPython.py +index b634b2c3d7..661c6fecab 100644 +--- a/swig/SWIGTestLALPython.py ++++ b/swig/SWIGTestLALPython.py +@@ -135,7 +135,7 @@ def test_string_conversions(): + strs = ["a", "bc", "def"] + sv = lal.CreateStringVector(*strs) + assert sv.length == 3 +-assert (sv.data.astype(numpy.object) == strs).all() ++assert (sv.data.astype(object) == strs).all() + strs[0] = "ghijk" + sv.data[0] = strs[0] + strs.append("lmnopq") +-- +GitLab +