summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/qwt/README3
-rw-r--r--libraries/qwt/patch-6.1.2-config.diff125
-rw-r--r--libraries/qwt/qwt.SlackBuild51
3 files changed, 168 insertions, 11 deletions
diff --git a/libraries/qwt/README b/libraries/qwt/README
index 918e77a205..ddd2be7307 100644
--- a/libraries/qwt/README
+++ b/libraries/qwt/README
@@ -3,3 +3,6 @@ The Qwt library contains widgets and components which are
primarily useful for technical and scientifical purposes.
It includes a 2-D plotting widget, different kinds of sliders,
and much more.
+
+Support for Qt5 will be included if the qt5 package is detected at build time.
+
diff --git a/libraries/qwt/patch-6.1.2-config.diff b/libraries/qwt/patch-6.1.2-config.diff
new file mode 100644
index 0000000000..7da2db7d5a
--- /dev/null
+++ b/libraries/qwt/patch-6.1.2-config.diff
@@ -0,0 +1,125 @@
+--- qwtconfig.pri.orig 2016-06-13 17:14:23.031601095 +1000
++++ qwtconfig.pri 2018-09-14 14:50:18.247000000 +1000
+@@ -16,11 +16,8 @@
+ # Install paths
+ ######################################################################
+
+-QWT_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX]
+-
+ unix {
+- QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION
+- # QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION-qt-$$QT_VERSION
++ QWT_INSTALL_PREFIX = /usr
+ }
+
+ win32 {
+@@ -29,8 +26,10 @@
+ }
+
+ QWT_INSTALL_DOCS = $${QWT_INSTALL_PREFIX}/doc
+-QWT_INSTALL_HEADERS = $${QWT_INSTALL_PREFIX}/include
+-QWT_INSTALL_LIBS = $${QWT_INSTALL_PREFIX}/lib
++QWT_INSTALL_HEADERS = $${QWT_INSTALL_PREFIX}/include/qwt
++QWT_INSTALL_LIBS = $${QWT_INSTALL_PREFIX}/lib$${LIBDIRSUFFIX}
++
++
+
+ ######################################################################
+ # Designer plugin
+@@ -42,14 +41,12 @@
+ # runtime environment of designer/creator.
+ ######################################################################
+
+-QWT_INSTALL_PLUGINS = $${QWT_INSTALL_PREFIX}/plugins/designer
+-
+ # linux distributors often organize the Qt installation
+ # their way and QT_INSTALL_PREFIX doesn't offer a good
+ # path. Also QT_INSTALL_PREFIX is only one of the default
+ # search paths of the designer - not the Qt creator
+
+-#QWT_INSTALL_PLUGINS = $$[QT_INSTALL_PREFIX]/plugins/designer
++QWT_INSTALL_PLUGINS = $$[QT_INSTALL_PLUGINS]/designer
+
+ ######################################################################
+ # Features
+@@ -63,8 +60,7 @@
+ # with every Qt upgrade.
+ ######################################################################
+
+-QWT_INSTALL_FEATURES = $${QWT_INSTALL_PREFIX}/features
+-# QWT_INSTALL_FEATURES = $$[QT_INSTALL_PREFIX]/features
++QWT_INSTALL_FEATURES = $$[QMAKE_MKSPECS]/features
+
+ ######################################################################
+ # Build the static/shared libraries.
+@@ -141,7 +137,7 @@
+ # Otherwise you have to build them from the examples directory.
+ ######################################################################
+
+-#QWT_CONFIG += QwtExamples
++QWT_CONFIG += QwtExamples
+
+ ######################################################################
+ # The playground is primarily intended for the Qwt development
+@@ -171,5 +167,5 @@
+
+ unix {
+
+- #QWT_CONFIG += QwtPkgConfig
++ QWT_CONFIG += QwtPkgConfig
+ }
+--- src/src.pro.orig 2018-09-14 14:52:33.531000000 +1000
++++ src/src.pro 2018-09-14 14:53:59.816000000 +1000
+@@ -17,7 +17,12 @@
+ QWT_OUT_ROOT = $${OUT_PWD}/..
+
+ TEMPLATE = lib
+-TARGET = $$qwtLibraryTarget(qwt)
++greaterThan(QT_MAJOR_VERSION, 4) {
++ TARGET = $$qwtLibraryTarget(qwt-qt5)
++}
++else {
++ TARGET = $$qwtLibraryTarget(qwt)
++}
+
+ DESTDIR = $${QWT_OUT_ROOT}/lib
+
+--- designer/designer.pro.orig 2016-06-13 17:14:23.019600853 +1000
++++ designer/designer.pro 2018-09-14 17:20:37.038000000 +1000
+@@ -83,8 +83,16 @@
+ # compile the path for finding the Qwt library
+ # into the plugin. Not supported on Windows !
+
+- QMAKE_RPATHDIR *= $${QWT_INSTALL_LIBS}
+- qwtAddLibrary($${QWT_OUT_ROOT}/lib, qwt)
++ #QMAKE_RPATHDIR *= $${QWT_INSTALL_LIBS}
++ #qwtAddLibrary($${QWT_OUT_ROOT}/lib, qwt)
++ contains(QWT_CONFIG, QwtDll) {
++ greaterThan(QT_MAJOR_VERSION, 4) {
++ qwtAddLibrary($${QWT_OUT_ROOT}/lib, qwt-qt5)
++ }
++ else {
++ qwtAddLibrary($${QWT_OUT_ROOT}/lib, qwt)
++ }
++ }
+
+ contains(QWT_CONFIG, QwtDll) {
+
+--- examples/examples.pri.orig 2016-06-13 17:14:23.023600934 +1000
++++ examples/examples.pri 2018-09-14 17:44:03.727000000 +1000
+@@ -34,8 +34,13 @@
+ }
+ }
+
+-QMAKE_RPATHDIR *= $${QWT_OUT_ROOT}/lib
+-qwtAddLibrary($${QWT_OUT_ROOT}/lib, qwt)
++#QMAKE_RPATHDIR *= $${QWT_OUT_ROOT}/lib
++greaterThan(QT_MAJOR_VERSION, 4) {
++ qwtAddLibrary($${QWT_OUT_ROOT}/lib, qwt-qt5)
++}
++else {
++ qwtAddLibrary($${QWT_OUT_ROOT}/lib, qwt)
++}
+
+ greaterThan(QT_MAJOR_VERSION, 4) {
+
diff --git a/libraries/qwt/qwt.SlackBuild b/libraries/qwt/qwt.SlackBuild
index 167493e673..b949ca5bcc 100644
--- a/libraries/qwt/qwt.SlackBuild
+++ b/libraries/qwt/qwt.SlackBuild
@@ -6,11 +6,11 @@
# Nobbled from Slacky and sanitised for sanity :)
# Modified by dunkyp <dunkyp@gmail.com>
# Modified by the Slackbuilds.org project
-# Maintained 2015-2016 by Christoph Willing <chris.willing@linux.com>
+# Maintained 2015-2018 by Christoph Willing <chris.willing@linux.com>
PRGNAM=qwt
VERSION=${VERSION:-6.1.3}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -40,6 +40,9 @@ else
LIBDIRSUFFIX=""
fi
+# If Qt5 is installed, assume we want to use it
+QWT_QT5="no" ; pkg-config --exists Qt5 ; if [ "$?" = "0" ]; then QWT_QT5="yes" ; fi
+
set -e
rm -rf $PKG
@@ -48,8 +51,7 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
-patch -p0 < $CWD/patch-6.1.2-qwtconfig.diff
-patch -p0 < $CWD/patch-6.1.2-pkgconfig.diff
+patch -p0 < $CWD/patch-6.1.2-config.diff
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -57,11 +59,30 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-qmake LIBDIRSUFFIX=$LIBDIRSUFFIX
-make \
- CFLAGS+="$SLKCFLAGS" \
- CXXFLAGS+="$SLKCFLAGS"
+mkdir -p build-qt4
+cd build-qt4
+qmake .. LIBDIRSUFFIX=$LIBDIRSUFFIX
+make CFLAGS+="$SLKCFLAGS" CXXFLAGS+="$SLKCFLAGS"
make install INSTALL_ROOT=$PKG
+cd ..
+
+if [ "$QWT_QT5" = "yes" ]; then
+ echo "Supporting Qt5"
+ mkdir -p build-qt5
+ cd build-qt5
+ qmake-qt5 .. LIBDIRSUFFIX=$LIBDIRSUFFIX
+ make CFLAGS+="$SLKCFLAGS" CXXFLAGS+="$SLKCFLAGS -std=c++11 -fPIC"
+ make install INSTALL_ROOT=$PKG
+ cd ..
+fi
+
+# Rationalise the pkgconfig default filenames
+( cd $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig
+ ln -s qwt.pc Qwt6.pc
+ if [ -f Qt5Qwt6.pc ]; then
+ ln -s Qt5Qwt6.pc qwt-qt5.pc
+ fi
+)
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -74,9 +95,17 @@ rm -f $PKG/usr/man/man3/_tmp*
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/examples
-find ./examples/ -name moc -type d |xargs rm -rf
-find ./examples/ -name obj -type d |xargs rm -rf
-cp -a ./examples/* $PKG/usr/doc/$PRGNAM-$VERSION/examples
+find ./build-qt4/examples/ -name moc -type d |xargs rm -rf
+find ./build-qt4/examples/ -name obj -type d |xargs rm -rf
+cp -a ./build-qt4/examples/* $PKG/usr/doc/$PRGNAM-$VERSION/examples
+
+if [ -d build-qt5 ]; then
+ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/examples-qt5
+ find ./build-qt5/examples/ -name moc -type d |xargs rm -rf
+ find ./build-qt5/examples/ -name obj -type d |xargs rm -rf
+ cp -a ./build-qt5/examples/* $PKG/usr/doc/$PRGNAM-$VERSION/examples-qt5
+fi
+
mv $PKG/usr/doc/html $PKG/usr/doc/$PRGNAM-$VERSION
cp -a CHANGES* COPYING INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild