From 7a92246547f0a575bf4ef554fd14b861388d1fc7 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Mon, 19 Feb 2024 20:25:46 +0300 Subject: dev-tqt/tqt: respect user's flags with USE=debug Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tde-packaging-gentoo/issues/362 Signed-off-by: Alexander Golubev --- dev-tqt/tqt/tqt-14.1.0.ebuild | 20 +++++++++++++++----- dev-tqt/tqt/tqt-14.1.1.ebuild | 20 +++++++++++++++----- dev-tqt/tqt/tqt-9999.ebuild | 20 +++++++++++++++----- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/dev-tqt/tqt/tqt-14.1.0.ebuild b/dev-tqt/tqt/tqt-14.1.0.ebuild index f1dec6aa..d5452962 100644 --- a/dev-tqt/tqt/tqt-14.1.0.ebuild +++ b/dev-tqt/tqt/tqt-14.1.0.ebuild @@ -1,5 +1,5 @@ -# Copyright 1999-2023 Gentoo Authors -# Copyright 2020-2023 The Trinity Desktop Project +# Copyright 1999-2024 Gentoo Authors +# Copyright 2020-2024 The Trinity Desktop Project # Distributed under the terms of the GNU General Public License v2 EAPI="8" @@ -119,11 +119,21 @@ src_prepare() { find mkspecs -name qmake.conf | xargs \ sed -i -e 's:QMAKE_RPATH.*:QMAKE_RPATH =:' || die + if use debug; then + qmake_flags_edits=( -e "s:QMAKE_CFLAGS_DEBUG.*=.*:QMAKE_CFLAGS_DEBUG=${CFLAGS}:" + -e "s:QMAKE_CXXFLAGS_DEBUG.*=.*:QMAKE_CXXFLAGS_DEBUG=${CXXFLAGS}:" + -e "s:QMAKE_LFLAGS_DEBUG.*=.*:QMAKE_LFLAGS_DEBUG=${LDFLAGS}:" + ) + else + qmake_flags_edits=( -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" + -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" + -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" + ) + fi + # Make qmake.conf respect our flags and toolchain - sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ + sed -i "${qmake_flags_edits[@]}" \ -e 's:QMAKE_CFLAGS\t\t=.*:QMAKE_CFLAGS =:' \ - -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ - -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ -e "s:\.*=.*:QMAKE_CC=$(tc-getCC):" \ -e "s:\.*=.*:QMAKE_CXX=$(tc-getCXX):" \ -e "s:\.*=.*:QMAKE_LINK=$(tc-getCXX):" \ diff --git a/dev-tqt/tqt/tqt-14.1.1.ebuild b/dev-tqt/tqt/tqt-14.1.1.ebuild index 508ad7dc..ebf6cc8d 100644 --- a/dev-tqt/tqt/tqt-14.1.1.ebuild +++ b/dev-tqt/tqt/tqt-14.1.1.ebuild @@ -1,5 +1,5 @@ -# Copyright 1999-2023 Gentoo Authors -# Copyright 2020-2023 The Trinity Desktop Project +# Copyright 1999-2024 Gentoo Authors +# Copyright 2020-2024 The Trinity Desktop Project # Distributed under the terms of the GNU General Public License v2 EAPI="8" @@ -124,11 +124,21 @@ src_prepare() { find mkspecs -name qmake.conf | xargs \ sed -i -e 's:QMAKE_RPATH.*:QMAKE_RPATH =:' || die + if use debug; then + qmake_flags_edits=( -e "s:QMAKE_CFLAGS_DEBUG.*=.*:QMAKE_CFLAGS_DEBUG=${CFLAGS}:" + -e "s:QMAKE_CXXFLAGS_DEBUG.*=.*:QMAKE_CXXFLAGS_DEBUG=${CXXFLAGS}:" + -e "s:QMAKE_LFLAGS_DEBUG.*=.*:QMAKE_LFLAGS_DEBUG=${LDFLAGS}:" + ) + else + qmake_flags_edits=( -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" + -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" + -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" + ) + fi + # Make qmake.conf respect our flags and toolchain - sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ + sed -i "${qmake_flags_edits[@]}" \ -e 's:QMAKE_CFLAGS\t\t=.*:QMAKE_CFLAGS =:' \ - -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ - -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ -e "s:\.*=.*:QMAKE_CC=$(tc-getCC):" \ -e "s:\.*=.*:QMAKE_CXX=$(tc-getCXX):" \ -e "s:\.*=.*:QMAKE_LINK=$(tc-getCXX):" \ diff --git a/dev-tqt/tqt/tqt-9999.ebuild b/dev-tqt/tqt/tqt-9999.ebuild index bdf40bda..f994caae 100644 --- a/dev-tqt/tqt/tqt-9999.ebuild +++ b/dev-tqt/tqt/tqt-9999.ebuild @@ -1,5 +1,5 @@ -# Copyright 1999-2020 Gentoo Authors -# Copyright 2020 The Trinity Desktop Project +# Copyright 1999-2024 Gentoo Authors +# Copyright 2020-2024 The Trinity Desktop Project # Distributed under the terms of the GNU General Public License v2 EAPI="8" @@ -119,11 +119,21 @@ src_prepare() { find mkspecs -name qmake.conf | xargs \ sed -i -e 's:QMAKE_RPATH.*:QMAKE_RPATH =:' || die + if use debug; then + qmake_flags_edits=( -e "s:QMAKE_CFLAGS_DEBUG.*=.*:QMAKE_CFLAGS_DEBUG=${CFLAGS}:" + -e "s:QMAKE_CXXFLAGS_DEBUG.*=.*:QMAKE_CXXFLAGS_DEBUG=${CXXFLAGS}:" + -e "s:QMAKE_LFLAGS_DEBUG.*=.*:QMAKE_LFLAGS_DEBUG=${LDFLAGS}:" + ) + else + qmake_flags_edits=( -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" + -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" + -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" + ) + fi + # Make qmake.conf respect our flags and toolchain - sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ + sed -i "${qmake_flags_edits[@]}" \ -e 's:QMAKE_CFLAGS\t\t=.*:QMAKE_CFLAGS =:' \ - -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ - -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ -e "s:\.*=.*:QMAKE_CC=$(tc-getCC):" \ -e "s:\.*=.*:QMAKE_CXX=$(tc-getCXX):" \ -e "s:\.*=.*:QMAKE_LINK=$(tc-getCXX):" \ -- cgit v1.2.1