2015-08-20 19:29:37 +00:00
|
|
|
#
|
|
|
|
# This helper is for templates using Qt4/Qt5 qmake.
|
|
|
|
#
|
|
|
|
do_configure() {
|
2017-03-21 18:35:01 +00:00
|
|
|
local qmake
|
2019-07-01 22:52:53 +00:00
|
|
|
local qmake_args
|
2017-03-21 18:35:01 +00:00
|
|
|
if [ -x "/usr/lib/qt5/bin/qmake" ]; then
|
|
|
|
# Qt5 qmake
|
|
|
|
qmake="/usr/lib/qt5/bin/qmake"
|
|
|
|
fi
|
|
|
|
if [ -x "/usr/lib/qt/bin/qmake" ]; then
|
|
|
|
# Qt4 qmake
|
|
|
|
qmake="/usr/lib/qt/bin/qmake"
|
|
|
|
fi
|
|
|
|
if [ -z "${qmake}" ]; then
|
2021-01-12 19:04:49 +00:00
|
|
|
msg_error "${pkgver}: Could not find qmake - missing in hostmakedepends?\n"
|
2017-03-21 18:35:01 +00:00
|
|
|
fi
|
2019-07-01 22:52:53 +00:00
|
|
|
if [ "$CROSS_BUILD" ] && [ "$qmake" == "/usr/lib/qt5/bin/qmake" ]; then
|
2019-11-11 19:22:43 +00:00
|
|
|
case $XBPS_TARGET_MACHINE in
|
|
|
|
i686*) _qt_arch=i386;;
|
|
|
|
x86_64*) _qt_arch=x86_64;;
|
|
|
|
aarch64*) _qt_arch=arm64;;
|
|
|
|
arm*) _qt_arch=arm;;
|
|
|
|
mips*) _qt_arch=mips;;
|
2020-12-15 20:42:22 +00:00
|
|
|
ppc64*) _qt_arch=power64;;
|
|
|
|
ppc*) _qt_arch=power;;
|
2019-11-11 19:22:43 +00:00
|
|
|
esac
|
|
|
|
mkdir -p "${wrksrc}/.target-spec/linux-g++"
|
|
|
|
cat > "${wrksrc}/.target-spec/linux-g++/qmake.conf" <<_EOF
|
|
|
|
MAKEFILE_GENERATOR = UNIX
|
2021-02-07 11:05:17 +00:00
|
|
|
CONFIG += incremental no_qt_rpath
|
2019-11-11 19:22:43 +00:00
|
|
|
QMAKE_INCREMENTAL_STYLE = sublib
|
|
|
|
|
|
|
|
include(/usr/lib/qt5/mkspecs/common/linux.conf)
|
|
|
|
include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
|
|
|
|
include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
|
|
|
|
|
|
|
|
QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
|
|
|
|
QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
|
|
|
|
QMAKE_CC = ${CC}
|
|
|
|
QMAKE_CXX = ${CXX}
|
|
|
|
QMAKE_LINK = ${CXX}
|
|
|
|
QMAKE_LINK_C = ${CC}
|
|
|
|
QMAKE_LINK_SHLIB = ${CXX}
|
|
|
|
|
|
|
|
QMAKE_AR = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
|
|
|
|
QMAKE_OBJCOPY = ${OBJCOPY}
|
|
|
|
QMAKE_NM = ${NM} -P
|
|
|
|
QMAKE_STRIP = ${STRIP}
|
|
|
|
|
|
|
|
QMAKE_CFLAGS = ${CFLAGS}
|
|
|
|
QMAKE_CXXFLAGS = ${CXXFLAGS}
|
|
|
|
QMAKE_LFLAGS = ${LDFLAGS}
|
|
|
|
load(qt_config)
|
|
|
|
_EOF
|
|
|
|
echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
|
|
|
|
|
|
|
|
mkdir -p "${wrksrc}/.host-spec/linux-g++"
|
|
|
|
cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
|
|
|
|
MAKEFILE_GENERATOR = UNIX
|
2021-02-07 11:05:17 +00:00
|
|
|
CONFIG += incremental no_qt_rpath
|
2019-11-11 19:22:43 +00:00
|
|
|
QMAKE_INCREMENTAL_STYLE = sublib
|
|
|
|
|
|
|
|
include(/usr/lib/qt5/mkspecs/common/linux.conf)
|
|
|
|
include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
|
|
|
|
include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
|
|
|
|
|
|
|
|
QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
|
|
|
|
QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
|
|
|
|
QMAKE_CC = ${CC_host}
|
|
|
|
QMAKE_CXX = ${CXX_host}
|
|
|
|
QMAKE_LINK = ${CXX_host}
|
|
|
|
QMAKE_LINK_C = ${CC_host}
|
|
|
|
QMAKE_LINK_SHLIB = ${CXX_host}
|
|
|
|
|
|
|
|
QMAKE_AR = gcc-ar cqs
|
|
|
|
QMAKE_OBJCOPY = ${OBJCOPY_host}
|
|
|
|
QMAKE_NM = ${NM_host} -P
|
|
|
|
QMAKE_STRIP = ${STRIP_host}
|
|
|
|
|
|
|
|
QMAKE_CFLAGS = ${CFLAGS_host}
|
|
|
|
QMAKE_CXXFLAGS = ${CXXFLAGS_host}
|
|
|
|
QMAKE_LFLAGS = ${LDFLAGS_host}
|
|
|
|
load(qt_config)
|
|
|
|
_EOF
|
|
|
|
echo '#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
|
2019-07-01 22:52:53 +00:00
|
|
|
cat > "${wrksrc}/qt.conf" <<_EOF
|
|
|
|
[Paths]
|
|
|
|
Sysroot=${XBPS_CROSS_BASE}
|
2019-11-11 19:22:43 +00:00
|
|
|
Prefix=/usr
|
2019-07-01 22:52:53 +00:00
|
|
|
ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
|
|
|
|
Data=${XBPS_CROSS_BASE}/usr/share/qt5
|
|
|
|
Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
|
|
|
|
Headers=${XBPS_CROSS_BASE}/usr/include/qt5
|
|
|
|
Libraries=${XBPS_CROSS_BASE}/usr/lib
|
|
|
|
LibraryExecutables=/usr/lib/qt5/libexec
|
|
|
|
Binaries=/usr/lib/qt5/bin
|
|
|
|
Tests=${XBPS_CROSS_BASE}/usr/tests
|
|
|
|
Plugins=/usr/lib/qt5/plugins
|
|
|
|
Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/imports
|
|
|
|
Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/qml
|
|
|
|
Translations=${XBPS_CROSS_BASE}/usr/share/qt5/translations
|
|
|
|
Settings=${XBPS_CROSS_BASE}/etc/xdg
|
|
|
|
Examples=${XBPS_CROSS_BASE}/usr/share/qt5/examples
|
|
|
|
HostPrefix=/usr
|
|
|
|
HostData=/usr/lib/qt5
|
|
|
|
HostBinaries=/usr/lib/qt5/bin
|
|
|
|
HostLibraries=/usr/lib
|
2019-11-11 19:22:43 +00:00
|
|
|
Spec=${wrksrc}/.host-spec/linux-g++
|
|
|
|
TargetSpec=${wrksrc}/.target-spec/linux-g++
|
2019-07-01 22:52:53 +00:00
|
|
|
_EOF
|
2020-05-07 17:43:49 +00:00
|
|
|
qmake_args="-qtconf ${wrksrc}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/${PKG_CONFIG}"
|
2019-11-11 19:22:43 +00:00
|
|
|
${qmake} ${qmake_args} \
|
|
|
|
PREFIX=/usr \
|
|
|
|
QT_INSTALL_PREFIX=/usr \
|
|
|
|
LIB=/usr/lib \
|
|
|
|
QT_TARGET_ARCH=$_qt_arch \
|
|
|
|
${configure_args}
|
|
|
|
else
|
|
|
|
${qmake} ${qmake_args} \
|
|
|
|
PREFIX=/usr \
|
|
|
|
QT_INSTALL_PREFIX=/usr \
|
|
|
|
LIB=/usr/lib \
|
|
|
|
QMAKE_CC=$CC QMAKE_CXX=$CXX \
|
|
|
|
QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
|
|
|
|
QMAKE_CFLAGS="${CFLAGS}" \
|
|
|
|
QMAKE_CXXFLAGS="${CXXFLAGS}" \
|
|
|
|
QMAKE_LFLAGS="${LDFLAGS}" \
|
|
|
|
${configure_args}
|
2019-07-01 22:52:53 +00:00
|
|
|
fi
|
2015-08-20 19:29:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
: ${make_cmd:=make}
|
|
|
|
|
2016-10-05 12:03:16 +00:00
|
|
|
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} \
|
|
|
|
CC="$CC" CXX="$CXX" LINK="$CXX"
|
2015-08-20 19:29:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
: ${make_cmd:=make}
|
|
|
|
: ${make_install_target:=install}
|
|
|
|
|
|
|
|
${make_cmd} STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} \
|
2015-08-22 17:32:38 +00:00
|
|
|
INSTALL_ROOT=${DESTDIR} ${make_install_args} ${make_install_target}
|
2015-08-20 19:29:37 +00:00
|
|
|
}
|