diff options
Diffstat (limited to 'libraries/qt5/qt5.SlackBuild')
-rw-r--r-- | libraries/qt5/qt5.SlackBuild | 150 |
1 files changed, 60 insertions, 90 deletions
diff --git a/libraries/qt5/qt5.SlackBuild b/libraries/qt5/qt5.SlackBuild index ef7507d8de..67d6e19149 100644 --- a/libraries/qt5/qt5.SlackBuild +++ b/libraries/qt5/qt5.SlackBuild @@ -2,8 +2,6 @@ # Slackware build script for qt5 -# Update for 5.9.6 by David Woodfall <dave@slackbuilds.org> -# # Copyright 2013-2017 Larry Hajali <larryhaja[at]gmail[dot]com> # Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. @@ -47,10 +45,12 @@ # This is the highly modified version qt.SlackBuild found in Slackware # tailored to Qt 5. Modified by Larry Hajali. -# Adapted for Qt 5.9.6 by David Woodfall +# Adapted for Qt >= 5.9.6 by Dave Woodfall <dave@slackbuilds.org> +# Some parts thanks to alienBOB's qt5 SlackBuild. PRGNAM=qt5 -VERSION=${VERSION:-5.9.9} +SRCNAM=${PRGNAM%%[[:digit:]]*} +VERSION=${VERSION:-5.12.8} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -73,46 +73,33 @@ PROPRIETARY_CODECS=${PROPRIETARY_CODECS:-no} PULSEAUDIO=${PULSEAUDIO:-yes} CCACHE=${CCACHE:-no} WEBENGINE=${WEBENGINE:-yes} +LDGOLD=${LDGOLD:-no} -printf "\n%s\n\n" "SlackBuild Options:" -printf "%s\n" "CCACHE: $CCACHE" -printf "%s\n" "DOCS: $DOCS" -printf "%s\n" "EXAMPLES: $EXAMPLES" -printf "%s\n" "PROPRIETARY_CODECS: $PROPRIETARY_CODECS" -printf "%s\n" "PULSEAUDIO: $PULSEAUDIO" -printf "%s\n" "WEBENGINE: $WEBENGINE" -printf "\n" - -# Default is no. -if [ "$EXAMPLES" == "yes" ]; then - BUILD_EXAMPLES="" -else - BUILD_EXAMPLES="-nomake examples" -fi - -# Default is yes. -if [ "$PULSEAUDIO" = "no" ]; then - PULSE="-no-pulseaudio" -fi - -# Default is no. -if [ "$CCACHE" = "yes" ]; then - CCACHE="-ccache" -else - unset CCACHE -fi +[ "$EXAMPLES" = "no" ] && BUILD_EXAMPLES="-nomake examples" +[ "$PULSEAUDIO" = "no" ] && PULSE="-no-pulseaudio" +[ "$CCACHE" = "yes" ] && USE_CCACHE="-ccache" +[ "$LDGOLD" = "no" ] && USE_LDGOLD="-no-use-gold-linker" if [ "$WEBENGINE" = "no" ]; then - EXCLUDE="--exclude=qtweb*" + EXCLUDE="--exclude=qtwebengine" PKGVERSION="${VERSION}_nowebengine" else PKGVERSION="${VERSION}" - # Note that this changes to -webengine-proprietary-codecs in later versions if [ "$PROPRIETARY_CODECS" = "yes" ]; then - CODECS="-proprietary-codecs" + CODECS="-webengine-proprietary-codecs" fi fi +printf "\n%s\n\n" "SlackBuild Options:" +printf "%s\n" "CCACHE: $CCACHE" +printf "%s\n" "DOCS: $DOCS" +printf "%s\n" "EXAMPLES: $EXAMPLES" +printf "%s\n" "PROPRIETARY_CODECS: $PROPRIETARY_CODECS" +printf "%s\n" "PULSEAUDIO: $PULSEAUDIO" +printf "%s\n" "WEBENGINE: $WEBENGINE" +printf "%s\n" "LDGOLD: $LDGOLD" +printf "\n" + if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -147,9 +134,9 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP echo "Removing any existing source directory. Please wait..." -rm -rf ${PRGNAM/5/}-everywhere-opensource-src-$VERSION -tar xvf $CWD/${PRGNAM/5/}-everywhere-opensource-src-$VERSION.tar.xz $EXCLUDE -cd ${PRGNAM/5/}-everywhere-opensource-src-$VERSION +rm -rf $SRCNAM-everywhere-src-$VERSION +tar xvf $CWD/$SRCNAM-everywhere-src-$VERSION.tar.xz $EXCLUDE +cd $SRCNAM-everywhere-src-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -165,21 +152,31 @@ else RELOCATIONS="" fi -# Borrowed a few things from alienBOB: # Fix path to mysql header: cat $CWD/patches/qt5.mysql.h.diff | patch -p1 --verbose -# Fix missing private includes: QTBUG-37417 -sed -e '/CMAKE_NO_PRIVATE_INCLUDES\ \=\ true/d' \ - -i qtbase/mkspecs/features/create_cmake.prf +# CMake generates wrong -isystem /usr/include compilations flags with Qt5::Gui +# and for it breaks KWin compilation with: +# /usr/include/c++/9.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory +# See also https://bugzilla.redhat.com/1704474 +cd qtbase + cat $CWD/patches/qt5.qtbase_cmake_isystem_includes.patch \ + | patch -p1 --verbose || exit 1 +cd - 1>/dev/null # Use our custom compiler and linker flags: -sed -i -re "s,-O(2|3),$SLKCFLAGS," qtbase/mkspecs/common/gcc-base.conf -sed -i -e "/^QMAKE_LFLAGS\s/s,+=,+= $SLKLDFLAGS,g" \ - qtbase/mkspecs/common/gcc-base.conf +sed -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${SLKCFLAGS}|" \ + -i qtbase/mkspecs/common/gcc-base.conf || exit 1 +sed -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${SLKLDFLAGS}|" \ + -i qtbase/mkspecs/common/g++-unix.conf || exit 1 export CFLAGS="$SLKCFLAGS" -export CXXFLAGS="$SLKCFLAGS -std=c++11" +export CXXFLAGS="$SLKCFLAGS" +export OPENSOURCE_CXXFLAGS="$SLKCFLAGS" +export QTDIR="${TMP}/qt-everywhere-src-$VERSION" +export LD_LIBRARY_PATH="${QTDIR}/qtbase/lib:${QTDIR}/qttools/lib:${LD_LIBRARY_PATH}" +export QT_PLUGIN_PATH="${QTDIR}/qtbase/plugins" + ./configure -v \ -confirm-license \ -opensource \ @@ -188,6 +185,7 @@ export CXXFLAGS="$SLKCFLAGS -std=c++11" -headerdir "/usr/include/$PRGNAM" \ -libdir "/usr/lib${LIBDIRSUFFIX}" \ -docdir "/usr/doc/$PRGNAM-$VERSION" \ + -examplesdir "/usr/doc/$PRGNAM-$VERSION/examples" \ -system-libpng \ -system-libjpeg \ -system-zlib \ @@ -206,23 +204,22 @@ export CXXFLAGS="$SLKCFLAGS -std=c++11" -no-rpath \ -no-strip \ -release \ - -no-use-gold-linker \ - -c++std c++11 \ - $CCACHE \ + $USE_CCACHE \ $CODECS \ $PULSE \ $RELOCATIONS \ - $BUILD_EXAMPLES + $BUILD_EXAMPLES \ + $USE_LDGOLD -make +make || make -j1 make install INSTALL_ROOT=$PKG # Install documentation. Default is not to install documentation. -if [ "$DOCS" == "yes" ]; then +if [ "$DOCS" = "yes" ]; then # Recreate Makefiles in order to use the just compiled qdoc. - for doc in $(find . -name "Makefile*" | xargs egrep "^\s/usr/lib${LIBDIRSUFFIX}/qt5/bin/" \ - | cut -d':' -f1 | uniq) - do + for doc in $(find . -name "Makefile*" \ + | xargs egrep "^\s/usr/lib${LIBDIRSUFFIX}/qt5/bin/" | cut -d':' -f1 \ + | uniq); do rm -fv $doc done make docs @@ -232,8 +229,6 @@ fi find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -ln -s $PRGNAM $PKG/usr/lib${LIBDIRSUFFIX}/qt-$VERSION - mkdir -p $PKG/usr/bin for BIN in $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/bin/*; do TMP_FILE=$(echo $BIN | sed -e "s|$PKG||") @@ -278,46 +273,19 @@ Description: Qt5 Configuration Version: $VERSION EOF -if [ "$WEBENGINE" = "yes" ]; then - # Fix internal linking for Qt5WebEngineCore.pc. - sed -i \ - -e 's|-Wl,--start-group.* -Wl,--end-group||' \ - -e "s|-L${PWD}/qtwebengine/src/core/api/Release||" \ - $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/Qt5WebEngineCore.pc -fi - -# While we are at it, there isn't any reason to keep references to $PKG in the *.prl files. -for PRL in $(find $PKG -name "*\.prl"); do - sed -i '/^QMAKE_PRL_BUILD_DIR/d' $PRL -done +# Fix the path in prl files: +find "$PKG/usr/lib${LIBDIRSUFFIX}" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \; # One more for the road. sed -i "s|$PWD/qtbase|/usr/lib${LIBDIRSUFFIX}/$PRGNAM|" \ $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/mkspecs/modules/qt_lib_bootstrap_private.pri -sed -i "s|-L${PWD}/\w*/lib ||g" \ - $PKG/usr/lib${LIBDIRSUFFIX}/libqgsttools_p.prl - for i in $CWD/desktop/*.desktop; do install -D -m 0644 $i $PKG/usr/share/applications/$(basename $i) done sed -i "s|@LIBDIR@|$LIBDIRSUFFIX|" $PKG/usr/share/applications/* -# Currently not working for qt version 5.4.0. Extra layer added to *.ico file -# freaks out ImageMagick and fails image conversion. -# Eg. -# $ convert assistant.ico -resize 96x96! assistant.png -# convert: file format version mismatch `assistant.ico' @ error/xwd.c/ReadXWDImage/241. -# convert: no images defined `assistant.png' @ error/convert.c/ConvertImageCommand/3127. -#for i in $(find . -name "assistant.ico" -o -name "designer.ico" \ -# -o -name "linguist.ico" -o -name "qdbusviewer.ico"); do -# for j in 16 24 32 48 64 96 128; do -# convert $i -resize ${j}x${j}! $(basename $i)-$j.png -# install -D -m 0644 $(basename $i)-$j-0.png \ -# $PKG/usr/share/icons/hicolor/${j}x${j}/apps/$(basename $i | sed 's|.ico||')-$PRGNAM.png -# done -#done - install -D -m 0644 qttools/src/assistant/assistant/images/assistant-128.png \ $PKG/usr/share/icons/hicolor/128x128/apps/assistant-qt5.png install -D -m 0644 qttools/src/designer/src/designer/images/designer.png \ @@ -332,10 +300,14 @@ done # Remove executable bits from files. find $PKG \( -name "*.qml" -o -name "*.app" \) -perm 755 -exec chmod 644 '{}' \; +# Add missing version info +sed -i "s,set(PACKAGE_VERSION ),set(PACKAGE_VERSION $VERSION)," \ + $PKG/usr/lib$LIBDIRSUFFIX/cmake/Qt5/Qt5ConfigVersion.cmake + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - README qtbase/{header*,LGPL_EXCEPTION.txt,LICENSE.*L} \ - $CWD/README.benchmarks $CWD/README.ccache \ + README qtbase/{header*,LICENSE*} \ + $CWD/README.ccache \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -345,5 +317,3 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} - -# vim: expandtab |