- %build: use %qmake-qt? macro variant
- RFE: Qwt build for Qt5 (#1164515)
epel9
Rex Dieter 10 years ago
parent 82470c42a3
commit 152eea0751

@ -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)

@ -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
};
/*!

@ -2,24 +2,40 @@
# trim changelog included in binary rpms # trim changelog included in binary rpms
%global _changelog_trimtime %(date +%s -d "1 year ago") %global _changelog_trimtime %(date +%s -d "1 year ago")
# build qt5 support (or not)
%define qt5 1
Name: qwt Name: qwt
Summary: Qt Widgets for Technical Applications Summary: Qt Widgets for Technical Applications
Version: 6.1.1 Version: 6.1.1
Release: 2%{?dist} Release: 3%{?dist}
License: LGPLv2 with exceptions License: LGPLv2 with exceptions
URL: http://qwt.sourceforge.net URL: http://qwt.sourceforge.net
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
## upstream patches
# fix build with qt-5.4
Patch1: qwt-qt54.patch
## upstreamable patches ## upstreamable patches
# fix pkgconfig support # fix pkgconfig support
Patch50: qwt-6.1.1-pkgconfig.patch Patch50: qwt-6.1.1-pkgconfig.patch
# use QT_INSTALL_ paths instead of custom prefix # use QT_INSTALL_ paths instead of custom prefix
Patch51: qwt-6.1.0-qt_install_paths.patch 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) BuildRequires: pkgconfig(QtGui) pkgconfig(QtSvg)
# silly buildsys quirk
BuildConflicts: qwt-devel
%{?_qt4_version:Requires: qt4%{?_isa} >= %{_qt4_version}} %{?_qt4_version:Requires: qt4%{?_isa} >= %{_qt4_version}}
Provides: qwt6 = %{version}-%{release} Provides: qwt6 = %{version}-%{release}
Provides: qwt6%{_isa} = %{version}-%{release} Provides: qwt6%{_isa} = %{version}-%{release}
@ -44,24 +60,56 @@ BuildArch: noarch
%description doc %description doc
%{summary}. %{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 %prep
%setup -q %setup -q
%patch1 -p0 -b .qt54
%patch50 -p1 -b .pkgconfig %patch50 -p1 -b .pkgconfig
%patch51 -p1 -b .qt_install_paths %patch51 -p1 -b .qt_install_paths
%patch52 -p1 -b .qt5
%build %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} mkdir %{_target_platform}
pushd %{_target_platform} pushd %{_target_platform}
%{_qt4_qmake} QWT_CONFIG+=QwtPkgConfig .. %{qmake_qt4} QWT_CONFIG+=QwtPkgConfig ..
make %{?_smp_mflags} make %{?_smp_mflags}
popd popd
%install %install
%if 0%{?qt5}
make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-qt5
%endif
make install INSTALL_ROOT=%{buildroot} -C %{_target_platform} make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}
# fixup doc path bogosity # fixup doc path bogosity
@ -72,6 +120,14 @@ mkdir -p %{buildroot}%{_mandir}
mv %{buildroot}%{_qt4_docdir}/html/man/man3 \ mv %{buildroot}%{_qt4_docdir}/html/man/man3 \
%{buildroot}%{_mandir}/ %{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 %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
@ -97,10 +153,41 @@ mv %{buildroot}%{_qt4_docdir}/html/man/man3 \
%dir %{_qt4_docdir} %dir %{_qt4_docdir}
%dir %{_qt4_docdir}/html/ %dir %{_qt4_docdir}/html/
%{_qt4_docdir}/html/qwt/ %{_qt4_docdir}/html/qwt/
%if 0%{?qt5}
%dir %{_qt5_docdir}
%dir %{_qt5_docdir}/html/
%{_qt5_docdir}/html/qwt/
%endif
%{_mandir}/man3/* %{_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 %changelog
* Mon Dec 01 2014 Rex Dieter <rdieter@fedoraproject.org> - 6.1.1-3
- %%build: use %%qmake-qt? macro variant
- RFE: Qwt build for Qt5 (#1164515)
* Tue Oct 28 2014 Rex Dieter <rdieter@fedoraproject.org> 6.1.1-2 * Tue Oct 28 2014 Rex Dieter <rdieter@fedoraproject.org> 6.1.1-2
- do out-of-src build (prep for qt5 build maybe coming someday) - do out-of-src build (prep for qt5 build maybe coming someday)

Loading…
Cancel
Save