#1 Update to build with sip 5
Merged 2 years ago by kevin. Opened 2 years ago by swt2c.
rpms/ swt2c/qhexedit2 sip5  into  rawhide

file modified
+14 -39
@@ -1,7 +1,7 @@ 

  Name:           qhexedit2

  # Remember to also update version in qhexedit2_build.patch in the setup.py hunk

  Version:        0.8.9

- Release:        4%{?dist}

+ Release:        5%{?dist}

  Summary:        Binary Editor for Qt

  

  License:        LGPLv2
@@ -11,6 +11,7 @@ 

  

  # Fix build issues

  Patch0:         qhexedit2_build.patch

+ Patch1:         sip5.patch

  

  BuildRequires:  desktop-file-utils

  BuildRequires:  gcc-c++
@@ -21,6 +22,8 @@ 

  BuildRequires:  python3-pyqt5-sip

  BuildRequires:  python3-PyQt4-devel

  BuildRequires:  python3-qt5-devel

+ BuildRequires:  %{py3_dist PyQt-builder}

+ BuildRequires:  %{py3_dist sip} >= 5

  

  Requires:       %{name}-qt5-libs%{?_isa} = %{version}-%{release}

  
@@ -74,26 +77,6 @@ 

  

  ###############################################################################

  

- %package -n python3-%{name}

- Summary:        %{name} Qt4 Python3 bindings

- Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

- %{?python_provide:%python_provide python3-%{name}}

- 

- %description -n python3-%{name}

- %{name} Qt4 Python3 bindings.

- 

- 

- %package -n python3-%{name}-devel

- Summary:        Development files for the %{name} Qt4 Python3 bindings

- Requires:       python3-%{name}%{?_isa} = %{version}-%{release}

- Requires:       python3-sip-devel

- %{?python_provide:%python_provide python3-%{name}-devel}

- 

- %description -n python3-%{name}-devel

- Development files for the %{name} Qt4 Python3 bindings

- 

- ###############################################################################

- 

  %package -n python3-%{name}-qt5

  Summary:        %{name} Qt5 Python3 bindings

  Requires:       %{name}-qt5-libs%{?_isa} = %{version}-%{release}
@@ -106,7 +89,7 @@ 

  %package -n python3-%{name}-qt5-devel

  Summary:        Development files for the %{name} Qt5 Python3 bindings

  Requires:       python3-%{name}-qt5%{?_isa} = %{version}-%{release}

- Requires:       python3-sip-devel

+ Requires:       %{py3_dist sip} >= 5

  %{?python_provide:%python_provide python3-%{srcname}-qt5-devel}

  

  %description -n python3-%{name}-qt5-devel
@@ -130,9 +113,6 @@ 

  %make_build

  popd

  

- # Build sip bindings, qt4, python3

- %{__python3} setup.py build --build-base=build-python3-qt4

- 

  # Build library, qt5

  mkdir build-lib-qt5

  pushd build-lib-qt5
@@ -141,7 +121,8 @@ 

  popd

  

  # Build sip bindings, qt5, python3

- USE_QT5=1 %{__python3} setup.py build --build-base=build-python3-qt5

+ sip-build --qmake=%{_qt5_qmake} --verbose --build-dir=build-python3-qt5 --no-make

+ %make_build -C build-python3-qt5

  

  # Build application

  mkdir build-example
@@ -189,9 +170,7 @@ 

  

  # Python bindings

  # Distutils does not support --build-base with install, you need to build also...

- CFLAGS="%{optflags}" %{__python3} setup.py build --build-base=build-python3-qt4 install --skip-build --root %{buildroot}

- USE_QT5=1 CFLAGS="%{optflags}" %{__python3} setup.py build --build-base=build-python3-qt5 install --skip-build --root %{buildroot}

- install -Dpm 0644 src/qhexedit.sip %{buildroot}%{_datadir}/python3-sip/qhexedit/qhexedit.sip

+ %make_install INSTALL_ROOT=%{buildroot} -C build-python3-qt5

  

  # Application

  install -Dpm 0755 build-example/qhexedit %{buildroot}%{_bindir}/qhexedit
@@ -226,21 +205,17 @@ 

  %license src/license.txt

  %doc doc/html

  

- %files -n python3-%{name}

- %{python3_sitearch}/qhexedit.*.so

- %{python3_sitearch}/QHexEdit-%{version}-*.egg-info

- 

- %files -n python3-%{name}-devel

- %{_datadir}/python3-sip/qhexedit/

- 

  %files -n python3-%{name}-qt5

- %{python3_sitearch}/qhexedit-qt5.*.so

- %{python3_sitearch}/QHexEdit_qt5-%{version}-*.egg-info

+ %{python3_sitearch}/qhexedit.*.so

+ %{python3_sitearch}/QHexEdit-%{version}*info

  

  %files -n python3-%{name}-qt5-devel

- %{_datadir}/python3-sip/qhexedit/

+ %{python3_sitearch}/PyQt5/bindings/qhexedit/

  

  %changelog

+ * Wed Jun 16 2021 Scott Talbert <swt@techie.net> - 0.8.9-5

+ - Update to build with sip 5

+ 

  * Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.8.9-4

  - Rebuilt for Python 3.10

  

file added
+81
@@ -0,0 +1,81 @@ 

+ From ce17d35586de1b9fdc21e3f8450dd1d2b76d5bcc Mon Sep 17 00:00:00 2001

+ From: Scott Talbert <swt@techie.net>

+ Date: Mon, 18 Jan 2021 21:06:46 -0500

+ Subject: [PATCH] Add support for building with sip 5

+ 

+ ---

+  project.py       | 29 +++++++++++++++++++++++++++++

+  pyproject.toml   | 14 ++++++++++++++

+  src/qhexedit.sip |  2 +-

+  3 files changed, 44 insertions(+), 1 deletion(-)

+  create mode 100644 project.py

+  create mode 100644 pyproject.toml

+ 

+ diff --git a/project.py b/project.py

+ new file mode 100644

+ index 0000000..c9ee67f

+ --- /dev/null

+ +++ b/project.py

+ @@ -0,0 +1,29 @@

+ +"""The build configuration file for QHexEdit, used by sip."""

+ +

+ +import os

+ +from os.path import abspath, join

+ +from sipbuild import Option

+ +from pyqtbuild import PyQtBindings, PyQtProject

+ +import PyQt5

+ +

+ +

+ +class QHexEditProject(PyQtProject):

+ +    """The QHexEdit Project class."""

+ +

+ +    def __init__(self):

+ +        super().__init__()

+ +        self.bindings_factories = [QHexEditBindings]

+ +

+ +    def update(self, tool):

+ +        """Allows SIP to find PyQt5 .sip files."""

+ +        super().update(tool)

+ +        self.sip_include_dirs.append(join(PyQt5.__path__[0], 'bindings'))

+ +

+ +

+ +class QHexEditBindings(PyQtBindings):

+ +    """The QHexEdit Bindings class."""

+ +

+ +    def __init__(self, project):

+ +        super().__init__(project, name='QHexEdit',

+ +                         sip_file='qhexedit.sip',

+ +                         qmake_QT=['widgets'])

+ diff --git a/pyproject.toml b/pyproject.toml

+ new file mode 100644

+ index 0000000..b5edaa4

+ --- /dev/null

+ +++ b/pyproject.toml

+ @@ -0,0 +1,14 @@

+ +[build-system]

+ +requires = ["sip >=5", "PyQt-builder", "PyQt5"]

+ +build-backend = "sipbuild.api"

+ +

+ +[tool.sip.metadata]

+ +name = "QHexEdit"

+ +version = "0.8.9"

+ +

+ +[tools.sip]

+ +abi-version = "12.8"

+ +project-factory = "pyqtbuild:PyQtProject"

+ +

+ +[tool.sip.project]

+ +sip-files-dir = "src"

+ diff --git a/src/qhexedit.sip b/src/qhexedit.sip

+ index f7db293..6d4ebae 100644

+ --- a/src/qhexedit.sip

+ +++ b/src/qhexedit.sip

+ @@ -1,4 +1,4 @@

+ -%Module(name=qhexedit, version=1)

+ +%Module(name=qhexedit)

+  

+  %Import QtCore/QtCoremod.sip

+  %Import QtGui/QtGuimod.sip

+ -- 

+ 2.31.1

+ 

Please DON'T MERGE but do provide comments/approval. This is part of a coordinated move to sip5 in F35+.

Any objections here?

No objections - could you also propose the changes upstream?

building in f35-build-side-43327

Pull-Request has been merged by kevin

2 years ago
Metadata