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/qt5/mkspecs/common/linux.conf)
15 include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
16 include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
18 QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
19 QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
20 QMAKEMODULES = ${XBPS_CROSS_BASE}/usr/lib/qt5/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/qt5/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/qt5
44 Data=${XBPS_CROSS_BASE}/usr/share/qt5
45 Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
46 Headers=${XBPS_CROSS_BASE}/usr/include/qt5
47 Libraries=${XBPS_CROSS_BASE}/usr/lib
48 LibraryExecutables=/usr/lib/qt5/libexec
49 Binaries=/usr/lib/qt5/bin
50 Tests=${XBPS_CROSS_BASE}/usr/tests
51 Plugins=/usr/lib/qt5/plugins
52 Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/imports
53 Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/qml
54 Translations=${XBPS_CROSS_BASE}/usr/share/qt5/translations
55 Settings=${XBPS_CROSS_BASE}/etc/xdg
56 Examples=${XBPS_CROSS_BASE}/usr/share/qt5/examples
59 HostBinaries=/usr/lib/qt5/bin
60 HostLibraries=/usr/lib
62 TargetSpec=$XBPS_WRAPPERDIR/target-spec/linux-g++
65 # create the qmake-wrapper here because it only
66 # makes sense together with the qmake build-helper
67 # and not to interfere with e.g. the qmake build-style
69 # + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS
70 # + hardening flags will be picked up from environment variables
71 cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF
73 exec /usr/lib/qt5/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt.conf" \\
74 QMAKE_CFLAGS+="\${CFLAGS}" \\
75 QMAKE_CXXFLAGS+="\${CXXFLAGS}" \\
76 QMAKE_LFLAGS+="\${LDFLAGS}"
79 cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF
81 exec /usr/lib/qt5/bin/qmake \
84 QT_INSTALL_PREFIX=/usr \
86 QMAKE_CC="$CC" QMAKE_CXX="$CXX" \
87 QMAKE_LINK="$CXX" QMAKE_LINK_C="$CC" \
88 QMAKE_CFLAGS+="\${CFLAGS}" \
89 QMAKE_CXXFLAGS+="\${CXXFLAGS}" \
90 QMAKE_LFLAGS+="\${LDFLAGS}" \
94 chmod 755 ${XBPS_WRAPPERDIR}/qmake
95 cp -p ${XBPS_WRAPPERDIR}/qmake
{,-qt5}