qt5: avoid LDFLAGS leaking into mkspecs

Instead of patching mkspecs files set the desired
CFLAGS, CXXFLAGS and LDFLAGS through QMAKE_... variables
when configuring.

See #3112
This commit is contained in:
Jürgen Buchmüller 2015-12-03 18:30:54 +01:00
parent e00c13e448
commit 0240d3ccd9

View file

@ -1,7 +1,7 @@
# Template file for 'qt5'
pkgname=qt5
version=5.5.1
revision=2
revision=3
wrksrc="qt-everywhere-opensource-src-${version}"
homepage="http://qt.io/"
short_desc="A cross-platform application and UI framework (QT5)"
@ -26,9 +26,6 @@ makedepends="
depends="qtchooser"
pre_configure() {
sed -i "s|-O2|${CXXFLAGS}|" qtbase/mkspecs/common/{g++,gcc}-base.conf
sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS}|g" qtbase/mkspecs/common/gcc-base.conf
# Compatibility functions res_ninit() and res_nclose() for musl libc
cp ${FILESDIR}/resolv_compat.h ${wrksrc}/qtwebengine/src/3rdparty/chromium/net/dns
case "$XBPS_TARGET_MACHINE" in
@ -71,7 +68,10 @@ do_configure() {
*) opts+=" -reduce-relocations"
;;
esac
./configure ${opts}
QMAKE_CFLAGS="${CFLAGS}" \
QMAKE_CXXFLAGS="${CXXFLAGS}" \
QMAKE_LFLAGS="${LDFLAGS}" \
./configure ${opts}
}
do_build() {
export LD_LIBRARY_PATH="${wrksrc}/qtbase/lib:${wrksrc}/qttools/lib:${LD_LIBRARY_PATH}"