Drop Python 3 conditionals

This commit is contained in:
Kalev Lember 2019-09-21 18:30:59 +02:00
parent 3b275b80b7
commit 323c0b2d88

View File

@ -2,17 +2,13 @@
%define gobject_introspection_version 1.46.0
%define pycairo_version 1.11.1
%define python2_version 2.7
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_python3 1
%define python3_version 3.4
%endif
%global with_check 0
Name: pygobject3
Version: 3.34.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Python bindings for GObject Introspection
License: LGPLv2+ and MIT
@ -24,22 +20,17 @@ BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: meson
BuildRequires: python2-devel >= %{python2_version}
BuildRequires: python2-cairo-devel >= %{pycairo_version}
%if 0%{?with_python3}
BuildRequires: python3-devel >= %{python3_version}
BuildRequires: python3-cairo-devel >= %{pycairo_version}
%endif # if with_python3
BuildRequires: cairo-gobject-devel
# Required by the upstream selftest suite:
%if %{with_check}
%if 0%{?with_python3}
# Temporarily disabled pyflakes tests to avoid the build failing due to too new
# pyflakes 0.7.2 in F19
# https://bugzilla.gnome.org/show_bug.cgi?id=701009
#BuildRequires: python2-pyflakes
BuildRequires: python2-pep8
%endif
## for the Gdk and Gtk typelibs, used during the test suite:
BuildRequires: gtk3
## for xvfb-run:
@ -84,7 +75,6 @@ Provides: %{name}-base%{?_isa} = %{version}-%{release}
This package provides the non-cairo specific bits of the GObject Introspection
library.
%if 0%{?with_python3}
%package -n python3-gobject
Summary: Python 3 bindings for GObject Introspection
Requires: python3-gobject-base%{?_isa} = %{version}-%{release}
@ -104,14 +94,11 @@ Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version
This package provides the non-cairo specific bits of the GObject Introspection
library.
%endif # with_python3
%package devel
Summary: Development files for embedding PyGObject introspection support
Requires: python2-gobject%{?_isa} = %{version}-%{release}
%if 0%{?with_python3}
Requires: python3-gobject%{?_isa} = %{version}-%{release}
%endif
Requires: gobject-introspection-devel%{?_isa}
%description devel
@ -120,49 +107,35 @@ This package contains files required to embed PyGObject
%prep
%autosetup -n pygobject-%{version} -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
%meson -Dpython=%{__python2}
%meson_build
%if 0%{?with_python3}
pushd %{py3dir}
%meson -Dpython=%{__python3}
%meson_build
popd
%endif # with_python3
%install
%meson_install
%if 0%{?with_python3}
pushd %{py3dir}
%meson_install
popd
%endif # with_python3
%check
%if %{with_check}
# Run the selftests under a temporary xvfb X server (so that they can
# initialize Gdk etc):
# FIXME: disabled for python3
# Currently this fails with python3 with:
# File "/builddir/build/BUILD/python3-pygobject3-3.3.4-4.fc19/gi/__init__.py", line 23, in <module>
# from ._gi import _API, Repository
#ValueError: level must be >= 0
# Reported upstream as http://bugs.python.org/issue15610
%if 0
pushd %{py3dir}
PYTHON=%{__python3}
export PYTHON
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
popd
%endif # with_python3
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
@ -180,7 +153,6 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
%{python2_sitearch}/pygtkcompat/
%{python2_sitearch}/PyGObject-*.egg-info
%if 0%{?with_python3}
%files -n python3-gobject
%{python3_sitearch}/gi/_gi_cairo*.so
@ -192,7 +164,6 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
%exclude %{python3_sitearch}/gi/_gi_cairo*.so
%{python3_sitearch}/pygtkcompat/
%{python3_sitearch}/PyGObject-*.egg-info
%endif # with_python3
%files devel
%doc examples/
@ -201,6 +172,9 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
%{_libdir}/pkgconfig/pygobject-3.0.pc
%changelog
* Sat Sep 21 2019 Kalev Lember <klember@redhat.com> - 3.34.0-2
- Drop Python 3 conditionals
* Mon Sep 09 2019 Kalev Lember <klember@redhat.com> - 3.34.0-1
- Update to 3.34.0