5804b9a
%global pkgname wxpython4
5804b9a
%global srcname wxPython
0bbb1b8
%bcond_without tests
5804b9a
%global sum New implementation of wxPython, a GUI toolkit for Python
5804b9a
%global desc \
5804b9a
wxPython4 is a is a new implementation of wxPython focused on improving speed,\
5804b9a
maintainability and extensibility. Just like "Classic" wxPython it wraps the\
5804b9a
wxWidgets C++ toolkit and provides access to the user interface portions of the\
5804b9a
wx API, enabling Python applications to have a GUI on Windows, Macs or Unix\
5804b9a
systems with a native look and feel and requiring very little (if any) platform\
5804b9a
specific code.
5804b9a
5804b9a
Name:           python-wxpython4
0290444
Version:        4.0.7
f55a17c
Release:        23%{?dist}
5804b9a
Summary:        %{sum}
5804b9a
# wxPython is licensed under the wxWidgets license.  The only exception is
5804b9a
# the pubsub code in wx/lib/pubsub which is BSD licensed.  Note: wxPython
5804b9a
# includes a bundled copy of wxWidgets in ext/wxWidgets which has a few
5804b9a
# bits of code that use other licenses.  This source is not used in the
5804b9a
# Fedora build, except for the interface headers in ext/wxWidgets/interface
5804b9a
# and the doxygen build scripts.
5804b9a
License:        wxWidgets and BSD
5804b9a
URL:            https://www.wxpython.org/
5804b9a
Source0:        https://files.pythonhosted.org/packages/source/w/%{srcname}/%{srcname}-%{version}.tar.gz
1e58cdf
Patch0:         sip5.patch
54aaff8
Patch1:         fix-ftbfs-sip-4.19.23.patch
4f6a9dd
Patch2:         wxpymakebuffer-acquire-gil.patch
f5471fb
Patch3:         restore-gil-pseudodc.patch
61a41ef
Patch4:         fix-ftbfs-doxygen-1.9.0.patch
dae7df8
Patch5:         sip6-remove-enum.patch
dae7df8
Patch6:         sip6.patch
f55a17c
Patch7:         https://github.com/wxWidgets/Phoenix/commit/9096426603272672d9a676e8bcdcadf0a1cfa1a2.patch
f55a17c
Patch8:         https://github.com/wxWidgets/Phoenix/commit/3eb9eb32dc3285435039f6c420c398665372a1ad.patch
f55a17c
Patch9:         https://github.com/wxWidgets/Phoenix/commit/0d449626d6d298ad96ebd1d514d0e42833bce470.patch
f55a17c
Patch10:        python3.10-fixes.patch
5804b9a
2e8895b
BuildRequires:  gcc-c++
5804b9a
BuildRequires:  doxygen
349fde4
BuildRequires:  waf
5804b9a
BuildRequires:  wxGTK3-devel
5804b9a
# For tests
5804b9a
%if %{with tests}
ef788ff
BuildRequires:  glibc-langpack-en
5804b9a
BuildRequires:  xorg-x11-server-Xvfb
a759001
BuildRequires:  python3-numpy
a759001
BuildRequires:  python3-pytest
a759001
BuildRequires:  python3-pytest-timeout
a759001
BuildRequires:  python3-pytest-xdist
5804b9a
%endif
5804b9a
5804b9a
%description %{desc}
5804b9a
5804b9a
%package -n python3-%{pkgname}
5804b9a
Summary:        %{sum}
5804b9a
%{?python_provide:%python_provide python3-%{pkgname}}
5804b9a
BuildRequires:  python3-devel
ef788ff
BuildRequires:  python3-pillow
5804b9a
BuildRequires:  python3-setuptools
5804b9a
BuildRequires:  python3-six
dae7df8
BuildRequires:  python3dist(sip) >= 5
ef788ff
Requires:       python3-pillow
5804b9a
Requires:       python3-six
1e58cdf
# Remove when F33 is EOL
1e58cdf
Obsoletes:      python3-wx-siplib < 4.19.24-2
5804b9a
5804b9a
%description -n python3-%{pkgname} %{desc}
5804b9a
5804b9a
%package -n python3-%{pkgname}-media
5804b9a
Summary:        %{sum} (media module)
5804b9a
%{?python_provide:%python_provide python3-%{pkgname}-media}
5804b9a
Requires:       python3-%{pkgname}%{?_isa} = %{version}-%{release}
5804b9a
5804b9a
%description -n python3-%{pkgname}-media %{desc}
5804b9a
This package provides the wx.media module.
5804b9a
5804b9a
%package -n python3-%{pkgname}-webview
5804b9a
Summary:        %{sum} (webview module)
5804b9a
%{?python_provide:%python_provide python3-%{pkgname}-webview}
5804b9a
Requires:       python3-%{pkgname}%{?_isa} = %{version}-%{release}
5804b9a
5804b9a
%description -n python3-%{pkgname}-webview %{desc}
5804b9a
This package provides the wx.html2 module.
5804b9a
5804b9a
%package        doc
5804b9a
Summary:        Documentation and samples for wxPython
5804b9a
BuildArch:      noarch
5804b9a
5804b9a
%description doc
5804b9a
Documentation, samples and demo application for wxPython.
5804b9a
5804b9a
5804b9a
%prep
ca72715
%autosetup -n %{srcname}-%{version} -p1
5804b9a
5804b9a
sed -i -e "s|WX_CONFIG = 'wx-config'|WX_CONFIG = 'wx-config-3.0'|" build.py
5804b9a
rm -rf sip/siplib
5804b9a
rm -rf wx/py/tests
5804b9a
rm -f docs/sphinx/_downloads/i18nwxapp/i18nwxapp.zip
5804b9a
cp -a wx/lib/pubsub/LICENSE_BSD_Simple.txt license
5804b9a
# Remove env shebangs from various files
5804b9a
sed -i -e '/^#!\//, 1d' demo/*.py{,w}
5804b9a
sed -i -e '/^#!\//, 1d' demo/agw/*.py
5804b9a
sed -i -e '/^#!\//, 1d' docs/sphinx/_downloads/i18nwxapp/*.py
5804b9a
sed -i -e '/^#!\//, 1d' samples/floatcanvas/*.py
5804b9a
sed -i -e '/^#!\//, 1d' samples/mainloop/*.py
5804b9a
sed -i -e '/^#!\//, 1d' samples/ribbon/*.py
5804b9a
sed -i -e '/^#!\//, 1d' wx/py/*.py
5804b9a
sed -i -e '/^#!\//, 1d' wx/tools/*.py
5804b9a
# Fix end of line encodings
5804b9a
sed -i 's/\r$//' docs/sphinx/_downloads/*.py
5804b9a
sed -i 's/\r$//' docs/sphinx/rest_substitutions/snippets/python/contrib/*.py
5804b9a
sed -i 's/\r$//' docs/sphinx/rest_substitutions/snippets/python/converted/*.py
5804b9a
sed -i 's/\r$//' docs/sphinx/_downloads/i18nwxapp/locale/I18Nwxapp.pot
5804b9a
sed -i 's/\r$//' docs/sphinx/make.bat
5804b9a
sed -i 's/\r$//' docs/sphinx/phoenix_theme/theme.conf
5804b9a
sed -i 's/\r$//' samples/floatcanvas/BouncingBall.py
5804b9a
# Remove spurious executable perms
5804b9a
chmod -x demo/*.py
5804b9a
chmod -x samples/mainloop/mainloop.py
5804b9a
chmod -x samples/printing/sample-text.txt
5804b9a
# Remove empty files
5804b9a
find demo -size 0 -delete
5804b9a
find docs/sphinx/rest_substitutions/snippets/python/converted -size 0 -delete
5804b9a
# Convert files to UTF-8
5804b9a
for file in demo/TestTable.txt docs/sphinx/_downloads/i18nwxapp/locale/I18Nwxapp.pot docs/sphinx/class_summary.pkl docs/sphinx/wx.1moduleindex.pkl; do
5804b9a
    iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
5804b9a
    touch -r $file $file.new && \
5804b9a
    mv $file.new $file
5804b9a
done
5804b9a
1e58cdf
# Generate sip module code to replace bundled version
dac9dc4
sip-module --abi-version 12.9 --sdist wx.siplib
dac9dc4
tar -xf wx_siplib-12.9.0.tar.gz
dac9dc4
mv wx_siplib-12.9.0 sip/siplib
dae7df8
cp -p /usr/share/licenses/sip6/LICENSE sip/siplib
5804b9a
5804b9a
%build
1e58cdf
DOXYGEN=%{_bindir}/doxygen WAF=%{_bindir}/waf %{__python3} -u build.py dox touch etg --nodoc sip build_py --use_syswx --gtk3
5804b9a
5804b9a
5804b9a
%install
5804b9a
%{__python3} build.py install_py --destdir=%{buildroot}
5804b9a
rm -f %{buildroot}%{_bindir}/*
5804b9a
# Remove locale files (they are provided by wxWidgets)
5804b9a
rm -rf %{buildroot}%{python3_sitearch}/wx/locale
5804b9a
5804b9a
%check
5804b9a
%if %{with tests}
504f7ee
SKIP_TESTS="'not (display_Tests or glcanvas_Tests or mousemanager_Tests or numdlg_Tests or uiaction_MouseTests or uiaction_KeyboardTests or unichar_Tests or valtext_Tests or test_frameRestore or test_grid_pi)'"
504f7ee
xvfb-run -a %{__python3} build.py test --pytest_timeout=60 --extra_pytest="-k $SKIP_TESTS" --verbose || true
5804b9a
%endif
5804b9a
5804b9a
5804b9a
%files -n python3-%{pkgname}
ca72715
%license license/*
5804b9a
%{python3_sitearch}/*
5804b9a
%exclude %{python3_sitearch}/wx/*html2*
5804b9a
%exclude %{python3_sitearch}/wx/__pycache__/*html2*
5804b9a
%exclude %{python3_sitearch}/wx/*media*
5804b9a
%exclude %{python3_sitearch}/wx/__pycache__/*media*
5804b9a
5804b9a
%files -n python3-%{pkgname}-media
5804b9a
%{python3_sitearch}/wx/*media*
5804b9a
%{python3_sitearch}/wx/__pycache__/*media*
5804b9a
5804b9a
%files -n python3-%{pkgname}-webview
5804b9a
%{python3_sitearch}/wx/*html2*
5804b9a
%{python3_sitearch}/wx/__pycache__/*html2*
5804b9a
5804b9a
%files doc
ca72715
%doc docs demo samples
ca72715
%license license/*
5804b9a
5804b9a
5804b9a
%changelog
f55a17c
* Wed Dec 22 2021 Scott Talbert <swt@techie.net> - 4.0.7-23
f55a17c
- Fix a bunch of Python 3.10 issues
f55a17c
dac9dc4
* Mon Oct 11 2021 Scott Talbert <swt@techie.net> - 4.0.7-22
dac9dc4
- Fix build with sip 6.2.0
dac9dc4
30d3535
* Wed Aug 04 2021 Scott Talbert <swt@techie.net> - 4.0.7-21
30d3535
- Remove patch for UnicodeDecodeError due to proper fix in sip
30d3535
a2cd2bd
* Tue Aug 03 2021 Scott Talbert <swt@techie.net> - 4.0.7-20
a2cd2bd
- Fix UnicodeDecodeError on package import due to sip 6 (#1988466)
a2cd2bd
e488001
* Tue Jul 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.7-19
e488001
- Second attempt - Rebuilt for
e488001
  https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
e488001
dae7df8
* Tue Jul 20 2021 Scott Talbert <swt@techie.net> - 4.0.7-18
dae7df8
- Fix building with sip 6
dae7df8
9d26549
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 4.0.7-17
9d26549
- Rebuilt for Python 3.10
9d26549
1a13814
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.7-16
1a13814
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
1a13814
1e58cdf
* Fri Jan 15 20:38:35 EST 2021 Scott Talbert <swt@techie.net> - 4.0.7-15
1e58cdf
- Switch to building with sip 5
1e58cdf
61a41ef
* Mon Jan 11 21:38:13 EST 2021 Scott Talbert <swt@techie.net> - 4.0.7-14
61a41ef
- Fix FTBFS with doxygen 1.9.1
61a41ef
f5471fb
* Thu Nov 26 09:38:13 EST 2020 Scott Talbert <swt@techie.net> - 4.0.7-13
f5471fb
- Backport upstream fix for wxPseudoDC.FindObjects crash (#1901912)
f5471fb
4f6a9dd
* Thu Nov  5 19:46:11 EST 2020 Scott Talbert <swt@techie.net> - 4.0.7-12
4f6a9dd
- Backport upstream fix for wxCustomDataObject.GetData crash
4f6a9dd
7a9cb25
* Sat Oct 31 2020 Scott Talbert <swt@techie.net> - 4.0.7-11
7a9cb25
- Fix crash in wxCustomDataObject.GetData
7a9cb25
51cb9e1
* Wed Aug 12 2020 Scott Talbert <swt@techie.net> - 4.0.7-10
51cb9e1
- Remove BD on python3-pathlib2 (not needed)
51cb9e1
44e2003
* Mon Aug 03 2020 Scott Talbert <swt@techie.net> - 4.0.7-9
44e2003
- Rebuild with latest wxGTK3 build to fix missing symbol issue (#1862822)
44e2003
16ef7cd
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.7-8
16ef7cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
16ef7cd
54aaff8
* Thu Jul 23 2020 Scott Talbert <swt@techie.net> - 4.0.7-7
54aaff8
- Fix FTBFS with sip 4.19.23
54aaff8
525f9ee
* Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 4.0.7-6
525f9ee
- Rebuilt for Python 3.9
525f9ee
27f0ee5
* Mon Feb 10 2020 Miro Hrončok <mhroncok@redhat.com> - 4.0.7-5
27f0ee5
- Rebuilt to fix an undefined symbol (#1801244)
27f0ee5
d8e6c70
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.7-4
d8e6c70
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
d8e6c70
349fde4
* Sat Jan 11 2020 Scott Talbert <swt@techie.net> - 4.0.7-3
349fde4
- Build using unbundled copy of waf (#1789646)
349fde4
3bba4ff
* Thu Nov 07 2019 Scott Talbert <swt@techie.net> - 4.0.7-2
3bba4ff
- Remove BR on python-PyPDF2 - PDF tests are disabled by default anyway
3bba4ff
0290444
* Sat Oct 26 2019 Scott Talbert <swt@techie.net> - 4.0.7-1
0290444
- Update to new upstream release 4.0.7 (#1765757)
0290444
ca72715
* Mon Sep 16 2019 Scott Talbert <swt@techie.net> - 4.0.6-9
ca72715
- Remove Python 2 subpackages (#1629793)
ca72715
91e543a
* Thu Aug 29 2019 Scott Talbert <swt@techie.net> - 4.0.6-8
91e543a
- Switch to using private sip module, wx.siplib (#1739469)
91e543a
7efd6ec
* Wed Aug 28 2019 Scott Talbert <swt@techie.net> - 4.0.6-7
7efd6ec
- Fix FloatCanvas with Python 3.8 (time.clock removed)
7efd6ec
f981d1a
* Sun Aug 18 2019 Miro Hrončok <mhroncok@redhat.com> - 4.0.6-6
f981d1a
- Rebuilt for Python 3.8
f981d1a
cf4b0e6
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.6-5
cf4b0e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
cf4b0e6
a759001
* Thu Jul 25 2019 Scott Talbert <swt@techie.net> - 4.0.6-4
a759001
- Stop running tests for Python 2 to release some Py2 dependencies
a759001
3626389
* Wed Jul 17 2019 Scott Talbert <swt@techie.net> - 4.0.6-3
3626389
- Fix FTBFS due to easy_install switch to Python 3
3626389
bb30c19
* Fri Jun 28 2019 Rex Dieter <rdieter@fedoraproject.org> - 4.0.6-2
bb30c19
- >= sip-api
bb30c19
3b0c38f
* Tue May 21 2019 Scott Talbert <swt@techie.net> - 4.0.6-1
3b0c38f
- Update to new upstream release 4.0.6 (#1711733)
3b0c38f
18d4c1b
* Sat May 18 2019 Scott Talbert <swt@techie.net> - 4.0.4-4
18d4c1b
- Fix FTBFS with Python 3.8 (#1710767)
18d4c1b
efe0b3b
* Sat Apr 06 2019 Scott Talbert <swt@techie.net> - 4.0.4-3
efe0b3b
- Fix FTBFS with SIP 4.19.14 (#1696302)
efe0b3b
d3622d9
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.4-2
d3622d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d3622d9
ef788ff
* Mon Jan 07 2019 Scott Talbert <swt@techie.net> - 4.0.4-1
ef788ff
- New upstream release 4.0.4
ef788ff
504f7ee
* Tue Nov 20 2018 Scott Talbert <swt@techie.net> - 4.0.1-11
504f7ee
- Fix tests
504f7ee
19c6557
* Sat Oct 27 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 4.0.1-10
19c6557
- Rebuilt for sip update
19c6557
9ebcbf1
* Mon Jul 16 2018 Scott Talbert <swt@techie.net> - 4.0.1-9
9ebcbf1
- Replace use of python3-sip binary with sip (fixes FTBFS)
9ebcbf1
- Use sip-api macros to ensure dependency on correct sip module version
9ebcbf1
bd86a21
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-8
bd86a21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
bd86a21
0bbb1b8
* Wed Jun 20 2018 Scott Talbert <swt@techie.net> - 4.0.1-7
0bbb1b8
- Re-enable tests but enable pytest-timeout
0bbb1b8
87bc0b2
* Wed Jun 20 2018 Scott Talbert <swt@techie.net> - 4.0.1-6
87bc0b2
- Cherry-pick waf 2.0.7 updates to fix Python 3.7 FTBFS (#1593029)
87bc0b2
3233905
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.0.1-5
3233905
- Rebuilt for Python 3.7
3233905
2e8895b
* Mon Feb 19 2018 Scott Talbert <swt@techie.net> - 4.0.1-4
2e8895b
- Add missing BR for gcc-c++
2e8895b
5804b9a
* Thu Feb 15 2018 Scott Talbert <swt@techie.net> - 4.0.1-3
5804b9a
- Second round of review comment fixes
5804b9a
5804b9a
* Tue Feb 13 2018 Scott Talbert <swt@techie.net> - 4.0.1-2
5804b9a
- Address initial review comments
5804b9a
- Fix rpmlint errors
5804b9a
- Fix and enable tests (but they are still not required to pass)
5804b9a
5804b9a
* Wed Feb 07 2018 Scott Talbert <swt@techie.net> - 4.0.1-1
5804b9a
- Initial packaging