Author Topic: QT5 build failure and fix  (Read 1566 times)

pchristy

  • Full Member
  • ***
  • Posts: 129
QT5 build failure and fix
« on: November 25, 2016, 03:51:57 PM »
System: Slackware64-current + QT5/kde5 semi-official upgrade. Avidemux_2.6.15

Slackware does not come with qt5/kde5 as standard, but one of the developers provides upgrade packages for those who want to try it. 2.6.15 built perfectly using my standard build script under qt4, but after I installed qt5, it failed with the following error message:

Code: [Select]
ADM_userInterfacesQT5/ADM_shell/moc_Q_shell.cpp:9:
/usr/include/qt5/QtCore/qbasicatomic.h:61:4: error: #error "Qt requires C++11 support"
 #  error "Qt requires C++11 support"
    ^

A quick poke around t'Internet suggested adding

Code: [Select]
CXXFLAGS=-std=c++11
I did this, and the build then proceeded normally. So far everything seems to be working as expected.

For reference (and any other slackers out there), here is my build script:

Code: [Select]
#!/bin/sh

# Copyright 2008, 2009, 2010, 2011  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


PKGNAM=avidemux
VERSION=2.6.15
BUILD=${BUILD:-1}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) export ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
rm -rf $PKG
mkdir -p $PKG

# We don't need to do anything about setting CFLAGS or libdirs as the internal
#avidemux build script does this for us. (But see below!)

cd $PKG
tar xvf $CWD/avidemux_$VERSION.tar.gz || exit 1
cd avidemux_$VERSION || exit 1

# We need this if building with QT5:
export CXXFLAGS=-std=c++11

chmod +x bootStrap.bash

./bootStrap.bash # We don't need to set any options here.


find $PKG/avidemux_$VERSION/install | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

  mkdir -p $PKG/avidemux_$VERSION/install/install
  cat $CWD/slack-desc > $PKG/avidemux_$VERSION/install/install/slack-desc

cd $PKG/avidemux_$VERSION/install
/sbin/makepkg -l y -c n $TMP/avidemux_$VERSION-$ARCH-$BUILD.txz

This script will build avidemux, and leave a standard Slackware package in the /tmp directory.

I probably should automate the QT5 detection, but since avidemux usually detects all the flag settings automatically, I wonder if this is something that has only recently occurred in "bleeding edge" installations, and should thus be determined internally by avidemux?

Cheers,
« Last Edit: November 25, 2016, 03:53:56 PM by pchristy »
--
Pete

AQUAR

  • Hero Member
  • *****
  • Posts: 1079
Re: QT5 build failure and fix
« Reply #1 on: November 26, 2016, 10:03:49 AM »
Some interesting threads with snippets of coding lately.
These make for interesting reading.

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10974
Re: QT5 build failure and fix
« Reply #2 on: November 26, 2016, 02:18:15 PM »
It's partially done already
Maybe the Shell part was missed


pchristy

  • Full Member
  • ***
  • Posts: 129
Re: QT5 build failure and fix
« Reply #3 on: November 28, 2016, 08:58:37 AM »
Cheers, Mean!  :)
--
Pete