Gentoo Archives: gentoo-commits

From: Anna Vyalkova <cyber+gentoo@×××××.in>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: eclass/
Date: Tue, 05 Jul 2022 20:09:10
Message-Id: 1657051339.fc290a76fe3d1b2fb5f7c1cdfb77bf14e2290ac9.cybertailor@gentoo
1 commit: fc290a76fe3d1b2fb5f7c1cdfb77bf14e2290ac9
2 Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Sat Jul 2 11:43:56 2022 +0000
4 Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
5 CommitDate: Tue Jul 5 20:02:19 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fc290a76
7
8 qbs.eclass: use raw-ldflags from flag-o-matic
9
10 * use meson-format-array instead of bash function
11 * move EXPORT_FUNCTIONS at the end of file
12
13 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
14
15 eclass/qbs.eclass | 43 +++++++++----------------------------------
16 1 file changed, 9 insertions(+), 34 deletions(-)
17
18 diff --git a/eclass/qbs.eclass b/eclass/qbs.eclass
19 index af5709e26..c2c892440 100644
20 --- a/eclass/qbs.eclass
21 +++ b/eclass/qbs.eclass
22 @@ -19,13 +19,7 @@ esac
23
24 if [[ ! ${_QBS_ECLASS} ]]; then
25
26 -inherit multiprocessing toolchain-funcs qmake-utils
27 -
28 -fi
29 -
30 -EXPORT_FUNCTIONS src_configure src_compile src_install
31 -
32 -if [[ ! ${_QBS_ECLASS} ]]; then
33 +inherit flag-o-matic multiprocessing toolchain-funcs qmake-utils
34
35 # @ECLASS_VARIABLE: QBS_COMMAND_ECHO_MODE
36 # @USER_VARIABLE
37 @@ -42,7 +36,10 @@ if [[ ! ${_QBS_ECLASS} ]]; then
38 # - command-line-with-environment
39 : ${QBS_COMMAND_ECHO_MODE:=command-line}
40
41 -BDEPEND="dev-util/qbs"
42 +BDEPEND="
43 + dev-util/meson-format-array
44 + dev-util/qbs
45 +"
46
47 # @FUNCTION: eqbs
48 # @USAGE: [<qbs args>...]
49 @@ -64,31 +61,7 @@ eqbs() {
50 # @USAGE: [<flags>...]
51 # @RETURN: arguments quoted and separated by comma
52 _flags_to_js_array() {
53 - if [[ ! ${@} ]]; then
54 - echo "[]"
55 - else
56 - local -a array
57 - printf -v array "'%s', " "${@}"
58 - echo "[${array%, }]"
59 - fi
60 -}
61 -
62 -# @FUNCTION: _filter_ldflags
63 -# @INTERNAL
64 -# @USAGE: [<ldflags>...]
65 -# @RETURN: flags for the linker (with -Wl and -Xlinker removed)
66 -_filter_ldflags() {
67 - local -a flags
68 - while [[ ${@} ]]; do
69 - if [[ ${1} == -Wl,* ]]; then
70 - IFS=, read -ra flags <<< "${1#-Wl,}"
71 - printf "%s " "${flags[@]}"
72 - elif [[ ${1} == -Xlinker ]]; then
73 - shift
74 - printf "%s " "${1}"
75 - fi
76 - shift
77 - done
78 + meson-format-array "${@}" || die
79 }
80
81 # @FUNCTION: qbs_src_configure
82 @@ -121,7 +94,7 @@ qbs_src_configure() {
83 qbs_config cpp.cFlags "$(_flags_to_js_array ${CFLAGS})"
84 qbs_config cpp.cppFlags "$(_flags_to_js_array ${CPPFLAGS})"
85 qbs_config cpp.cxxFlags "$(_flags_to_js_array ${CXXFLAGS})"
86 - qbs_config cpp.linkerFlags "$(_flags_to_js_array $(_filter_ldflags ${LDFLAGS}))"
87 + qbs_config cpp.linkerFlags "$(_flags_to_js_array $(raw-ldflags))"
88 }
89
90 # @FUNCTION: qbs_config
91 @@ -188,3 +161,5 @@ qbs_src_install() {
92
93 _QBS_ECLASS=1
94 fi
95 +
96 +EXPORT_FUNCTIONS src_configure src_compile src_install