Page 1 of 1

build-pkg.sh qt5-5.15.2, use savefile as build directory -- aufs tips & tricks

Posted: Sat Dec 05, 2020 8:54 am
by s243a

I'm trying to build qt5-5.15.2 because for some annoying reason for many python packages the newest version of the python package likes to use the newest version of qt5. So the basic instructions to do this are:

1. download the the qt5 reccipie from here:
http://distro.ibiblio.org/fatdog/source/800/recipes/

2. Extract this file to the following folder.
/usr/src/pkgbuild/pkg/qt5

So in this folder I have the following files:

Code: Select all

# ls
assistant-qt5.desktop  qconfig.h                QTBUG-48321.patch
designer-qt5.desktop   qdbusviewer-qt5.desktop  qt-everywhere-src-5.15.2.tar.xz
linguist-qt5.desktop   qt5.sh                   recipe

the source file doesn't actually come in the recipie archive. The build-pkg script will download this file. However, you'll need at least the md5sum of this archive for the script to work.

Modify the following lines of the build script to match:

Code: Select all

PKGVER=5.15.2
MD5SUM=e1447db4f06c841d8947f0a6ce83a7b5
SRC_URL=https://download.qt.io/archive/qt/5.15/$PKGVER/single/$TARBALL

Now in theory you can run this script by doing the following:

Code: Select all

cd /usr/src/pkgbuild
./build-pkg.sh qt5

However, I didn't have sufficient memory to do this. I tried both expanding my save file and creating a swap file but it didn't seem to help. For some reason the swap file wasn't as big as I tried to make it.

To get around this limitation I tried using a folder within my save file as the build directory. Aufs doesn't seem to like to mount branches like this. I know I can mount a directory of a real device as one of the aufs branches and I know I can mount a save file as one of the aufs branches. My hard drive has no linux partitions so I decided to do the latte.

Frirst I made a save file using the following script (code borrowed from sandbox-rw.sh):

see post: I created a script to write a blank save file (borrowed from sandbox-rw.sh)

Then I modified build-pkg.sh as follows:

Code: Select all

BUILD_DIR="/mnt/+aufs+devsave+build+ext4"
BUILD_DIR_PREFIX=${BUILD_DIR_PREFIX:-/tmp}
BUILD_DIR_OLD=${BUILD_DIR:-$(mktemp -d -p $BUILD_DIR_PREFIX build-pkg.XXXXXXXX)}
CHROOT_DIR=/tmp/chroot-${BUILD_DIR_OLD##*/}

https://pastebin.com/PdaE5fUe
where "/mnt/+aufs+devsave+build+ext4" is the mount path to the save file that I created.

I made the save file, which I used as the build directory 10GB and this is likely vastly larger than needed to build qt5.

Anyway, after making these changes, I was able to run the build script but it didn't work because I dong' have qmake5 on my system.

Code: Select all

Check config.log for details.
ln: failed to create symbolic link '/opt/qt5/bin/moc-qt5-64': No such file or directory
ln: failed to create symbolic link '/opt/qt5/bin/uic-qt5-64': No such file or directory
ln: failed to create symbolic link '/opt/qt5/bin/qmake-qt5-64': No such file or directory
mkdir: created directory '/install'
mv: cannot stat '/opt/qt5/bin/qmake': No such file or directory
ln: failed to create symbolic link '/opt/qt5/bin/qmake': No such file or directory
Build error qt5-5.15.2-x86_64-1, dropping to temporary shell.
/code]

Re: build-pkg.sh qt5-5.15.2, use savefile as build directory -- aufs tips & tricks

Posted: Sat Dec 05, 2020 9:27 am
by s243a

It seems that the script failed to link qmake because qmake failed to compile. I have the following errors:

Code: Select all

Note: Overriding option 'shared' with 'yes' (was: 'no')

Note: Also available for Linux: linux-clang linux-icc

Note: -optimized-tools is not useful in -release mode.

Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.

WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.

Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
On macOS, you can use Homebrew's llvm package.
On Windows, you must set LLVM_INSTALL_DIR to the installation path.

ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl' failed.

Check config.log for details.
ln: failed to create symbolic link '/opt/qt5/bin/moc-qt5-64': No such file or directory
ln: failed to create symbolic link '/opt/qt5/bin/uic-qt5-64': No such file or directory
ln: failed to create symbolic link '/opt/qt5/bin/qmake-qt5-64': No such file or directory
mkdir: created directory '/install'
mv: cannot stat '/opt/qt5/bin/qmake': No such file or directory
ln: failed to create symbolic link '/opt/qt5/bin/qmake': No such file or directory
Build error qt5-5.15.2-x86_64-1, dropping to temporary shell.

On slackbuild they mention libxkbcommon as a dependency. I wonder if I need this. However, the more significant error seems to be related to openssl. I see two suggestions on how to fix this:

suggestion one:

"Back in earlier versions the configure script did not check as far as i can tell and i solved the compiling errors by putting the OpenSSL includes into

\src\qtbase\src\network\openssl
"

https://forum.qt.io/post/383891

suggestion two:

This check is to ensure that OpenSSL is library and header files r found properly. Give the include path with -I option to say where OpenSSL header files exist. It should solve the problem.

https://forum.qt.io/post/383897


Re: build-pkg.sh qt5-5.15.2, use savefile as build directory -- aufs tips & tricks

Posted: Sat Dec 05, 2020 9:54 am
by s243a

I found the following error in config.log

Code: Select all

$OPENSSL_LIBS is not set

I found something that might be related:

Code: Select all

export openssl_CFLAGS=' '
export openssl_LIBS='-lssl -lcrypto  '
export pcre_CFLAGS=' '
export pcre_LIBS='-lpcre  '
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig/"

https://superuser.com/questions/747639/ ... ut-it-isnt

although this comment was to compile something else. Also the case looks different for the OPENSSL_LIBS, environmental variable name.


Re: build-pkg.sh qt5-5.15.2, use savefile as build directory -- aufs tips & tricks

Posted: Sat Dec 05, 2020 10:05 am
by s243a

I think I see the problem. from config.log

Code: Select all

> main.cpp:5:4: error: #error OpenSSL >= 1.1.1 is required
>  #  error OpenSSL >= 1.1.1 is required

but if I look on gsplat I see that fatdog64-811 has only version 1.1.0 of openssl. Consequently, the header files, in devX will be have the wrong version of openssl.


Re: build-pkg.sh qt5-5.15.2, use savefile as build directory -- aufs tips & tricks

Posted: Sat Dec 05, 2020 10:03 pm
by step

Savefile / swap-space issues:

  1. Extract this file to the following folder.
    /usr/src/pkgbuild/pkg/qt5

Rather than doing #2 do this:

1.5. Copy /usr/src/pkgbuild to a folder outside your savefile/savefolder. For instance cp -a /usr/src/pkgbuild /mnt/sdX/ (replace X with a suitable drive letter). This will create a build folder for all your packages without taking up space in your savefile.

2.0 Extract this file to your pkgbuild folder.

Don't forget to undo all the changes you made to the original files in /usr/src/pkgbuild/ before copying then to /dev/sdX/pkgbuild/.


No qmake5 issue:

cannot stat '/opt/qt5/bin/qmake': No such file or directory

/opt/qt-5.11.1/bin/qmake is found in the qt5.11.1 package. The Fatdog iso includes a slimmed version of qt5, qt5-common, which is sufficient to run most Qt5 programs but not suitable for Qt5 development. I recommend not to install the .txz packages permanently, but rather to convert them into SFS files first, and then to load such SFS files when you need them to build Qt5 and Qt5 apps.


Side note

If you want to keep building Fatdog recipes in future, you could consider an alternative, more complicated (meaning more initial pain to learn something new but more gain in the long run) method. This is the process the dev team uses to build Fatdog and its package repo. Use the pkglist/all-rebuild.sh script to build a package and all its dependencies in a chrooted build environment. This will ensure that your recipes are reproducible by fellow developers.

For Qt5, you could initialize file pkglist/build-pkglist as follows:

Code: Select all

libinput install
qt5 build

You might need to add more "install" lines for other qt5 hard dependencies before your qt5 build can succeed.

Comments in all-rebuild.sh explain what "install" and "build" mean. Intuitively: "install" installs permanently a package from the pkgbuild/output folder into the chrooted build directory; "build" builds the recipe in the chroot but doesn't install the resulting package to the chroot. If a package (.txz) can't be found in pkgbuild/output, it will be built, assuming that pkgbuild/pkg includes a folder with a recipe for that missing package. It takes some time to get the hang of this method, and to have enough packages pre-built in pkgbuild/output to satisfy most dependencies. You chose a challenging one (Qt5).


I think I see the problem. from config.log

Code: Select all

    main.cpp:5:4: error: #error OpenSSL >= 1.1.1 is required
    #  error OpenSSL >= 1.1.1 is required

but if I look on gsplat I see that fatdog64-811 has only version 1.1.0 of openssl.

If openssl needs upgrading in order to build Qt5-5.15.2, you could write a recipe for the new openssl version, build it, and install the resulting package when you build Qt5.5.15.2 again. (Or go package hunting from the Debian/Ubuntu, Slackware, etc. repos, which often doesn't work because more unsatisfied dependencies get pulled in from those repos).

Did you check the Qt5 site/forums to find out if openssl 1.1.1 is indeed a hard dependency? There could be an optional make setting that enables building with openssl 1.1.0. Just thinking.