From 152eea075129e9824a92eb81426ce6e689268200 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 1 Dec 2014 08:18:05 -0600 Subject: [PATCH] 6.1.1-3 - %build: use %qmake-qt? macro variant - RFE: Qwt build for Qt5 (#1164515) --- qwt-qt5.patch | 28 ++++++++++++++++ qwt-qt54.patch | 47 ++++++++++++++++++++++++++ qwt.spec | 91 ++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 qwt-qt5.patch create mode 100644 qwt-qt54.patch diff --git a/qwt-qt5.patch b/qwt-qt5.patch new file mode 100644 index 0000000..058a550 --- /dev/null +++ b/qwt-qt5.patch @@ -0,0 +1,28 @@ +diff -up qwt-6.1.1/qwtfunctions.pri.qt5 qwt-6.1.1/qwtfunctions.pri +--- qwt-6.1.1/qwtfunctions.pri.qt5 2014-09-18 09:59:46.659028741 -0500 ++++ qwt-6.1.1/qwtfunctions.pri 2014-12-01 07:23:30.215055279 -0600 +@@ -12,7 +12,12 @@ + defineReplace(qwtLibraryTarget) { + + unset(LIBRARY_NAME) ++ ++ greaterThan(QT_MAJOR_VERSION, 4) { ++ LIBRARY_NAME = $${1}-qt$${QT_MAJOR_VERSION} ++ } else { + LIBRARY_NAME = $$1 ++ } + + mac:contains(QWT_CONFIG, QwtFramework) { + +@@ -35,7 +40,11 @@ defineReplace(qwtLibraryTarget) { + + defineTest(qwtAddLibrary) { + ++ greaterThan(QT_MAJOR_VERSION, 4) { ++ LIB_NAME = $${1}-qt$${QT_MAJOR_VERSION} ++ } else { + LIB_NAME = $$1 ++ } + + unset(LINKAGE) + diff --git a/qwt-qt54.patch b/qwt-qt54.patch new file mode 100644 index 0000000..668db54 --- /dev/null +++ b/qwt-qt54.patch @@ -0,0 +1,47 @@ +Index: src/qwt_transform.cpp +=================================================================== +--- src/qwt_transform.cpp (revision 2064) ++++ src/qwt_transform.cpp (revision 2066) +@@ -14,12 +14,24 @@ + #define qExp(x) ::exp(x) + #endif + ++#if QT_VERSION >= 0x050400 ++ + //! Smallest allowed value for logarithmic scales: 1.0e-150 ++const double QwtLogTransform::LogMin = 1.0e-150; ++ ++//! Largest allowed value for logarithmic scales: 1.0e150 ++const double QwtLogTransform::LogMax = 1.0e150; ++ ++#else ++ ++//! Smallest allowed value for logarithmic scales: 1.0e-150 + QT_STATIC_CONST_IMPL double QwtLogTransform::LogMin = 1.0e-150; + + //! Largest allowed value for logarithmic scales: 1.0e150 + QT_STATIC_CONST_IMPL double QwtLogTransform::LogMax = 1.0e150; + ++#endif ++ + //! Constructor + QwtTransform::QwtTransform() + { +Index: src/qwt_transform.h +=================================================================== +--- src/qwt_transform.h (revision 2064) ++++ src/qwt_transform.h (revision 2066) +@@ -107,8 +107,13 @@ + + virtual QwtTransform *copy() const; + ++#if QT_VERSION >= 0x050400 ++ static const double LogMin; ++ static const double LogMax; ++#else + QT_STATIC_CONST double LogMin; + QT_STATIC_CONST double LogMax; ++#endif + }; + + /*! diff --git a/qwt.spec b/qwt.spec index 6a32265..03631db 100644 --- a/qwt.spec +++ b/qwt.spec @@ -2,24 +2,40 @@ # trim changelog included in binary rpms %global _changelog_trimtime %(date +%s -d "1 year ago") +# build qt5 support (or not) +%define qt5 1 + Name: qwt Summary: Qt Widgets for Technical Applications Version: 6.1.1 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPLv2 with exceptions URL: http://qwt.sourceforge.net Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 +## upstream patches +# fix build with qt-5.4 +Patch1: qwt-qt54.patch + ## upstreamable patches # fix pkgconfig support Patch50: qwt-6.1.1-pkgconfig.patch # use QT_INSTALL_ paths instead of custom prefix Patch51: qwt-6.1.0-qt_install_paths.patch +# parallel-installable qt5 version +Patch52: qwt-qt5.patch +%if 0%{?qt5} +BuildRequires: pkgconfig(Qt5Concurrent) pkgconfig(Qt5PrintSupport) pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(Qt5OpenGL) pkgconfig(Qt5Svg) +%endif BuildRequires: pkgconfig(QtGui) pkgconfig(QtSvg) +# silly buildsys quirk +BuildConflicts: qwt-devel %{?_qt4_version:Requires: qt4%{?_isa} >= %{_qt4_version}} + Provides: qwt6 = %{version}-%{release} Provides: qwt6%{_isa} = %{version}-%{release} @@ -44,24 +60,56 @@ BuildArch: noarch %description doc %{summary}. +%if 0%{?qt5} +%package qt5 +Summary: Qt5 Widgets for Technical Applications +Provides: qwt6-qt5 = %{version}-%{release} +Provides: qwt6-qt5%{_isa} = %{version}-%{release} +%description qt5 +%{summary}. + +%package qt5-devel +Summary: Development files for %{name}-qt5 +Provides: qwt6-qt5-devel = %{version}-%{release} +Provides: qwt6-qt5-devel%{_isa} = %{version}-%{release} +Requires: %{name}-qt5%{?_isa} = %{version}-%{release} +%description qt5-devel +%{summary}. +%endif + %prep %setup -q +%patch1 -p0 -b .qt54 + %patch50 -p1 -b .pkgconfig %patch51 -p1 -b .qt_install_paths +%patch52 -p1 -b .qt5 %build +%if 0%{?qt5} +mkdir %{_target_platform}-qt5 +pushd %{_target_platform}-qt5 +%{qmake_qt5} QWT_CONFIG+=QwtPkgConfig .. + +make %{?_smp_mflags} +popd +%endif + mkdir %{_target_platform} pushd %{_target_platform} -%{_qt4_qmake} QWT_CONFIG+=QwtPkgConfig .. +%{qmake_qt4} QWT_CONFIG+=QwtPkgConfig .. make %{?_smp_mflags} popd %install +%if 0%{?qt5} +make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-qt5 +%endif make install INSTALL_ROOT=%{buildroot} -C %{_target_platform} # fixup doc path bogosity @@ -72,6 +120,14 @@ mkdir -p %{buildroot}%{_mandir} mv %{buildroot}%{_qt4_docdir}/html/man/man3 \ %{buildroot}%{_mandir}/ +%if 0%{?qt5} +# nuke qt5 docs, use copies from qt4 build instead +rm -rfv %{buildroot}%{_qt5_docdir}/html/* + +cp -alf %{buildroot}%{_qt4_docdir}/html/qwt/ \ + %{buildroot}%{_qt5_docdir}/html/qwt/ +%endif + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -97,10 +153,41 @@ mv %{buildroot}%{_qt4_docdir}/html/man/man3 \ %dir %{_qt4_docdir} %dir %{_qt4_docdir}/html/ %{_qt4_docdir}/html/qwt/ +%if 0%{?qt5} +%dir %{_qt5_docdir} +%dir %{_qt5_docdir}/html/ +%{_qt5_docdir}/html/qwt/ +%endif %{_mandir}/man3/* +%if 0%{?qt5} +%post qt5 -p /sbin/ldconfig +%postun qt5 -p /sbin/ldconfig + +%files qt5 +%doc COPYING +%doc README +%{_qt5_libdir}/libqwt-qt5.so.6* +%{_qt5_plugindir}/designer/libqwt_designer_plugin.so +%{_qt5_libdir}/libqwtmathml-qt5.so.6* + +%files qt5-devel +%{_qt5_headerdir}/qwt/ +%{_qt5_libdir}/libqwt-qt5.so +%{_qt5_libdir}/libqwtmathml-qt5.so +%{_qt5_libdir}/qt5/mkspecs/features/qwt* +%{_qt5_libdir}/pkgconfig/Qt5Qwt6.pc +%{_qt5_libdir}/pkgconfig/qwtmathml-qt5.pc +%endif + + + %changelog +* Mon Dec 01 2014 Rex Dieter - 6.1.1-3 +- %%build: use %%qmake-qt? macro variant +- RFE: Qwt build for Qt5 (#1164515) + * Tue Oct 28 2014 Rex Dieter 6.1.1-2 - do out-of-src build (prep for qt5 build maybe coming someday)