From c2d36a9a668aaf7796cf086d23163bcdc116546e853b0db352d553eac6905d88 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 5 Jan 2022 12:58:20 +0000 Subject: [PATCH] Accepting request 944031 from home:bnavigator:branches:X11:wxWidgets - Reduce complexity by not rewriting subpackages at all. Multibuild flavors now must be a superset of all existing python3 flavors. - The difference of a single whitespace character is significant OBS-URL: https://build.opensuse.org/request/show/944031 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=31 --- python-wxPython.changes | 12 +++ python-wxPython.spec | 160 +++++++++++++++------------------------- 2 files changed, 70 insertions(+), 102 deletions(-) diff --git a/python-wxPython.changes b/python-wxPython.changes index 0ede1ba..9ff20e6 100644 --- a/python-wxPython.changes +++ b/python-wxPython.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Wed Jan 5 11:12:25 UTC 2022 - Ben Greiner + +- Reduce complexity by not rewriting subpackages at all. + Multibuild flavors now must be a superset of all existing + python3 flavors. + +------------------------------------------------------------------- +Tue Jan 4 22:28:51 UTC 2022 - Ben Greiner + +- The difference of a single whitespace character is significant + ------------------------------------------------------------------- Tue Jan 4 13:58:38 UTC 2022 - Ben Greiner diff --git a/python-wxPython.spec b/python-wxPython.spec index 9fc79e0..04b2170 100644 --- a/python-wxPython.spec +++ b/python-wxPython.spec @@ -26,17 +26,21 @@ %endif %global flavor @BUILD_FLAVOR@%{nil} +%if "%flavor" == "" +# factory-auto requires the main build_flavor to match the specfile name %define pprefix python -%define psuffix %{nil} -%if 0%{suse_version} >= 1550 -# Tumbleweed has a varying number of python3 flavors. Ideally, the flavor -# selection here and in _multibuild is in sync with the Factory prjconf -# definition for pythons, but if it is not, we build missing flavors in -other -# and do not build flavors which are not yet or not anymore in the buildset. +%define python_module() no-build-without-multibuild-flavor +ExclusiveArch: donotbuild +%else %define pprefix %flavor -%define psuffix -mb -%if "%flavor" != "python36" || %{with test} -# No numpy for Python 3.6 +%if 0%{suse_version} >= 1599 +# Tumbleweed has a varying number of python3 flavors. The flavor +# selection here and in _multibuild must be kept in sync with the Factory +# prjconf definition for pythons. If a skip is missing, all builds fail. +# Extraneous build_flavors and skips are excluded automatically so future +# additions can be included here early and old flavors can be removed some time +# after the global drop in Factory. +%if "%flavor" != "python36" %define skip_python36 1 %endif %if "%flavor" != "python38" @@ -48,31 +52,30 @@ %if "%flavor" != "python310" %define skip_python310 1 %endif -%if "%flavor" == "" -%define pprefix python -%define psuffix -other +%else +# SLE/Leap: python3 only +%if "%flavor" != "python3" +%define pythons %{nil} +%else +%define pythons python3 +%define python3_provides %{nil} +%endif %endif # The obs server-side interpreter cannot use lua or rpm shrink -%if "%pythons" == "" || "%pythons" == " " || "%pythons" == " " || "%pythons" == " " || "%flavor" == "python3" +%if "%pythons" == "" || "%pythons" == " " || "%pythons" == " " || "%pythons" == " " || "%pythons" == " " ExclusiveArch: donotbuild -%define python_module() all-python-flavors-skipped-in-flavorless-multibuild -%endif +%define python_module() %flavor-not-enabled-in-buildset-for-suse-%{?suse_version} %else -# The SLE/Leap python3 package is built without subpackage rewriting in its own flavor -%if "%flavor" == "python3" -%define pprefix python3 -%define pythons python3 -%define python_files() -n python3-%{**} -%define python_module() python3-%{**} -%define python_version %python3_version -%define python_sitearch %python3_sitearch -%else -ExclusiveArch: donotbuild +%define python_files() -n %flavor-%{**} +%define python_module() %flavor-%{**} +%define python_exec python%{expand:%%%{flavor}_bin_suffix} +%define python_version %{expand:%%%{flavor}_version} +%define python_sitearch %{expand:%%%{flavor}_sitearch} +%define python_provides %{expand:%%%{flavor}_provides} %endif %endif -%define plainpython python -Name: %{pprefix}-wxPython%{psuffix} +Name: %{pprefix}-wxPython Version: 4.1.1 Release: 0 Summary: The "Phoenix" variant of the wxWidgets Python bindings @@ -121,6 +124,18 @@ BuildRequires: pkgconfig(webkit2gtk-4.0) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xtst) %endif +Requires: %{pprefix}-six +Requires(post): update-alternatives +Requires(postun):update-alternatives +Conflicts: %{pprefix}-wxWidgets +Provides: %{pprefix}-wxWidgets = %{version} +%if "%{python_provides}" != "" +# for TW primary flavor provider +Conflicts: %{python_provides}-wxWidgets +Provides: %{python_provides}-wxPython = %{version}-%{release} +Provides: %{python_provides}-wxWidgets = %{version} +Obsoletes: %{python_provides}-wxPython < %{version}-%{release} +%endif %if %{with test} BuildRequires: %{python_module numpy} BuildRequires: %{python_module pytest-xdist} @@ -132,16 +147,6 @@ BuildRequires: wxWidgets-lang BuildRequires: xorg-x11-server BuildRequires: pkgconfig(cppunit) %endif -%if 0%{suse_version} >= 1550 -%define python_subpackage_only 1 -%python_subpackages -%else -Requires: %{pprefix}-six -Requires(post): update-alternatives -Requires(postun):update-alternatives -Conflicts: %{pprefix}-wxWidgets -Provides: %{pprefix}-wxWidgets = %{version} -%endif %description Phoenix is a reimplementation of wxPython. Like the "classic" @@ -156,42 +161,18 @@ platform specific code. Summary: Languages for package %{name} Group: System/Libraries Requires: %{name} = %{version} -Requires: %{plainpython}(abi) = %python_version +Requires: python(abi) = %python_version Supplements: (bundle-lang-other and %{name}) Provides: %{name}-lang-all = %{version} +%if "%{python_provides}" != "" +# for TW primary flavor provider +Provides: %{python_provides}-wxPython-lang = %{version}-%{release} +Obsoletes: %{python_provides}-wxPython-lang < %{version}-%{release} +%endif %description lang Provides translations to the package %{name}. -%package -n python-wxPython%{?nosub} -# extra definition for %%python_subpackage_only mechanism, keep in sync with main definitions. -Summary: The "Phoenix" variant of the wxWidgets Python bindings -Requires: python-six -Requires(post): update-alternatives -Requires(postun):update-alternatives -Conflicts: python-wxWidgets -Provides: python-wxWidgets = %{version} - -%description -n python-wxPython -Phoenix is a reimplementation of wxPython. Like the "classic" -wxPython, Phoenix wraps the wxWidgets C++ toolkit and provides access -to the user interface portions of the wxWidgets API, enabling Python -applications to have a GUI on Windows, macOS or Unix-like systems, -with a native look and feel and requiring very little (if any) -platform specific code. - -%package -n python-wxPython-lang -# We cannot use %%lang_package here. Editra translations use noarch incompatible path. -Summary: Languages for package %{pprefix}-wxPython -Group: System/Libraries -Requires: python-wxPython = %{version} -Requires: %{plainpython}(abi) = %python_version -Supplements: (bundle-lang-other and python-wxPython) -Provides: python-wxPython-lang-all = %{version} - -%description -n python-wxPython-lang -Provides translations to the package %pprefix-wxPython. - %prep %autosetup -n wxPython-%{version} -p1 @@ -203,15 +184,12 @@ echo "# empty module" >> wx/lib/pubsub/core/itopicdefnprovider.py %build export CFLAGS="%{optflags}" export DOXYGEN=%{_bindir}/doxygen -%python_expand $python build.py build %{wx_args} +%python_exec build.py build %{wx_args} %install -%python_expand $python build.py install %{wx_args} --destdir=%{buildroot} --extra_setup="-O1 --force" -# build.py install helpfully installs built shared libraries for all versions, -# so remove those for other versions. -%{python_expand find %{buildroot}%{$python_sitearch} -name *.so ! -name *cpython-%{$python_version_nodots}*so -delete} +%python_exec build.py install %{wx_args} --destdir=%{buildroot} --extra_setup="-O1 --force" -%python_expand %fdupes %{buildroot}%{$python_sitearch} +%fdupes %{buildroot}%{_libdir} %python_clone -a %{buildroot}%{_bindir}/helpviewer %python_clone -a %{buildroot}%{_bindir}/img2png @@ -226,20 +204,7 @@ export DOXYGEN=%{_bindir}/doxygen %python_clone -a %{buildroot}%{_bindir}/wxdocs %python_clone -a %{buildroot}%{_bindir}/wxget -# Note: find_lang only works for one python flavor per multibuild, -# cannot use python_find_lang in python_subpackage_only mode. %find_lang wxstd -%{python_expand # -echo "%%dir %{$python_sitearch}/wx/locale/ -%%dir %{$python_sitearch}/wx/locale/* -%%dir %{$python_sitearch}/wx/locale/*/LC_MESSAGES" >> wxstd.lang -} -%if "%psuffix" == "-other" -if [ $(echo %pythons | wc -w) -gt 1 ]; then - # could not collect for only one flavor, package locale files unmarked - echo "" > wxstd.lang -fi -%endif %check %if %{with test} @@ -266,22 +231,13 @@ mv wx wx_temp mv wx_temp wx %endif -%if 0%{?python_subpackage_only} -%post -n python-wxPython -%{python_install_alternative pywxrc helpviewer img2png img2py img2xpm pycrust pyshell pyslices pyslicesshell wxdemo wxdocs wxget} - -%postun -n python-wxPython -%{python_uninstall_alternative pywxrc} -%else - %post -%{python_install_alternative pywxrc helpviewer img2png img2py img2xpm pycrust pyshell pyslices pyslicesshell wxdemo wxdocs wxget} +%python_install_alternative pywxrc helpviewer img2png img2py img2xpm pycrust pyshell pyslices pyslicesshell wxdemo wxdocs wxget %postun -%{python_uninstall_alternative pywxrc} -%endif +%python_uninstall_alternative pywxrc -%files %{python_files wxPython} +%files %license LICENSE.txt license/*.txt %doc CHANGES.rst README.rst TODO.rst %python_alternative %{_bindir}/helpviewer @@ -300,9 +256,9 @@ mv wx_temp wx %{python_sitearch}/wx/ %exclude %{python_sitearch}/wx/locale/ -%files %{python_files wxPython-lang} -f wxstd.lang -%if "%psuffix" == "-other" -%{python_sitearch}/wx/locale/ -%endif +%files lang -f wxstd.lang +%dir %{python_sitearch}/wx/locale/ +%dir %{python_sitearch}/wx/locale/* +%dir %{python_sitearch}/wx/locale/*/LC_MESSAGES %changelog