2 # This helper is for templates using sip-build.
10 : "${sip_builddir:=build}"
11 mkdir
-p "$sip_builddir"
13 if [ ! -d /$py3_sitelib/pyqtbuild
]; then
14 : "who uses sip-build without qmake anyway?"
15 elif [ -x /usr
/lib
/qt
6/bin
/qmake
]; then
17 elif [ -x /usr
/lib
/qt
5/bin
/qmake
]; then
20 msg_error
'qmake not found\n'
24 : "who use sip-build without qmake anyway?"
25 elif [ "$CROSS_BUILD" ]; then
26 _mkspec
="usr/lib/$_qt/mkspecs"
27 _spec
="$XBPS_WRAPPERDIR/sip-build/target-spec/linux-g++"
29 cat >"$_spec/qmake.conf" <<-_EOF
30 MAKEFILE_GENERATOR = UNIX
31 CONFIG += incremental no_qt_rpath
32 QMAKE_INCREMENTAL_STYLE = sublib
34 include(/$_mkspec/common/linux.conf)
35 include(/$_mkspec/common/gcc-base-unix.conf)
36 include(/$_mkspec/common/g++-unix.conf)
38 QMAKE_TARGET_CONFIG = $XBPS_CROSS_BASE/$_mkspec/qconfig.pri
39 QMAKE_TARGET_MODULE = $XBPS_CROSS_BASE/$_mkspec/qmodule.pri
40 QMAKEMODULES = $XBPS_CROSS_BASE/$_mkspec/modules
45 QMAKE_LINK_SHLIB = $CXX
47 QMAKE_AR = $XBPS_CROSS_TRIPLET-gcc-ar cqs
48 QMAKE_OBJCOPY = $OBJCOPY
52 QMAKE_CFLAGS = $CFLAGS -I$XBPS_CROSS_BASE/usr/include/python$py3_ver
53 QMAKE_CXXFLAGS = $CXXFLAGS -I$XBPS_CROSS_BASE/usr/include/python$py3_ver
54 QMAKE_LFLAGS = -L$XBPS_CROSS_BASE/usr/lib $LDFLAGS
58 printf '#include "%s/%s/linux-g++/qplatformdefs.h"\n' \
59 "$XBPS_CROSS_BASE" "$_mkspec" >"$_spec/qplatformdefs.h"
60 cat >"$XBPS_WRAPPERDIR/sip-build/qt.conf" <<-_EOF
62 Sysroot=$XBPS_CROSS_BASE
63 Prefix=$XBPS_CROSS_BASE/usr
64 ArchData=$XBPS_CROSS_BASE/usr/lib/$_qt
65 Data=$XBPS_CROSS_BASE/usr/share/$_qt
66 Documentation=$XBPS_CROSS_BASE/usr/share/doc/$_qt
67 Headers=$XBPS_CROSS_BASE/usr/include/$_qt
68 Libraries=$XBPS_CROSS_BASE/usr/lib
69 LibraryExecutables=/usr/lib/$_qt/libexec
70 Binaries=/usr/lib/$_qt/bin
71 Tests=$XBPS_CROSS_BASE/usr/tests
72 Plugins=/usr/lib/$_qt/plugins
73 Imports=$XBPS_CROSS_BASE/usr/lib/$_qt/imports
74 Qml2Imports=$XBPS_CROSS_BASE/usr/lib/$_qt/qml
75 Translations=$XBPS_CROSS_BASE/usr/share/$_qt/translations
76 Settings=$XBPS_CROSS_BASE/etc/xdg
77 Examples=$XBPS_CROSS_BASE/usr/share/$_qt/examples
79 HostData=/usr/lib/$_qt
80 HostBinaries=/usr/lib/$_qt/bin
81 HostLibraries=/usr/lib
82 HostLibraryExecutables=/usr/lib/$_qt/libexec
86 # Call it sip-qmake to not override qmake build-helper
88 # XXX: Intentionally quote {C,CXX,LD}FLAGS here but not native.
90 # + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS
91 # + hardening flags will be picked up from environment variables
93 # + hardening flags will be picked up first (Makefile, qt.conf?)
94 # + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS
95 # Maybe there're better workaround, I don't know.
96 cat >"$XBPS_WRAPPERDIR/sip-qmake" <<-_EOF
98 exec /usr/lib/$_qt/bin/qmake "\$@" \\
99 -qtconf "$XBPS_WRAPPERDIR/sip-build/qt.conf" \\
100 PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/${PKG_CONFIG} \\
101 QMAKE_CFLAGS+="\$CFLAGS" \\
102 QMAKE_CXXFLAGS+="\$CXXFLAGS" \\
103 QMAKE_LFLAGS+="\$LDFLAGS"
105 chmod 755 ${XBPS_WRAPPERDIR}/sip-qmake
107 cat >"${XBPS_WRAPPERDIR}/sip-qmake" <<-_EOF
109 exec /usr/lib/$_qt/bin/qmake \\
112 QT_INSTALL_PREFIX=/usr \\
114 QMAKE_CC="$CC" QMAKE_CXX="$CXX" \\
115 QMAKE_LINK="$CXX" QMAKE_LINK_C="$CC" \\
116 QMAKE_CFLAGS+="$CFLAGS" \\
117 QMAKE_CXXFLAGS+="$CXXFLAGS" \\
118 QMAKE_LFLAGS+="$LDFLAGS" \\
121 chmod 755 ${XBPS_WRAPPERDIR}/sip-qmake
124 sip-build
--no-make \
125 ${_qt:+--qmake "$XBPS_WRAPPERDIR/sip-qmake"} \
126 --api-dir /usr
/share
/$_qt/qsci
/api
/python \
128 --build-dir "$sip_builddir"
130 if [ "$CROSS_BUILD" ]; then
131 # -I/usr/include/python$py3_ver is set by sip-build :(
132 find "$sip_builddir" -name Makefile |
133 xargs sed -i "s,-I\\(/usr/include\\),-I$XBPS_CROSS_BASE\\1,g"
138 : "${sip_builddir:=build}"
139 make -C "${sip_builddir}" ${makejobs}
143 : "${sip_builddir:=build}"
144 make -C "${sip_builddir}" \
145 DESTDIR
=${DESTDIR} INSTALL_ROOT
=${DESTDIR} \