fd64 recipe for QT5 -- "-prefix" option not working [Mostly solved?]

versatile 64-bit multi-user Linux distribution

Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

fd64 recipe for QT5 -- "-prefix" option not working [Mostly solved?]

Post by s243a »

Edit, "This issue may be mostly solved (see post)"

I recently used fatdog64s recipe to build qt5-5.15.2-x86_64-1.txz but I think that the Environment was incorrectly built. After installing this package I observe the following:

Code: Select all

# qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/usr
QT_INSTALL_ARCHDATA:/usr
QT_INSTALL_DATA:/usr/lib64
QT_INSTALL_DOCS:/usr/share/doc/qt
QT_INSTALL_HEADERS:/usr/include
QT_INSTALL_LIBS:/usr/lib64
QT_INSTALL_LIBEXECS:/usr/libexec
QT_INSTALL_BINS:/usr/bin
QT_INSTALL_TESTS:/usr/tests
QT_INSTALL_PLUGINS:/usr/lib64/plugins
QT_INSTALL_IMPORTS:/usr/lib64/imports
QT_INSTALL_QML:/usr/qml
QT_INSTALL_TRANSLATIONS:/usr/share/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/share/examples
QT_INSTALL_DEMOS:/usr/share/examples
QT_HOST_PREFIX:/usr
QT_HOST_DATA:/usr
QT_HOST_BINS:/usr/bin
QT_HOST_LIBS:/usr/lib64
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.15.2

However the package installs qt to /opt/qt-5.15.2

If I try to change this property (see docs),

Code: Select all

qmake -set QT_INSTALL_PREFIX /opt/qt

the built-in property isn't removed, instead the following is appended to the top of the above output:

Code: Select all

QT_INSTALL_PREFIX:/opt/qt-5.15.2

Unfortunately, the configure.py script for the python3-qt5 package will read the last line outputed by "qmake -query":

Code: Select all

class TargetQtConfiguration:
    """ A container for the target Qt configuration. """

    def __init__(self, qmake):
        """ Initialise the configuration.  qmake is the full pathname of the
        qmake executable that will provide the configuration.
        """

        inform("Querying qmake about your Qt installation...")

        pipe = os.popen(' '.join([qmake, '-query']))

        for l in pipe:
            l = l.strip()

            tokens = l.split(':', 1)
            if isinstance(tokens, list):
                if len(tokens) != 2:
                    error("Unexpected output from qmake: '%s'\n" % l)

                name, value = tokens
            else:
                name = tokens
                value = None

            name = name.replace('/', '_')

            setattr(self, name, value)

        pipe.close()
 

and I think this will cause problems when trying to build python3-qt5 even if we try to assign a new value for "QT_INSTALL_PREFIX" using the command "qmake -set".

If you look at the configure script for qt5 you find the following:

Code: Select all

    -prefix|-docdir|-headerdir|-plugindir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
        shift
        VAL="$1"
        ;;
 

/qt/.../configure#L923

Code: Select all

    -prefix <dir> ...... This will install everything relative to <dir>
                         (default $QT_INSTALL_PREFIX)
...
    -libdir <dir> ......... Libraries will be installed to <dir>
                            (default PREFIX/lib)

/qt/...configure#L3273

Code: Select all

    prefix)
        QT_INSTALL_PREFIX="$VAL"
        ;;

qt/.../configure#L1106

In conclusion I think that we need to at following option to the recipe, the following configure option seems to not be working:

Code: Select all

-prefix /opt/qt5
Last edited by s243a on Sun Dec 06, 2020 11:52 pm, edited 4 times in total.
step
Posts: 546
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 57 times
Been thanked: 198 times
Contact:

Re: I think fd64 recipe for QT5 is missing "-prefix" option

Post by step »

If I understand correctly, you are building Qt5 5.15.2 with a pkgbuild recipe that you modified as necessary starting from the 5.11.1 recipe that is current for Fatdog64-811. Did I understand correctly?
Can you post your modified recipe so I can try to reproduce your build on my system? Thank you.

s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: I think fd64 recipe for QT5 is missing "-prefix" option

Post by s243a »

step wrote: Sun Dec 06, 2020 5:40 pm

If I understand correctly, you are building Qt5 5.15.2 with a pkgbuild recipe that you modified as necessary starting from the 5.11.1 recipe that is current for Fatdog64-811. Did I understand correctly?
Can you post your modified recipe so I can try to reproduce your build on my system? Thank you.

Sure, I can do that. However, If I look at the recipe again, I see that the "-prefix" option is being used, so I'm not sure why "qmake -query" is giving the incorrect output.

Anyway, here is my recipe (requires openssl-1.1.1):

Code: Select all

### this file is sourced not run
PKGVER=5.15.2
PKGBUILD=1
PKGARCH=x86_64

# source: post BLFS SVN 08102018
TARBALL=qt-everywhere-src-$PKGVER.tar.xz
MD5SUM=e1447db4f06c841d8947f0a6ce83a7b5
SRC_URL=https://download.qt.io/archive/qt/5.15/$PKGVER/single/$TARBALL
BUNDLE=

SLACKREQ='libX11 alsa-lib mesa dbus glib libjpeg-turbo libpng libtiff openssl \
sqlite3 cups gtk2 libinput' # gst-plugins-base - but we don't build with gstreamer
SLACKDESC="qt5: qt $PKGVER (Qt GUI framework)  
qt5:  
qt5: Qt is a cross-platform application framework that is widely used for 
qt5: developing application software with a graphical user interface (GUI) (in 
qt5: which cases Qt is classified as a widget toolkit), and also used for 
qt5: developing non-GUI programs such as command-line tools and consoles for 
qt5: servers. One of the major users of Qt is KDE.  
qt5: 
qt5: 
qt5: 
qt5: This package installs in /opt/qt5
"

### default pkg_download
### prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/qt*
	export QT5DIR=/opt/qt5
	mkdir -pv /opt/qt-$PKGVER &&
	ln -sfvn qt-$PKGVER /opt/qt5
	./configure -prefix $QT5DIR  \
			-libdir $QT5DIR/$LIBDIR \
			-plugindir $QT5DIR/$LIBDIR/plugins \
			-importdir $QT5DIR/$LIBDIR/imports \
			-headerdir $QT5DIR/include \
			-datadir $QT5DIR/$LIBDIR \
			-translationdir $QT5DIR/share/translations \
			-docdir $QT5DIR/share/doc/qt \
			-examplesdir $QT5DIR/share/examples \
			-reduce-relocations \
			-no-separate-debug-info \
			-sysconfdir /etc/xdg \
            -confirm-license     \
            -opensource          \
            -release             \
            -dbus-linked         \
            -openssl-linked      \
            -plugin-sql-sqlite   \
            -no-openvg           \
            -nomake examples     \
            -no-icu              \
            -system-harfbuzz     \
            -no-rpath            \
            -skip qtwebengine    \
            -static              \
            -shared              \
            -optimized-qmake     &&
	make $MAKEFLAGS &&
	make install &&

	find $QT5DIR/$LIBDIR/pkgconfig -name "*.pc" -exec perl -pi -e "s, -L$PWD/?\S+,,g" {} \; &&
	find $QT5DIR -name qt_lib_bootstrap_private.pri \
	   -exec sed -i -e "s:$PWD/qtbase:/$QT5PREFIX/$LIBDIR/:g" {} \; &&
	find $QT5DIR -name \*.prl \
	   -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; &&

	# desktop icons
	install -v -dm755 /usr/share/pixmaps/                  &&
	install -v -Dm644 qttools/src/assistant/assistant/images/assistant-128.png \
					  /usr/share/pixmaps/assistant-qt5.png &&
	install -v -Dm644 qttools/src/designer/src/designer/images/designer.png \
					  /usr/share/pixmaps/designer-qt5.png  &&
	install -v -Dm644 qttools/src/linguist/linguist/images/icons/linguist-128-32.png \
					  /usr/share/pixmaps/linguist-qt5.png  &&
	install -v -Dm644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
					  /usr/share/pixmaps/qdbusviewer-qt5.png &&

	# desktop files
	install -dm755 /usr/share/applications &&
	install -m644 /tmp/pkg/assistant-qt5.desktop /usr/share/applications &&
	install -m644 /tmp/pkg/designer-qt5.desktop /usr/share/applications &&
	install -m644 /tmp/pkg/linguist-qt5.desktop /usr/share/applications &&
	install -m644 /tmp/pkg/qdbusviewer-qt5.desktop /usr/share/applications &&

	mkdir -p /etc/profile.d &&
	install -m755 /tmp/pkg/qt5.sh /etc/profile.d &&
	
	#VLC-3.0.3 looks for certain executables with a -qt5 suffix.
	for file in moc uic rcc qmake lconvert lrelease lupdate; do
	ln -sfrvn $QT5DIR/bin/$file $QT5DIR/bin/$file-qt5
	ln -sfrvn $QT5DIR/bin/$file $QT5DIR/bin/$file-qt5-64
	done
	ln -sfrvn $QT5DIR/bin/moc-64 $QT5DIR/bin/moc-qt5-64
	ln -sfrvn $QT5DIR/bin/uic-64 $QT5DIR/bin/uic-qt5-64
	ln -sfrvn $QT5DIR/bin/qmake-64 $QT5DIR/bin/qmake-qt5-64

	pkg_build_slackdesc &&
	
	# multilib
	mv -v $QT5DIR/bin/qmake{,-64} &&
	mv -v $QT5DIR/bin/uic{,-64} &&
	mv -v $QT5DIR/bin/moc{,-64} &&
	mv -v $QT5DIR/include/QtCore/qconfig{,-64}.h
	ln -sfv /usr/bin/multiarch_wrapper $QT5DIR/bin/qmake &&
	ln -sfv /usr/bin/multiarch_wrapper $QT5DIR/bin/uic &&
	ln -sfv /usr/bin/multiarch_wrapper $QT5DIR/bin/moc &&
	cp -v /tmp/pkg/qconfig.h $QT5DIR/include/QtCore/qconfig.h

}

As a side note, installing this package doesn't replaces the qt5-common package. I think though that the qt5-common package should no longer be needed since it is my understanding that the "common" package is a stripped down version of this package.

s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: fd64 recipe for QT5 -- "-prefix" option not working

Post by s243a »

I think I mostly solved the issue. The following file

/tmp/chroot-build/tmp/qt-everywhere-src-5.15.2/qtbase/bin

Code: Select all

[EffectivePaths]
Prefix=..
[DevicePaths]
Prefix=/opt/qt5
Documentation=share/doc/qt
Libraries=lib64
Plugins=lib64/plugins
Imports=lib64/imports
Data=lib64
Translations=share/translations
Examples=share/examples
[Paths]
Prefix=/opt/qt5
Documentation=share/doc/qt
Libraries=lib64
Plugins=lib64/plugins
Imports=lib64/imports
Data=lib64
Translations=share/translations
Examples=share/examples
HostPrefix=/opt/qt5
HostLibraries=lib64
Sysroot=
SysrootifyPrefix=false
TargetSpec=linux-g++
HostSpec=linux-g++

https://pastebin.com/b1m7vuXr

needs to be copied to

Code: Select all

/opt/qt/bin

To troubleshoot this, I added in:
/usr/src/pkgbuild/pkg/qt5/recipe

the following command:

Code: Select all

sh < /dev/tty > /dev/tty 2>/dev/tty

after the configure[/] statment. I then used commands shown at:
https://pastebin.com/u/s243a/1/GnDXciZ0

to try to identify where the prefix is set.

Post Reply

Return to “FatDog64”