Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog eutils.eclass
Date: Tue, 26 Feb 2013 14:36:43
Message-Id: 20130226143640.459362171D@flycatcher.gentoo.org
1 mgorny 13/02/26 14:36:40
2
3 Modified: ChangeLog eutils.eclass
4 Log:
5 prune_libtool_files: support running without pkg-config installed, using sed fallback.
6
7 Revision Changes Path
8 1.689 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.689&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.689&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.688&r2=1.689
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.688
18 retrieving revision 1.689
19 diff -u -r1.688 -r1.689
20 --- ChangeLog 26 Feb 2013 14:35:13 -0000 1.688
21 +++ ChangeLog 26 Feb 2013 14:36:40 -0000 1.689
22 @@ -1,6 +1,10 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.688 2013/02/26 14:35:13 mgorny Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.689 2013/02/26 14:36:40 mgorny Exp $
27 +
28 + 26 Feb 2013; Michał Górny <mgorny@g.o> eutils.eclass:
29 + prune_libtool_files: support running without pkg-config installed, using sed
30 + fallback.
31
32 26 Feb 2013; Michał Górny <mgorny@g.o> python-r1.eclass:
33 Re-enable split logs, now directly handled by python*_foreach_impl().
34
35
36
37 1.411 eclass/eutils.eclass
38
39 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.411&view=markup
40 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.411&content-type=text/plain
41 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.410&r2=1.411
42
43 Index: eutils.eclass
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v
46 retrieving revision 1.410
47 retrieving revision 1.411
48 diff -u -r1.410 -r1.411
49 --- eutils.eclass 10 Feb 2013 11:42:48 -0000 1.410
50 +++ eutils.eclass 26 Feb 2013 14:36:40 -0000 1.411
51 @@ -1,6 +1,6 @@
52 # Copyright 1999-2013 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.410 2013/02/10 11:42:48 mgorny Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.411 2013/02/26 14:36:40 mgorny Exp $
56
57 # @ECLASS: eutils.eclass
58 # @MAINTAINER:
59 @@ -1407,8 +1407,9 @@
60 # that they should not be linked to, i.e. whenever these files
61 # correspond to plugins.
62 #
63 -# Note: if your package installs both static libraries and .pc files,
64 -# you need to add pkg-config to your DEPEND.
65 +# Note: if your package installs both static libraries and .pc files
66 +# which use variable substitution for -l flags, you need to add
67 +# pkg-config to your DEPEND.
68 prune_libtool_files() {
69 debug-print-function ${FUNCNAME} "$@"
70
71 @@ -1473,11 +1474,27 @@
72 local pkgconf=$(tc-getPKG_CONFIG)
73
74 while IFS= read -r -d '' pc; do # for all .pc files
75 - local arg
76 + local arg libs
77
78 - sed -e '/^Requires:/d' "${pc}" > "${tf}"
79 - for arg in $("${pkgconf}" --libs "${tf}"); do
80 - [[ ${arg} == -l* ]] && pc_libs+=( lib${arg#-l}.la )
81 + # Use pkg-config if available (and works),
82 + # fallback to sed.
83 + if ${pkgconf} --exists "${pc}" &>/dev/null; then
84 + sed -e '/^Requires:/d' "${pc}" > "${tf}"
85 + libs=$(${pkgconf} --libs "${tf}")
86 + else
87 + libs=$(sed -ne 's/^Libs://p' "${pc}")
88 + fi
89 +
90 + for arg in ${libs}; do
91 + if [[ ${arg} == -l* ]]; then
92 + if [[ ${arg} == '*$*' ]]; then
93 + eqawarn "${FUNCNAME}: variable substitution likely failed in ${pc}"
94 + eqawarn "(arg: ${arg})"
95 + eqawarn "Most likely, you need to add virtual/pkgconfig to DEPEND."
96 + fi
97 +
98 + pc_libs+=( lib${arg#-l}.la )
99 + fi
100 done
101 done < <(find "${D}" -type f -name '*.pc' -print0)