Files
BMLFS/build-scripts/qt5-qtdeclarative.build
2023-09-16 16:32:59 -05:00

88 lines
3.4 KiB
Bash

#! /bin/bash
# Qt5 QtDeclarative 5.15.3_git20220209
# Source: https://invent.kde.org/qt/qt/qtdeclarative/-/archive/29ee9a0e9f02ec74153a2cf09dc63722bc273544/qtdeclarative-29ee9a0e9f02ec74153a2cf09dc63722bc273544.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# Required: qt5-qtbase
# Recommended: vulkan-headders
# Optional: NONE
# Apply patches from Alpine Linux
patch -Np1 -i ../patches/qt5-qtdeclarative-5.15.10-alpine/link-libatomic-on-rv64.patch
patch -Np1 -i ../patches/qt5-qtdeclarative-5.15.10-alpine/qt-musl-stackbottom.patch
# Per Alpine:
# Make configure think we are running in a git directory
# This makes it symlink the include files to the right directory
mkdir .git
export CFLAGS="-I/opt/Xorg/include -L/opt/Xorg/lib -lexecinfo "
export CXXFLAGS=$CFLAGS
export LDFLAGS="-Wl,-lexecinfo -Wl,-rpath=/opt/openssl/lib:/opt/qt5/lib:/opt/Xorg/lib "
# Check PATH to include /opt/qt5/bin but not /opt/qt6/bin (if Qt6 is installed)
export PATH=/usr/bin:/opt/Xorg/bin:/opt/qt5/bin
qmake
#export PATH="$(pwd):$PATH"
#qmake-qt5
read -p "Compile?" && LD_LIBRARY_PATH=/opt/qt5/lib:/opt/openssl/lib:/opt/Xorg/lib make -j2 &&
sudo -SE make INSTALL_ROOT=$BUILD install &&
unset CFLAGS CXXFLAGS LDFLAGS && \
# Just add /opt/qt5/bin to path
#sudo -S mkdir -pv $BUILD/usr/bin/
#for b in qml qmlformat qmlmin qmlprofiler \
# qmltime qmlcachegen qmlimportscanner \
# qmlplugindump qmlscene qmltyperegistrar \
# qmleasing qmllint qmlpreview qmltestrunner ; do
# sudo -E ln -sv ../../opt/qt5/bin/$b $BUILD/usr/bin/$b-qt5
#done
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "$BUILD/opt/qt5/lib" -type f -name '*.prl' \
-exec sudo sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
# Run-path (rpath) for shared binaries are missing rpath's for /opt/qt5/lib
# For now use patchelf to patch in missing rpath:
for b in qml qmlcachegen qmleasing qmlformat qmlimportscanner qmllint \
qmlmin qmlplugindump qmlpreview qmlprofiler qmlscene \
qmltestrunner qmltime qmltyperegistrar
do
sudo -E patchelf --remove-rpath $BUILD/opt/qt5-5.15.10/bin/$b
sudo -E patchelf --set-rpath /opt/qt5/lib:/opt/openssl/lib:/opt/Xorg/lib \
$BUILD/opt/qt5-5.15.10/bin/$b
done
sudo -E patchelf --remove-rpath $BUILD/opt/qt5-5.15.10/lib/libQt5*.so.*
sudo -E patchelf --set-rpath /opt/qt5/lib:/opt/openssl/lib:/opt/Xorg/lib \
$BUILD/opt/qt5-5.15.10/lib/libQt5*.so.*
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
qt5-qtdeclarative: Qt5 - QtDeclarative component
qt5-qtdeclarative:
qt5-qtdeclarative: A cross-platform C++ application framework. Qt's primary feature
qt5-qtdeclarative: is its rich set of widgets that provide standard GUI functionality.
qt5-qtdeclarative:
qt5-qtdeclarative: http://qt-project.org
qt5-qtdeclarative:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/qt5-qtdeclarative-5.15.3_git20220209-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*