From d048a8b398ffd67d4d85a97a4f2793383f4c3e6b5d92cc5e40744d075afd58d0 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 1 Feb 2022 07:57:07 +0000 Subject: [PATCH] qt6 OBS-URL: https://build.opensuse.org/package/show/network/datovka?expand=0&rev=46 --- datovka-fix-pro.patch | 2 +- datovka.changes | 1 + datovka.spec | 54 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/datovka-fix-pro.patch b/datovka-fix-pro.patch index dd5c143..2b47748 100644 --- a/datovka-fix-pro.patch +++ b/datovka-fix-pro.patch @@ -40,7 +40,7 @@ Index: datovka-4.13.0/datovka.pro - -g -O0 -std=c++11 \ - -Wall -Wextra -pedantic \ - -Wdate-time -Wformat -Werror=format-security -+ -g -std=c++11 $$(CXXFLAGS) \ ++ -g $$(CXXFLAGS) \ + -Wall -Wextra -pedantic #INCLUDEPATH += diff --git a/datovka.changes b/datovka.changes index 0eea0c7..0872b1f 100644 --- a/datovka.changes +++ b/datovka.changes @@ -17,6 +17,7 @@ Tue Feb 1 06:50:56 UTC 2022 - Jiri Slaby midnight and the time zone difference. * Suppressed notification dialogues when uploading into records management service as too many of them were generated occasionally. +- switch to Qt6 on Tumbleweed ------------------------------------------------------------------- Mon Aug 30 06:35:45 UTC 2021 - Jiri Slaby diff --git a/datovka.spec b/datovka.spec index 42d4124..95a93de 100644 --- a/datovka.spec +++ b/datovka.spec @@ -16,6 +16,16 @@ # +%if 0%{?suse_version} > 1500 +%define qt_version 6 +%define qt_version_full 6.2.0 +%define lrelease lrelease6 +%else +%define qt_version 5 +%define qt_version_full 5.4.1 +%define lrelease lrelease-qt5 +%endif + Name: datovka Version: 4.19.0 Release: 0 @@ -27,18 +37,28 @@ Source0: https://secure.nic.cz/files/datove_schranky/%{version}/%{name}-% Source1: https://secure.nic.cz/files/datove_schranky/%{version}/%{name}-%{version}.tar.xz.sha256 # PATCH-FIX-UPSTREAM: remove some issues with current .pro file Patch0: datovka-fix-pro.patch +%if 0%{qt_version} == 6 +# private-devel is only temporary to fix "Library 'libatomic' is not defined." +BuildRequires: qt6-base-private-devel +BuildRequires: qt6-tools-linguist +%else BuildRequires: libqt5-linguist +%endif BuildRequires: openssl-devel BuildRequires: pkgconfig -BuildRequires: pkgconfig(Qt5Core) >= 5.2.0 -BuildRequires: pkgconfig(Qt5Gui) >= 5.2.0 -BuildRequires: pkgconfig(Qt5Network) >= 5.2.0 -BuildRequires: pkgconfig(Qt5PrintSupport) >= 5.2.0 -BuildRequires: pkgconfig(Qt5Sql) >= 5.2.0 -BuildRequires: pkgconfig(Qt5Svg) >= 5.2.0 -BuildRequires: pkgconfig(Qt5Widgets) >= 5.2.0 +BuildRequires: cmake(Qt%{qt_version}Core) >= %{qt_version_full} +BuildRequires: cmake(Qt%{qt_version}Gui) >= %{qt_version_full} +BuildRequires: cmake(Qt%{qt_version}Network) >= %{qt_version_full} +BuildRequires: cmake(Qt%{qt_version}PrintSupport) >= %{qt_version_full} +BuildRequires: cmake(Qt%{qt_version}Sql) >= %{qt_version_full} +BuildRequires: cmake(Qt%{qt_version}Svg) >= %{qt_version_full} +BuildRequires: cmake(Qt%{qt_version}Widgets) >= %{qt_version_full} BuildRequires: pkgconfig(libdatovka) >= 0.1.2 +%if 0%{qt_version} == 6 +Requires: qt6-sql-sqlite +%else Requires: libqt5_sql_backend +%endif Recommends: %{name}-lang # Included inside with different approach Obsoletes: python-dslib @@ -59,18 +79,31 @@ Data Box Information System) SOAP services as defined in Czech ISDS Act %prep %autosetup -p1 sed -i \ - -e 's:lrelease:lrelease-qt5:g' \ + -e 's:lrelease:%{lrelease}:g' \ %{name}.pro %build export CFLAGS="%{optflags}" -export CXXFLAGS="%{optflags}" -lrelease-qt5 datovka.pro +%if 0%{qt_version} == 6 +export CXXFLAGS="-std=c++17 %{optflags}" +%else +export CXXFLAGS="-std=c++11 %{optflags}" +%endif +%{lrelease} datovka.pro +%if 0%{qt_version} == 6 +%qmake6 PREFIX=%{_prefix} DISABLE_VERSION_CHECK_BY_DEFAULT=1 +%qmake6_build +%else %qmake5 PREFIX=%{_prefix} DISABLE_VERSION_CHECK_BY_DEFAULT=1 %make_jobs +%endif %install +%if 0%{qt_version} == 6 +%qmake6_install +%else %qmake5_install +%endif # fix desktop file sed -i \ @@ -99,6 +132,7 @@ rm -rf %{buildroot}%{_datadir}/datovka/doc %dir %{_datadir}/datovka/localisations/ %{_datadir}/datovka/localisations/datovka_cs.qm %{_datadir}/datovka/localisations/datovka_en.qm +%dir %{_datadir}/icons/hicolor/ %{_datadir}/icons/hicolor/* %changelog