Mageia Bugzilla – Attachment 14589 Details for
Bug 33398
qhexedit2: add qt-designer plugin support and, maybe, swith to Qt6 build
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
patch to add Qt-plugin and switch to Qt6
qhexedit2.spec.patch (text/plain), 8.25 KB, created by
Aurelian R
on 2024-07-13 21:46:10 CEST
(
hide
)
Description:
patch to add Qt-plugin and switch to Qt6
Filename:
MIME Type:
Creator:
Aurelian R
Created:
2024-07-13 21:46:10 CEST
Size:
8.25 KB
patch
obsolete
>--- qhexedit2/qhexedit2.spec 2024-07-13 14:29:39.977824719 +0300 >+++ SPECS/qhexedit2.spec 2024-07-13 22:31:55.574806133 +0300 >@@ -1,11 +1,23 @@ >+%define QtV 6 >+%if %QtV == 6 >+%define qmake_QtV %qmake_qt6 >+%define _QtV_bindir %{_qt6_bindir} >+%define _QtV_plugindir %{_qt6_plugindir} >+%else >+%define qmake_QtV %qmake_qt5 >+%define _QtV_bindir %{_qt5_bindir} >+%define _QtV_plugindir %{_qt5_plugindir} >+%endif >+ > %define major 4 >-%define libname_qt5 %mklibname %{name}-qt5_ %{major} >-%define devname_qt5 %mklibname %{name}-qt5 -d >+%define libname_qt %mklibname %{name}-qt%{QtV}_ %{major} >+%define devname_qt %mklibname %{name}-qt%{QtV} -d >+%define plugin_qt %mklibname %{name}-plugin-qt%{QtV} > > Name: qhexedit2 > # Remember to also update version in qhexedit2_build.patch in the setup.py hunk > Version: 0.8.9 >-Release: %mkrel 6 >+Release: %mkrel 6.1 > Summary: Binary Editor for Qt > Group: Development/KDE and Qt > License: LGPLv2 >@@ -19,15 +31,12 @@ Patch1: sip5.patch > > BuildRequires: desktop-file-utils > BuildRequires: gcc-c++ >-BuildRequires: make >-BuildRequires: pkgconfig(Qt5Core) >-BuildRequires: pkgconfig(Qt5Gui) >-BuildRequires: pkgconfig(Qt5PrintSupport) >-BuildRequires: pkgconfig(Qt5Widgets) >+BuildRequires: pkgconfig(Qt%{QtV}Core) >+BuildRequires: pkgconfig(Qt%{QtV}Widgets) >+BuildRequires: pkgconfig(Qt%{QtV}Designer) > BuildRequires: pkgconfig(python3) >-BuildRequires: python3-pyqt5-sip >-BuildRequires: python3-qt5-devel >-BuildRequires: python3-sip6 >+BuildRequires: python3-pyqt%{QtV}-sip >+BuildRequires: python3-qt%{QtV}-devel > BuildRequires: python3dist(pyqt-builder) > > %description >@@ -43,34 +52,34 @@ data. > > #----------------------------------------------------------------- > >-%package -n %{libname_qt5} >-Summary: Qt5 library for %{name} >+%package -n %{libname_qt} >+Summary: Qt%{QtV} library for %{name} > Group: Development/KDE and Qt > >-%description -n %{libname_qt5} >-Qt5 library for %{name}. >+%description -n %{libname_qt} >+Qt%{QtV} library for %{name}. > >-%files -n %{libname_qt5} >+%files -n %{libname_qt} > %doc doc/release.txt > %license src/license.txt >-%{_libdir}/libqhexedit-qt5.so.%{major}{,.*} >+%{_libdir}/libqhexedit-qt%{QtV}.so.%{major}{,.*} > > #----------------------------------------------------------------- > >-%package -n %{devname_qt5} >-Summary: Development files for %{name} Qt5 >+%package -n %{devname_qt} >+Summary: Development files for %{name} Qt%{QtV} > Group: Development/KDE and Qt >-Requires: %{libname_qt5} = %{version}-%{release} >-Provides: %{name}-qt5-devel = %{version}-%{release} >+Requires: %{libname_qt} = %{version}-%{release} >+Provides: %{name}-qt%{QtV}-devel = %{version}-%{release} > >-%description -n %{devname_qt5} >-The %{devname_qt5} package contains libraries and header files for >-developing applications that use %{name} Qt5. >+%description -n %{devname_qt} >+The %{devname_qt} package contains libraries and header files for >+developing applications that use %{name} Qt%{QtV}. > >-%files -n %{devname_qt5} >+%files -n %{devname_qt} > %{_includedir}/%{name}/ >-%{_libdir}/libqhexedit-qt5.so >-%{_libdir}/pkgconfig/%{name}-qt5.pc >+%{_libdir}/libqhexedit-qt%{QtV}.so >+%{_libdir}/pkgconfig/%{name}-qt%{QtV}.pc > > #----------------------------------------------------------------- > >@@ -89,59 +98,96 @@ The %{name}-doc package contains the doc > > #----------------------------------------------------------------- > >-%package -n python3-qt5-%{name} >-Summary: Python3 Qt5 bindings for %{name} >+%package -n python3-qt%{QtV}-%{name} >+Summary: Python3 Qt%{QtV} bindings for %{name} > Group: Development/Python >-Requires: %{libname_qt5} = %{version}-%{release} >-%{?python_provide:%python_provide python3-qt5-%{name}} >+Requires: %{libname_qt} = %{version}-%{release} >+%{?python_provide:%python_provide python3-qt%{QtV}-%{name}} > >-%description -n python3-qt5-%{name} >-Python3 Qt5 bindings for %{name}. >+%description -n python3-qt%{QtV}-%{name} >+Python3 Qt%{QtV} bindings for %{name}. > >-%files -n python3-qt5-%{name} >+%files -n python3-qt%{QtV}-%{name} > %{python3_sitearch}/qhexedit.*.so > %{python3_sitearch}/QHexEdit-%{version}*info > > #----------------------------------------------------------------- > >-%package -n python3-qt5-%{name}-devel >-Summary: Development files for the %{name} Qt5 Python3 bindings >+%package -n python3-qt%{QtV}-%{name}-devel >+Summary: Development files for the %{name} Qt%{QtV} Python3 bindings > Group: Development/Python >-Requires: python3-qt5-%{name} = %{version}-%{release} >-Requires: python3-sip6 >-%{?python_provide:%python_provide python3-qt5-%{name}-devel} >+Requires: python3-qt%{QtV}-%{name} = %{version}-%{release} >+Requires: python3-sip%{QtV} >+%{?python_provide:%python_provide python3-qt%{QtV}-%{name}-devel} > >-%description -n python3-qt5-%{name}-devel >-Development files for the %{name} Qt5 Python3 bindings. >+%description -n python3-qt%{QtV}-%{name}-devel >+Development files for the %{name} Qt%{QtV} Python3 bindings. > >-%files -n python3-qt5-%{name}-devel >-%{python3_sitearch}/PyQt5/bindings/qhexedit/ >+%files -n python3-qt%{QtV}-%{name}-devel >+%{python3_sitearch}/PyQt%{QtV}/bindings/qhexedit/ >+ >+#----------------------------------------------------------------- >+ >+%package -n %{plugin_qt} >+Summary: Qt%{QtV} plugin for %{name} >+Group: Development/KDE and Qt >+ >+%description -n %{plugin_qt} >+Qt%{QtV} plugin for %{name}. >+ >+%files -n %{plugin_qt} >+%{_QtV_plugindir}/designer/libqhexeditplugin.so > > #----------------------------------------------------------------- > > %prep > %autosetup -p1 > >+# Use Qt6/PyQt6 for python-sip; just sed the patched files for sip setup >+%if %{QtV} == 6 >+sed -i -e "s/PyQt5/PyQt6/g" {project.py,pyproject.toml} >+sed -i -e "s/Qt_5/Qt_6/g" src/qhexedit.sip >+%endif >+ > # Prevent rpmlint W: doc-file-dependency /usr/share/doc/qhexedit2-doc/html/installdox /usr/bin/perl > rm -f doc/html/installdox > >+%if %QtV == 6 >+sed -i -e "s/\:Background/\:Window/g" example/optionsdialog.cpp >+%endif >+ > %build >-### Build library, qt5 >-mkdir build-lib-qt5 >-pushd build-lib-qt5 >+ >+### Build library, qt >+mkdir build-lib-qt%{QtV} >+pushd build-lib-qt%{QtV} > LDFLAGS="%{ldflags}" \ >-%qmake_qt5 ../src/qhexedit.pro >+%qmake_QtV ../src/qhexedit.pro > %make_build > popd > >-### Build sip bindings, qt5, python3 >-sip-build --qmake=%{_qt5_bindir}/qmake --verbose --build-dir=build-python3-qt5 --no-make >-%make_build -C build-python3-qt5 >+### Build sip bindings, qt, python3 >+sip-build --qmake=%{_QtV_bindir}/qmake --verbose --build-dir=build-python3-qt%{QtV} --no-make >+%make_build -C build-python3-qt%{QtV} > > ### Build application > mkdir build-example > pushd build-example >-%qmake_qt5 ../example/qhexedit.pro >+%qmake_QtV ../example/qhexedit.pro >+%make_build >+popd >+ >+### Build qt-plugin >+mkdir build-plugin >+pushd build-plugin >+%qmake_QtV ../src/qhexeditplugin.pro >+%make_build >+popd >+ >+### Build tests >+mkdir build-test >+pushd build-test >+%qmake_QtV ../test/chunks.pro > %make_build > popd > >@@ -151,26 +197,38 @@ install -d %{buildroot}%{_includedir}/%{ > install -m 0644 src/*.h %{buildroot}%{_includedir}/%{name} > > install -d %{buildroot}%{_libdir} >-chmod 0755 build-lib-qt5/*.so.*.* >-cp -a build-lib-qt5/*.so* %{buildroot}%{_libdir} >+chmod 0755 build-lib-qt%{QtV}/*.so.*.* >+cp -a build-lib-qt%{QtV}/*.so* %{buildroot}%{_libdir} > > ### pkg-config files > install -d %{buildroot}%{_libdir}/pkgconfig/ >-cat > %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc <<EOF >+cat > %{buildroot}%{_libdir}/pkgconfig/%{name}-qt%{QtV}.pc <<EOF > libdir=%{_libdir} > includedir=%{_includedir} > >-Name: %{name}-qt5 >-Description: Binary Editor for Qt5 >+Name: %{name}-qt%{QtV} >+Description: Binary Editor for Qt%{QtV} > Version: %{version} > Cflags: -I\${includedir} >-Libs: -L\${libdir} -lqhexedit-qt5 >+Libs: -L\${libdir} -lqhexedit-qt%{QtV} > EOF > > ### Python bindings > # Distutils does not support --build-base with install, you need to build also... >-%make_install INSTALL_ROOT=%{buildroot} -C build-python3-qt5 >+%make_install INSTALL_ROOT=%{buildroot} -C build-python3-qt%{QtV} > > ### Application > install -Dpm 0755 build-example/qhexedit %{buildroot}%{_bindir}/qhexedit > desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ %{SOURCE1} >+ >+### Qt designer plugin >+install -d %{buildroot}%{_QtV_plugindir}/designer >+install -m 0755 build-plugin/*.so %{buildroot}%{_QtV_plugindir}/designer >+ >+%check >+pushd build-test >+mkdir -p logs >+./chunks >+t=$(grep NOK logs/Summary.log) [ -n "${t-}" ] && \ >+echo -e "Failed tests:\n$t" || echo "All tests passed!" >+popd
--- qhexedit2/qhexedit2.spec 2024-07-13 14:29:39.977824719 +0300 +++ SPECS/qhexedit2.spec 2024-07-13 22:31:55.574806133 +0300 @@ -1,11 +1,23 @@ +%define QtV 6 +%if %QtV == 6 +%define qmake_QtV %qmake_qt6 +%define _QtV_bindir %{_qt6_bindir} +%define _QtV_plugindir %{_qt6_plugindir} +%else +%define qmake_QtV %qmake_qt5 +%define _QtV_bindir %{_qt5_bindir} +%define _QtV_plugindir %{_qt5_plugindir} +%endif + %define major 4 -%define libname_qt5 %mklibname %{name}-qt5_ %{major} -%define devname_qt5 %mklibname %{name}-qt5 -d +%define libname_qt %mklibname %{name}-qt%{QtV}_ %{major} +%define devname_qt %mklibname %{name}-qt%{QtV} -d +%define plugin_qt %mklibname %{name}-plugin-qt%{QtV} Name: qhexedit2 # Remember to also update version in qhexedit2_build.patch in the setup.py hunk Version: 0.8.9 -Release: %mkrel 6 +Release: %mkrel 6.1 Summary: Binary Editor for Qt Group: Development/KDE and Qt License: LGPLv2 @@ -19,15 +31,12 @@ Patch1: sip5.patch BuildRequires: desktop-file-utils BuildRequires: gcc-c++ -BuildRequires: make -BuildRequires: pkgconfig(Qt5Core) -BuildRequires: pkgconfig(Qt5Gui) -BuildRequires: pkgconfig(Qt5PrintSupport) -BuildRequires: pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(Qt%{QtV}Core) +BuildRequires: pkgconfig(Qt%{QtV}Widgets) +BuildRequires: pkgconfig(Qt%{QtV}Designer) BuildRequires: pkgconfig(python3) -BuildRequires: python3-pyqt5-sip -BuildRequires: python3-qt5-devel -BuildRequires: python3-sip6 +BuildRequires: python3-pyqt%{QtV}-sip +BuildRequires: python3-qt%{QtV}-devel BuildRequires: python3dist(pyqt-builder) %description @@ -43,34 +52,34 @@ data. #----------------------------------------------------------------- -%package -n %{libname_qt5} -Summary: Qt5 library for %{name} +%package -n %{libname_qt} +Summary: Qt%{QtV} library for %{name} Group: Development/KDE and Qt -%description -n %{libname_qt5} -Qt5 library for %{name}. +%description -n %{libname_qt} +Qt%{QtV} library for %{name}. -%files -n %{libname_qt5} +%files -n %{libname_qt} %doc doc/release.txt %license src/license.txt -%{_libdir}/libqhexedit-qt5.so.%{major}{,.*} +%{_libdir}/libqhexedit-qt%{QtV}.so.%{major}{,.*} #----------------------------------------------------------------- -%package -n %{devname_qt5} -Summary: Development files for %{name} Qt5 +%package -n %{devname_qt} +Summary: Development files for %{name} Qt%{QtV} Group: Development/KDE and Qt -Requires: %{libname_qt5} = %{version}-%{release} -Provides: %{name}-qt5-devel = %{version}-%{release} +Requires: %{libname_qt} = %{version}-%{release} +Provides: %{name}-qt%{QtV}-devel = %{version}-%{release} -%description -n %{devname_qt5} -The %{devname_qt5} package contains libraries and header files for -developing applications that use %{name} Qt5. +%description -n %{devname_qt} +The %{devname_qt} package contains libraries and header files for +developing applications that use %{name} Qt%{QtV}. -%files -n %{devname_qt5} +%files -n %{devname_qt} %{_includedir}/%{name}/ -%{_libdir}/libqhexedit-qt5.so -%{_libdir}/pkgconfig/%{name}-qt5.pc +%{_libdir}/libqhexedit-qt%{QtV}.so +%{_libdir}/pkgconfig/%{name}-qt%{QtV}.pc #----------------------------------------------------------------- @@ -89,59 +98,96 @@ The %{name}-doc package contains the doc #----------------------------------------------------------------- -%package -n python3-qt5-%{name} -Summary: Python3 Qt5 bindings for %{name} +%package -n python3-qt%{QtV}-%{name} +Summary: Python3 Qt%{QtV} bindings for %{name} Group: Development/Python -Requires: %{libname_qt5} = %{version}-%{release} -%{?python_provide:%python_provide python3-qt5-%{name}} +Requires: %{libname_qt} = %{version}-%{release} +%{?python_provide:%python_provide python3-qt%{QtV}-%{name}} -%description -n python3-qt5-%{name} -Python3 Qt5 bindings for %{name}. +%description -n python3-qt%{QtV}-%{name} +Python3 Qt%{QtV} bindings for %{name}. -%files -n python3-qt5-%{name} +%files -n python3-qt%{QtV}-%{name} %{python3_sitearch}/qhexedit.*.so %{python3_sitearch}/QHexEdit-%{version}*info #----------------------------------------------------------------- -%package -n python3-qt5-%{name}-devel -Summary: Development files for the %{name} Qt5 Python3 bindings +%package -n python3-qt%{QtV}-%{name}-devel +Summary: Development files for the %{name} Qt%{QtV} Python3 bindings Group: Development/Python -Requires: python3-qt5-%{name} = %{version}-%{release} -Requires: python3-sip6 -%{?python_provide:%python_provide python3-qt5-%{name}-devel} +Requires: python3-qt%{QtV}-%{name} = %{version}-%{release} +Requires: python3-sip%{QtV} +%{?python_provide:%python_provide python3-qt%{QtV}-%{name}-devel} -%description -n python3-qt5-%{name}-devel -Development files for the %{name} Qt5 Python3 bindings. +%description -n python3-qt%{QtV}-%{name}-devel +Development files for the %{name} Qt%{QtV} Python3 bindings. -%files -n python3-qt5-%{name}-devel -%{python3_sitearch}/PyQt5/bindings/qhexedit/ +%files -n python3-qt%{QtV}-%{name}-devel +%{python3_sitearch}/PyQt%{QtV}/bindings/qhexedit/ + +#----------------------------------------------------------------- + +%package -n %{plugin_qt} +Summary: Qt%{QtV} plugin for %{name} +Group: Development/KDE and Qt + +%description -n %{plugin_qt} +Qt%{QtV} plugin for %{name}. + +%files -n %{plugin_qt} +%{_QtV_plugindir}/designer/libqhexeditplugin.so #----------------------------------------------------------------- %prep %autosetup -p1 +# Use Qt6/PyQt6 for python-sip; just sed the patched files for sip setup +%if %{QtV} == 6 +sed -i -e "s/PyQt5/PyQt6/g" {project.py,pyproject.toml} +sed -i -e "s/Qt_5/Qt_6/g" src/qhexedit.sip +%endif + # Prevent rpmlint W: doc-file-dependency /usr/share/doc/qhexedit2-doc/html/installdox /usr/bin/perl rm -f doc/html/installdox +%if %QtV == 6 +sed -i -e "s/\:Background/\:Window/g" example/optionsdialog.cpp +%endif + %build -### Build library, qt5 -mkdir build-lib-qt5 -pushd build-lib-qt5 + +### Build library, qt +mkdir build-lib-qt%{QtV} +pushd build-lib-qt%{QtV} LDFLAGS="%{ldflags}" \ -%qmake_qt5 ../src/qhexedit.pro +%qmake_QtV ../src/qhexedit.pro %make_build popd -### Build sip bindings, qt5, python3 -sip-build --qmake=%{_qt5_bindir}/qmake --verbose --build-dir=build-python3-qt5 --no-make -%make_build -C build-python3-qt5 +### Build sip bindings, qt, python3 +sip-build --qmake=%{_QtV_bindir}/qmake --verbose --build-dir=build-python3-qt%{QtV} --no-make +%make_build -C build-python3-qt%{QtV} ### Build application mkdir build-example pushd build-example -%qmake_qt5 ../example/qhexedit.pro +%qmake_QtV ../example/qhexedit.pro +%make_build +popd + +### Build qt-plugin +mkdir build-plugin +pushd build-plugin +%qmake_QtV ../src/qhexeditplugin.pro +%make_build +popd + +### Build tests +mkdir build-test +pushd build-test +%qmake_QtV ../test/chunks.pro %make_build popd @@ -151,26 +197,38 @@ install -d %{buildroot}%{_includedir}/%{ install -m 0644 src/*.h %{buildroot}%{_includedir}/%{name} install -d %{buildroot}%{_libdir} -chmod 0755 build-lib-qt5/*.so.*.* -cp -a build-lib-qt5/*.so* %{buildroot}%{_libdir} +chmod 0755 build-lib-qt%{QtV}/*.so.*.* +cp -a build-lib-qt%{QtV}/*.so* %{buildroot}%{_libdir} ### pkg-config files install -d %{buildroot}%{_libdir}/pkgconfig/ -cat > %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc <<EOF +cat > %{buildroot}%{_libdir}/pkgconfig/%{name}-qt%{QtV}.pc <<EOF libdir=%{_libdir} includedir=%{_includedir} -Name: %{name}-qt5 -Description: Binary Editor for Qt5 +Name: %{name}-qt%{QtV} +Description: Binary Editor for Qt%{QtV} Version: %{version} Cflags: -I\${includedir} -Libs: -L\${libdir} -lqhexedit-qt5 +Libs: -L\${libdir} -lqhexedit-qt%{QtV} EOF ### Python bindings # Distutils does not support --build-base with install, you need to build also... -%make_install INSTALL_ROOT=%{buildroot} -C build-python3-qt5 +%make_install INSTALL_ROOT=%{buildroot} -C build-python3-qt%{QtV} ### Application install -Dpm 0755 build-example/qhexedit %{buildroot}%{_bindir}/qhexedit desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ %{SOURCE1} + +### Qt designer plugin +install -d %{buildroot}%{_QtV_plugindir}/designer +install -m 0755 build-plugin/*.so %{buildroot}%{_QtV_plugindir}/designer + +%check +pushd build-test +mkdir -p logs +./chunks +t=$(grep NOK logs/Summary.log) [ -n "${t-}" ] && \ +echo -e "Failed tests:\n$t" || echo "All tests passed!" +popd
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33398
: 14589 |
14590