Date: Monday, February 10, 2020 @ 21:59:00 Author: arojas Revision: 375252
Get system cflags for qmake at build time instead of hardcoding them in qt5-base Added: qt5-base/trunk/qt5-base-cflags.patch Modified: qt5-base/trunk/PKGBUILD -----------------------+ PKGBUILD | 15 ++++++--------- qt5-base-cflags.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2020-02-10 20:03:59 UTC (rev 375251) +++ PKGBUILD 2020-02-10 21:59:00 UTC (rev 375252) @@ -5,7 +5,7 @@ pkgname=(qt5-base qt5-xcb-private-headers) _qtver=5.14.1 pkgver=${_qtver/-/} -pkgrel=1 +pkgrel=2 arch=('x86_64') url='https://www.qt.io' license=('GPL3' 'LGPL3' 'FDL' 'custom') @@ -27,18 +27,15 @@ conflicts=('qtchooser') groups=('qt' 'qt5') _pkgfqn="${pkgbase/5-/}-everywhere-src-${_qtver}" -source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz") -sha256sums=('d9d423a6e7bcf1055c0372fc029f14a6fe67dd62c67b83095cde68b60b762cf7') +source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz" + qt5-base-cflags.patch) +sha256sums=('d9d423a6e7bcf1055c0372fc029f14a6fe67dd62c67b83095cde68b60b762cf7' + '3d6524381b2bbd35c9d85fe6d9f3e39be645e12658a810604dfe981633f78d8b') prepare() { cd ${_pkgfqn} - # Build qmake using Arch {C,LD}FLAGS - # This also sets default {C,CXX,LD}FLAGS for projects built using qmake - sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CFLAGS}|" \ - mkspecs/common/gcc-base.conf - sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" \ - mkspecs/common/g++-unix.conf + patch -p1 -i ../qt5-base-cflags.patch # Use system CFLAGS } build() { Added: qt5-base-cflags.patch =================================================================== --- qt5-base-cflags.patch (rev 0) +++ qt5-base-cflags.patch 2020-02-10 21:59:00 UTC (rev 375252) @@ -0,0 +1,26 @@ +diff --git a/mkspecs/common/g++-unix.conf b/mkspecs/common/g++-unix.conf +index a493cd5984..79f2d2fff9 100644 +--- a/mkspecs/common/g++-unix.conf ++++ b/mkspecs/common/g++-unix.conf +@@ -10,5 +10,5 @@ + + include(g++-base.conf) + +-QMAKE_LFLAGS_RELEASE += -Wl,-O1 ++QMAKE_LFLAGS_RELEASE += $$(LDFLAGS) + QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined +diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf +index 4d82321cba..4a61fc9d25 100644 +--- a/mkspecs/common/gcc-base.conf ++++ b/mkspecs/common/gcc-base.conf +@@ -40,8 +40,8 @@ QMAKE_CFLAGS_OPTIMIZE_SIZE = -Os + QMAKE_CFLAGS_DEPS += -M + QMAKE_CFLAGS_WARN_ON += -Wall -Wextra + QMAKE_CFLAGS_WARN_OFF += -w +-QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE +-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g ++QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE $$(CFLAGS) ++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g $$(CFLAGS) + QMAKE_CFLAGS_DEBUG += -g + QMAKE_CFLAGS_SHLIB += $$QMAKE_CFLAGS_PIC + QMAKE_CFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_PIC