clojure-lsp: update to 2024.08.05.
[void-pkg.git] / common / build-helper / qmake6.sh
blob945110b94ea58ea2ccd4a86fd88c3d6380c6c9f9
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,
5 # respectively.
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
21 QMAKE_CC = ${CC}
22 QMAKE_CXX = ${CXX}
23 QMAKE_LINK = ${CXX}
24 QMAKE_LINK_C = ${CC}
25 QMAKE_LINK_SHLIB = ${CXX}
27 QMAKE_AR = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
28 QMAKE_OBJCOPY = ${OBJCOPY}
29 QMAKE_NM = ${NM} -P
30 QMAKE_STRIP = ${STRIP}
32 QMAKE_CFLAGS = ${CFLAGS}
33 QMAKE_CXXFLAGS = ${CXXFLAGS}
34 QMAKE_LFLAGS = ${LDFLAGS}
35 load(qt_config)
36 _EOF
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
40 [Paths]
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
57 HostPrefix=/usr
58 HostData=/usr/lib/qt6
59 HostBinaries=/usr/lib/qt6/bin
60 HostLibraries=/usr/lib
61 HostLibraryExecutables=/usr/lib/qt6/libexec
62 Spec=linux-g++
63 TargetSpec=$XBPS_WRAPPERDIR/target-spec/linux-g++
64 _EOF
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
73 #!/bin/sh
74 exec /usr/lib/qt6/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt.conf" \\
75 QMAKE_CFLAGS+="\${CFLAGS}" \\
76 QMAKE_CXXFLAGS+="\${CXXFLAGS}" \\
77 QMAKE_LFLAGS+="\${LDFLAGS}"
78 _EOF
79 else
80 cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF
81 #!/bin/sh
82 exec /usr/lib/qt6/bin/qmake \
83 "\$@" \
84 PREFIX=/usr \
85 QT_INSTALL_PREFIX=/usr \
86 LIB=/usr/lib \
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}" \
92 CONFIG+=no_qt_rpath
93 _EOF
95 chmod 755 ${XBPS_WRAPPERDIR}/qmake
96 cp -p ${XBPS_WRAPPERDIR}/qmake{,-qt6}
97 cp -p ${XBPS_WRAPPERDIR}/qmake{,6}