From c9f3764079f3c24482a9bcc10b5ecad0b1c7f198 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 22 Jan 2021 09:41:44 +0100 Subject: [PATCH] Initial package --- README.md | 3 -- macros.qt6 | 64 ++++++++++++++++++++++++++ macros.qt6-srpm | 9 ++++ qmake-qt6.sh | 10 ++++ qt6.spec | 119 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 202 insertions(+), 3 deletions(-) delete mode 100644 README.md create mode 100644 macros.qt6 create mode 100644 macros.qt6-srpm create mode 100755 qmake-qt6.sh create mode 100644 qt6.spec diff --git a/README.md b/README.md deleted file mode 100644 index 30103c8..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# qt6 - -The qt6 package diff --git a/macros.qt6 b/macros.qt6 new file mode 100644 index 0000000..ec17aea --- /dev/null +++ b/macros.qt6 @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: MIT + +%_qt6_build_type RelWithDebInfo +%_qt6_build_tool ninja + +%_qt6_prefix %{_prefix} +%_qt6_archdatadir %{_libdir}/qt6 +%_qt6_bindir %{_libdir}/qt6/bin +%_qt6_datadir %{_datadir}/qt6 +%_qt6_docdir %{_docdir}/qt6 +%_qt6_examplesdir %{_qt6_archdatadir}/examples +%_qt6_headerdir %{_includedir}/qt6 +%_qt6_includedir %{_includedir}/qt6 +%_qt6_importdir %{_qt6_archdatadir}/imports +%_qt6_libdir %{_libdir} +%_qt6_libexecdir %{_qt6_archdatadir}/libexec +%_qt6_mkspecsdir %{_qt6_archdatadir}/mkspecs +%_qt6_plugindir %{_qt6_archdatadir}/plugins +%_qt6_qmldir %{_qt6_archdatadir}/qml +%_qt6_qmake @@QMAKE@@ +%_qt6_settingsdir %{_sysconfdir}/xdg +%_qt6_sysconfdir %{_qt6_settingsdir} +%_qt6_translationdir %{_datadir}/qt6/translations + +%_qt6_cflags %{nil}@@QT6_CFLAGS@@ +%_qt6_cxxflags %{nil}@@QT6_CXXFLAGS@@ +%_qt6_ldflags %{nil}%{?__global_ldflags} @@QT6_RPM_LD_FLAGS@@ +%_qt6_optflags %{optflags} @@QT6_RPM_OPT_FLAGS@@ + +%_qt6_qmake_flags \\\ + QMAKE_CFLAGS_DEBUG="${CFLAGS:-%{_qt6_optflags} %{?_qt6_cflags}}" \\\ + QMAKE_CFLAGS_RELEASE="${CFLAGS:-%{_qt6_optflags} %{?_qt6_cflags}}" \\\ + QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS:-%{_qt6_optflags} %{?_qt6_cxxflags}}" \\\ + QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS:-%{_qt6_optflags} %{?_qt6_cxxflags}}" \\\ + QMAKE_LFLAGS_DEBUG="${LDFLAGS:-%{_qt6_ldflags}}" \\\ + QMAKE_LFLAGS_RELEASE="${LDFLAGS:-%{_qt6_ldflags}}" \\\ + QMAKE_STRIP= + +%qmake_qt6 %{_qt6_qmake} %{?_qt6_qmake_flags} + +%qmake_qt6_wrapper @@QMAKE_QT6_WRAPPER@@ + +%cmake_qt6 \ + %cmake -DCMAKE_BUILD_TYPE=%{_qt6_build_type} \\\ + -DCMAKE_INSTALL_PREFIX=%{_qt6_prefix} \\\ +%if "%_qt6_build_tool" == "ninja" \ + -GNinja \\\ +%else \ + -G"Unix Makefiles" \\\ +%endif \ + -DCMAKE_INSTALL_PREFIX=%{_qt6_prefix} \\\ + -DINSTALL_ARCHDATADIR=%{_qt6_archdatadir} \\\ + -DINSTALL_BINDIR=%{_qt6_bindir} \\\ + -DINSTALL_LIBDIR=%{_qt6_libdir} \\\ + -DINSTALL_LIBEXECDIR=%{_qt6_libdir} \\\ + -DINSTALL_DATADIR=%{_qt6_datadir} \\\ + -DINSTALL_DOCDIR=%{_qt6_docdir} \\\ + -DINSTALL_INCLUDEDIR=%{_qt6_headerdir} \\\ + -DINSTALL_EXAMPLESDIR=%{_qt6_examplesdir} \\\ + -DINSTALL_MKSPECSDIR=%{_qt6_mkspecsdir} \\\ + -DINSTALL_PLUGINSDIR=%{_qt6_plugindir} \\\ + -DINSTALL_QMLDIR=%{_qt6_qmldir} \\\ + -DINSTALL_SYSCONFDIR=%{_qt6_sysconfdir} \\\ + -DINSTALL_TRANSLATIONSDIR=%{_qt6_translationdir} diff --git a/macros.qt6-srpm b/macros.qt6-srpm new file mode 100644 index 0000000..2ba69e0 --- /dev/null +++ b/macros.qt6-srpm @@ -0,0 +1,9 @@ + +# # the architectures theoretically supported by the version of V8 used (#1298011) +# # You may need some minor patching to build on one of the secondary +# # architectures, e.g., to add to the Qt -> Chromium -> V8 arch translations. +# # If you cannot get this package to build on your secondary architecure, please: +# # * remove your architecture from this list AND +# # * put #1298011 onto your ExcludeArch tracker. +%qt6_qtwebengine_arches %{ix86} x86_64 %{arm} aarch64 mips mipsel mips64el + diff --git a/qmake-qt6.sh b/qmake-qt6.sh new file mode 100755 index 0000000..beb29fe --- /dev/null +++ b/qmake-qt6.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# An attempt at providing a qmake wrapper for projects that +# lack native qmake support (ie, qmake is run by buildsystem +# instead of developer or fedora packager). + +QMAKE="$(rpm --eval %{_qt6_qmake})" +QMAKE_FLAGS="$(rpm --eval %{?_qt6_qmake_flags})" + +eval $QMAKE $QMAKE_FLAGS $@ diff --git a/qt6.spec b/qt6.spec new file mode 100644 index 0000000..31372c0 --- /dev/null +++ b/qt6.spec @@ -0,0 +1,119 @@ + +Name: qt6 +Version: 6.0.0 +Release: 1%{?dist} +Summary: Qt6 meta package +License: GPLv3 +URL: https://getfedora.org/ +Source0: macros.qt6 +Source1: macros.qt6-srpm +Source2: qmake-qt6.sh +BuildArch: noarch + +Requires: qt6-qt5compat +Requires: qt6-qt3d +Requires: qt6-qtbase +Requires: qt6-qtbase-gui +Requires: qt6-qtbase-mysql +Requires: qt6-qtbase-postgresql +Requires: qt6-qtdeclarative +Requires: qt6-qtdoc +Requires: qt6-qtimageformats +Requires: qt6-qtnetworkauth +Requires: qt6-qtquickcontrols2 +Requires: qt6-qtquick3d +Requires: qt6-qtquicktimeline +Requires: qt6-qtshadertools +Requires: qt6-qtsvg +Requires: qt6-qttools +Requires: qt6-qtwayland + +%description +%{summary}. + +%package devel +Summary: Qt6 meta devel package +Requires: qt6-rpm-macros +Requires: qt6-qttools-static +Requires: qt6-qtdeclarative-static +Requires: qt6-qtbase-static +Requires: qt6-designer +Requires: qt6-qdoc +Requires: qt6-qhelpgenerator +Requires: qt6-linguist +Requires: qt6-qt3d-devel +Requires: qt6-qt5compat-devel +Requires: qt6-qtbase-devel +Requires: qt6-qtdeclarative-devel +Requires: qt6-qtimageformats-devel +Requires: qt6-qtnetworkauth-devel +Requires: qt6-qtquickcontrols2-devel +Requires: qt6-qtquick3d-devel +Requires: qt6-qtquicktimeline-devel +Requires: qt6-qtshadertools-devel +Requires: qt6-qtsvg-devel +Requires: qt6-qttools-devel +Requires: qt6-qtwayland-devel + +%description devel +%{summary}. + +%package rpm-macros +Summary: RPM macros for building Qt6 and KDE Frameworks 5 packages +Requires: cmake >= 3 +Requires: gcc-c++ +%description rpm-macros +%{summary}. + +%package srpm-macros +Summary: RPM macros for source Qt6 packages +%description srpm-macros +%{summary}. + + +%install +install -Dpm644 %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.qt6 +install -Dpm644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.qt6-srpm +install -Dpm755 %{SOURCE2} %{buildroot}%{_bindir}/qmake-qt6.sh +mkdir -p %{buildroot}%{_datadir}/qt6/wrappers +ln -s %{_bindir}/qmake-qt6.sh %{buildroot}%{_datadir}/qt6/wrappers/qmake-qt6 +ln -s %{_bindir}/qmake-qt6.sh %{buildroot}%{_datadir}/qt6/wrappers/qmake + +# substitute custom flags, and the path to binaries: binaries referenced from +# macros should not change if an application is built with a different prefix. +# %_libdir is left as /usr/%{_lib} (e.g.) so that the resulting macros are +# architecture independent, and don't hardcode /usr/lib or /usr/lib64. +sed -i \ + -e "s|@@QT6_CFLAGS@@|%{?qt6_cflags}|g" \ + -e "s|@@QT6_CXXFLAGS@@|%{?qt6_cxxflags}|g" \ + -e "s|@@QT6_RPM_LD_FLAGS@@|%{?qt6_rpm_ld_flags}|g" \ + -e "s|@@QT6_RPM_OPT_FLAGS@@|%{?qt6_rpm_opt_flags}|g" \ + -e "s|@@QMAKE@@|%{_prefix}/%%{_lib}/qt6/bin/qmake|g" \ + -e "s|@@QMAKE_QT6_WRAPPER@@|%{_bindir}/qmake-qt6.sh|g" \ + %{buildroot}%{_rpmconfigdir}/macros.d/macros.qt6 + +%if 0%{?metapackage} +mkdir -p %{buildroot}%{_docdir}/qt6 +mkdir -p %{buildroot}%{_docdir}/qt6-devel +echo "- Qt6 meta package" > %{buildroot}%{_docdir}/qt6/README +echo "- Qt6 devel meta package" > %{buildroot}%{_docdir}/qt6-devel/README + +%files +%{_docdir}/qt6/README + +%files devel +%{_docdir}/qt6-devel/README +%endif + +%files rpm-macros +%{_rpmmacrodir}/macros.qt6 +%{_bindir}/qmake-qt6.sh +%{_datadir}/qt6/wrappers/ + +%files srpm-macros +%{_rpmmacrodir}/macros.qt6-srpm + + +%changelog +* Wed Jan 06 2021 Jan Grulich - 6.0.0-1 +- 6.0.0