1 # This build-helper sets up qmake’s cross environment
2 # in cases the build-style is mixed,
3 # e.g. when in a gnu-configure style the configure
4 # script calls qmake or a makefile in a gnu-makefile style,
7 if [ "$CROSS_BUILD" ]; then
8 mkdir
-p "${XBPS_WRAPPERDIR}/target-spec/linux-g++"
9 cat > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qmake.conf" <<_EOF
10 MAKEFILE_GENERATOR = UNIX
11 CONFIG += incremental no_qt_rpath
12 QMAKE_INCREMENTAL_STYLE = sublib
14 include(/usr/lib/qt6/mkspecs/common/linux.conf)
15 include(/usr/lib/qt6/mkspecs/common/gcc-base-unix.conf)
16 include(/usr/lib/qt6/mkspecs/common/g++-unix.conf)
18 QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt6/mkspecs/qconfig.pri
19 QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt6/mkspecs/qmodule.pri
20 QMAKEMODULES = ${XBPS_CROSS_BASE}/usr/lib/qt6/mkspecs/modules
25 QMAKE_LINK_SHLIB = ${CXX}
27 QMAKE_AR = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
28 QMAKE_OBJCOPY = ${OBJCOPY}
30 QMAKE_STRIP = ${STRIP}
32 QMAKE_CFLAGS = ${CFLAGS}
33 QMAKE_CXXFLAGS = ${CXXFLAGS}
34 QMAKE_LFLAGS = ${LDFLAGS}
37 echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt6/mkspecs/linux-g++/qplatformdefs.h\"" > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qplatformdefs.h"
39 cat > "${XBPS_WRAPPERDIR}/qt.conf" <<_EOF
41 Sysroot=${XBPS_CROSS_BASE}
42 Prefix=${XBPS_CROSS_BASE}/usr
43 ArchData=${XBPS_CROSS_BASE}/usr/lib/qt6
44 Data=${XBPS_CROSS_BASE}/usr/share/qt6
45 Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt6
46 Headers=${XBPS_CROSS_BASE}/usr/include/qt6
47 Libraries=${XBPS_CROSS_BASE}/usr/lib
48 LibraryExecutables=/usr/lib/qt6/libexec
49 Binaries=/usr/lib/qt6/bin
50 Tests=${XBPS_CROSS_BASE}/usr/tests
51 Plugins=/usr/lib/qt6/plugins
52 Imports=${XBPS_CROSS_BASE}/usr/lib/qt6/imports
53 Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt6/qml
54 Translations=${XBPS_CROSS_BASE}/usr/share/qt6/translations
55 Settings=${XBPS_CROSS_BASE}/etc/xdg
56 Examples=${XBPS_CROSS_BASE}/usr/lib/qt6/examples
59 HostBinaries=/usr/lib/qt6/bin
60 HostLibraries=/usr/lib
61 HostLibraryExecutables=/usr/lib/qt6/libexec
63 TargetSpec=$XBPS_WRAPPERDIR/target-spec/linux-g++
66 # create the qmake-wrapper here because it only
67 # makes sense together with the qmake build-helper
68 # and not to interfere with e.g. the qmake build-style
70 # + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS
71 # + hardening flags will be picked up from environment variables
72 cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF
74 exec /usr/lib/qt6/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt.conf" \\
75 QMAKE_CFLAGS+="\${CFLAGS}" \\
76 QMAKE_CXXFLAGS+="\${CXXFLAGS}" \\
77 QMAKE_LFLAGS+="\${LDFLAGS}"
80 cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF
82 exec /usr/lib/qt6/bin/qmake \
85 QT_INSTALL_PREFIX=/usr \
87 QMAKE_CC="$CC" QMAKE_CXX="$CXX" \
88 QMAKE_LINK="$CXX" QMAKE_LINK_C="$CC" \
89 QMAKE_CFLAGS+="\${CFLAGS}" \
90 QMAKE_CXXFLAGS+="\${CXXFLAGS}" \
91 QMAKE_LFLAGS+="\${LDFLAGS}" \
95 chmod 755 ${XBPS_WRAPPERDIR}/qmake
96 cp -p ${XBPS_WRAPPERDIR}/qmake
{,-qt6}
97 cp -p ${XBPS_WRAPPERDIR}/qmake
{,6}