1
0
python-wxPython/python-wxPython.spec

204 lines
7.2 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-wxPython
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Accepting request 807357 from home:Guillaume_G:branches:X11:wxWidgets - Update to 4.1.0: * Add a sample for wx.Font.AddPrivateFont to the demo. * Added wrappers for the OSXEnableAutomaticQuoteSubstitution, OSXEnableAutomaticDashSubstitution, and OSXDisableAllSmartSubstitutions methods in wx.TextCtrl. Also added OSXEnableAutomaticTabbing in wx.App. * Added wx.ColourDialogEvent, wx.DCTextBgColourChanger, wx.DCTextBgModeChanger, wx.grid.GridCellDateRenderer, wx.grid.GridCellDateEditor, wx.SystemAppearance, etc. * Many of the deprecated items in wxWidgets and wxPython are being or have been removed. Be sure to test your code in a recent 4.0.x release with warnings enabled so you can see which class, method or function calls you need to change. * Bug fixes in wx.lib.calendar: key navigation across month boundaries is now possible; key navigation now sets the date and fires the EVT_CALENDAR event; setter APIs now set the date correctly #1230. * Switch to using a wx.Overlay in the Widget Inspection Tool to highlight widgets when running on a GTK3 port. * Fixed issue in wx.lib.agw.customtreectrl where the label editor could remain stuck forever #1235. * Grafted on a EnableSystemTheme method to the classes which support it. This can be used to disable the default system theme on Windows for native widgets like wx.ListCtrl, wx.TreeCtrl and wx.dataview.DataViewCtrl. It has no effect on the other platforms. * The wx.WS_EX_VALIDATE_RECURSIVELY extended style flag is obsolete, as it is now the default (and only) behavior. The style flag has been added back into wxPython for compatibility, but with a zero value. You can just stop using it in your code with no change in behavior. #1278 * Fix a sometimes crash when using a wx.Overlay by letting the wx.DCOverlay hold a reference to the DC, to ensure that the DCOverlay is destroyed first. PR#1301 * Replaced the Vagrant VMs used for building wxPython for various Linux distros with Docker images. * Add some missing methods in wx.adv.BitmapComboBox #1307 * Added the wx.svg package which contains code for parsing SVG (Scalable Vector Graphics) files, and also code for integrating with wxPython. It can rasterize the SVG to a wx.Bitmap of any size with no loss of quality, and it can also render the SVG directly to a wx.GraphicsContext using the GC's drawing primitives. PR#1323 * Ported the embedding sample from Classic, which shows how to use wxPython from a C++ wxWidgets application that embeds Python. PR#1353 * Fixed wx.GetApp() to use wxWidgets' global wxApp instance instead of maintaining its own pointer. This way, if the wxApp is created by C++ code wxPython will still be able to get access to it. #1126 * Added wrappers for the wx.ActivityIndicator class. * Added wrappers for the wx.CollapsibleHeaderCtrl class. * Fixed issues in PlotCanvas around displaying and using scrollbars. #1428 * Added wx.msw.CHMHelpController, and also a wx.HelpController factory function that creates an instance of the best Help Controller for the platform. #1536 * Added wx.adv.GenericAnimationCtrl so the generic version of the animation classes can be used even on the platforms that have a native version. Note that due to internal changes to support both types of animations, some API changes in how the Animation objects are created. See the AnimationCtrl.py sample in the demo for the various usage patterns #1579 * Added wrappers for the wx.grid.GridBlockCoords, wx.grid.GridBlocks, and wx.grid.GridBlockDiffResult classes, as well as associated new methods in the wx.grid.Grid class. These provide a new way to interact with blocks of selected cells, including an iterator interface in wx.grid.GridBlocks which should be a more efficient (time and memory) way to process large groups of selections. - Disable Python2 OBS-URL: https://build.opensuse.org/request/show/807357 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=14
2020-05-20 20:37:51 +02:00
%define skip_python2 1
%define oldpython python
%define X_display ":98"
%bcond_with test
%bcond_without syswx
%if %{with syswx}
%define wx_args --use_syswx --gtk3 -v
%else
%define wx_args --gtk3 -v
%endif
%if %{with test}
# No numpy for Python 3.6
%define skip_python36 1
%endif
Name: python-wxPython
Accepting request 898558 from home:1Antoine1:branches:X11:wxWidgets - Update to version 4.1.1: * wxWidgets is now validating the flags passed when adding items to a sizer, to ensure that they are the correct flags for the type of the sizer. If the given flags do not make sense, for example using horizontal alignment flags in a horizontal box sizer, then a wxAssertionError error is raised. * Fixed missing binder for wxEVT_STC_AUTOCOMP_SELECTION_CHANGE. (PR#1613). * DataViewModel.HasValue can be overridden and will inform the DataViewCtrl whether or not an item and column has data. If HasValue returns False, then GetValue for that item/col will not be called. This allows a distinction between a truly empty cell, and one that has a value even if it is an empty string. (PR#1600) * Added flag that allows blocking of item dragging in the UltimateListControl class. (PR#1620) * Add the column index to notification events in UltimateListControl (PR#1630). * Added orientation parameter to UltimateListControl.GetScrollPos. (PR#1632) * wx.lib.agw.aui.AuiNotebook RemovePage() now hides the removed page, so it needs to be shown again if it is reused in another place. (PR#1668) * Fixed issue that could modify bytes objects under Python. (PR#1680) * Added wx.lib.agw.aui.EVT_AUI_PANE_CLOSE event which is sent when a AUI (the agw version) Pane has been closed (after it has been closed, not when it is about to be closed, which is when EVT_AUI_PANE_CLOSE is sent.) (PR#1628) * Exposed the wx.DC methods GetGraphicsContext and OBS-URL: https://build.opensuse.org/request/show/898558 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=26
2021-06-11 19:11:39 +02:00
Version: 4.1.1
Release: 0
Summary: The "Phoenix" variant of the wxWidgets Python bindings
License: GPL-2.0-or-later
Group: System/Libraries
URL: https://github.com/wxWidgets/Phoenix
Source: https://files.pythonhosted.org/packages/source/w/wxPython/wxPython-%{version}.tar.gz
Source1: python-wxPython-rpmlintrc
# PATCH-FIX-OPENSUSE fix_no_return_in_nonvoid.patch -- Fix lack of return in nonvoid functions
Patch0: fix_no_return_in_nonvoid.patch
# PATCH-FIX-OPENSUSE
Patch1: use_stl_build.patch
Accepting request 898558 from home:1Antoine1:branches:X11:wxWidgets - Update to version 4.1.1: * wxWidgets is now validating the flags passed when adding items to a sizer, to ensure that they are the correct flags for the type of the sizer. If the given flags do not make sense, for example using horizontal alignment flags in a horizontal box sizer, then a wxAssertionError error is raised. * Fixed missing binder for wxEVT_STC_AUTOCOMP_SELECTION_CHANGE. (PR#1613). * DataViewModel.HasValue can be overridden and will inform the DataViewCtrl whether or not an item and column has data. If HasValue returns False, then GetValue for that item/col will not be called. This allows a distinction between a truly empty cell, and one that has a value even if it is an empty string. (PR#1600) * Added flag that allows blocking of item dragging in the UltimateListControl class. (PR#1620) * Add the column index to notification events in UltimateListControl (PR#1630). * Added orientation parameter to UltimateListControl.GetScrollPos. (PR#1632) * wx.lib.agw.aui.AuiNotebook RemovePage() now hides the removed page, so it needs to be shown again if it is reused in another place. (PR#1668) * Fixed issue that could modify bytes objects under Python. (PR#1680) * Added wx.lib.agw.aui.EVT_AUI_PANE_CLOSE event which is sent when a AUI (the agw version) Pane has been closed (after it has been closed, not when it is about to be closed, which is when EVT_AUI_PANE_CLOSE is sent.) (PR#1628) * Exposed the wx.DC methods GetGraphicsContext and OBS-URL: https://build.opensuse.org/request/show/898558 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=26
2021-06-11 19:11:39 +02:00
# PATCH-FIX-UPSTREAM wxPython-4.1.1-fix-overrides.patch -- Fix build with wxWidgets 3.1.5 (gh#wxWidgets/Phoenix#1909)
Patch2: wxPython-4.1.1-fix-overrides.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module setuptools}
BuildRequires: c++_compiler
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
%if %{with syswx}
BuildRequires: wxGTK3-devel >= 3.1.5
%else
BuildRequires: freeglut-devel
BuildRequires: gstreamer-plugins-base-devel
BuildRequires: libjbig-devel
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libmspack)
BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(libpng16)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(webkit2gtk-4.0)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xtst)
%endif
Requires: python-six
Requires(post): update-alternatives
Requires(postun):update-alternatives
Conflicts: python-wxWidgets
Provides: python-wxWidgets = %{version}
%if %{with test}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module six}
# Need at least one font installed
BuildRequires: google-opensans-fonts
BuildRequires: wxWidgets-lang
BuildRequires: xorg-x11-server
BuildRequires: pkgconfig(cppunit)
%endif
%ifpython2
Conflicts: %{oldpython}-wxWidgets
Provides: %{oldpython}-wxWidgets = %{version}
%endif
%python_subpackages
%description
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 lang
# We cannot use %%lang_package here. Editra translations use noarch incompatible path.
Summary: Languages for package %{name}
Group: System/Libraries
Requires: %{name} = %{version}
Requires: python-base
Supplements: (bundle-lang-other and %{name})
Provides: %{name}-lang-all = %{version}
%description lang
Provides translations to the package %{name}.
%prep
%autosetup -n wxPython-%{version} -p1
sed -i -e '/^#!\//, 1d' wx/py/*.py
sed -i -e '/^#!\//, 1d' wx/tools/*.py
sed -i -e '/^#!\//, 1d' wx/py/tests/*.py
%build
export CFLAGS="%{optflags}"
export DOXYGEN=%{_bindir}/doxygen
%python_expand $python 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_expand %fdupes %{buildroot}%{$python_sitearch}
%python_clone -a %{buildroot}%{_bindir}/helpviewer
%python_clone -a %{buildroot}%{_bindir}/img2png
%python_clone -a %{buildroot}%{_bindir}/img2py
%python_clone -a %{buildroot}%{_bindir}/img2xpm
%python_clone -a %{buildroot}%{_bindir}/pycrust
%python_clone -a %{buildroot}%{_bindir}/pyshell
%python_clone -a %{buildroot}%{_bindir}/pyslices
%python_clone -a %{buildroot}%{_bindir}/pyslicesshell
%python_clone -a %{buildroot}%{_bindir}/pywxrc
%python_clone -a %{buildroot}%{_bindir}/wxdemo
%python_clone -a %{buildroot}%{_bindir}/wxdocs
%python_clone -a %{buildroot}%{_bindir}/wxget
%check
%if %{with test}
#############################################
### Launch a virtual framebuffer X server ###
#############################################
export DISPLAY=%{X_display}
Xvfb %{X_display} >& Xvfb.log &
trap "kill $! || true" EXIT
sleep 5
# Make sure "import wx" does not confuse the wx dir with the module
mv wx wx_temp
# Run each test as a separate process, otherwise multiple app
# instances will corrupt each others static data
# Run UiAction tests one by one
%pytest_arch --forked -n 1 -k 'test_uiaction or test_mousemanager' unittests/
# Skip Auto ID management test (only enabled on Windows)
# Skip Frame restore (requires a window manager)
# Skip UiAction tests (already done)
%pytest_arch --forked -n auto -k '(not test_newIdRef03) and (not test_uiaction) and (not test_mousemanager) and (not test_frameRestore)' unittests/
mv wx_temp wx
%endif
%post
%{python_install_alternative pywxrc helpviewer img2png img2py img2xpm pycrust pyshell pyslices pyslicesshell wxdemo wxdocs wxget}
%postun
%{python_uninstall_alternative pywxrc helpviewer img2png img2py img2xpm pycrust pyshell pyslices pyslicesshell wxdemo wxdocs wxget}
%files %{python_files}
%license LICENSE.txt license/*.txt
%doc CHANGES.rst README.rst TODO.rst
%python_alternative %{_bindir}/helpviewer
%python_alternative %{_bindir}/img2png
%python_alternative %{_bindir}/img2py
%python_alternative %{_bindir}/img2xpm
%python_alternative %{_bindir}/pycrust
%python_alternative %{_bindir}/pyshell
%python_alternative %{_bindir}/pyslices
%python_alternative %{_bindir}/pyslicesshell
%python_alternative %{_bindir}/pywxrc
%python_alternative %{_bindir}/wxdemo
%python_alternative %{_bindir}/wxdocs
%python_alternative %{_bindir}/wxget
%{python_sitearch}/wxPython-%{version}-py*.egg-info
%{python_sitearch}/wx/
%exclude %{python_sitearch}/wx/locale/
%files %{python_files lang}
%{python_sitearch}/wx/locale/
%changelog