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: Wed, 29 Aug 2012 13:43:03
Message-Id: 20120829134243.2CD7F20B4D@flycatcher.gentoo.org
1 mgorny 12/08/29 13:42:43
2
3 Modified: ChangeLog eutils.eclass
4 Log:
5 prune_libtool_files: run pkg-config code only if necessary.
6
7 Revision Changes Path
8 1.383 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.383&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.383&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.382&r2=1.383
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.382
18 retrieving revision 1.383
19 diff -u -r1.382 -r1.383
20 --- ChangeLog 28 Aug 2012 15:28:01 -0000 1.382
21 +++ ChangeLog 29 Aug 2012 13:42:42 -0000 1.383
22 @@ -1,6 +1,9 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.382 2012/08/28 15:28:01 mpagano Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.383 2012/08/29 13:42:42 mgorny Exp $
27 +
28 + 29 Aug 2012; Michał Górny <mgorny@g.o> eutils.eclass:
29 + prune_libtool_files: run pkg-config code only if necessary.
30
31 28 Aug 2012; Michael Pagano <mpagano@g.o> linux-mod.eclass:
32 Remove deprecated and unrecommended parameter -r from depmod
33
34
35
36 1.402 eclass/eutils.eclass
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.402&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.402&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.401&r2=1.402
41
42 Index: eutils.eclass
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v
45 retrieving revision 1.401
46 retrieving revision 1.402
47 diff -u -r1.401 -r1.402
48 --- eutils.eclass 20 Aug 2012 19:45:57 -0000 1.401
49 +++ eutils.eclass 29 Aug 2012 13:42:42 -0000 1.402
50 @@ -1,6 +1,6 @@
51 # Copyright 1999-2012 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.401 2012/08/20 19:45:57 vapier Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.402 2012/08/29 13:42:42 mgorny Exp $
55
56 # @ECLASS: eutils.eclass
57 # @MAINTAINER:
58 @@ -1395,8 +1395,8 @@
59 # that they should not be linked to, i.e. whenever these files
60 # correspond to plugins.
61 #
62 -# Note: if your package installs any .pc files, this function implicitly
63 -# calls pkg-config. You should add it to your DEPEND in that case.
64 +# Note: if your package installs both static libraries and .pc files,
65 +# you need to add pkg-config to your DEPEND.
66 prune_libtool_files() {
67 debug-print-function ${FUNCNAME} "$@"
68
69 @@ -1411,25 +1411,6 @@
70 esac
71 done
72
73 - # Create a list of all .pc-covered libs.
74 - local pc_libs=()
75 - if [[ ! ${removing_all} ]]; then
76 - local f
77 - local tf=${T}/prune-lt-files.pc
78 - local pkgconf=$(tc-getPKG_CONFIG)
79 -
80 - while IFS= read -r -d '' f; do # for all .pc files
81 - local arg
82 -
83 - sed -e '/^Requires:/d' "${f}" > "${tf}"
84 - for arg in $("${pkgconf}" --libs "${tf}"); do
85 - [[ ${arg} == -l* ]] && pc_libs+=( lib${arg#-l}.la )
86 - done
87 - done < <(find "${D}" -type f -name '*.pc' -print0)
88 -
89 - rm -f "${tf}"
90 - fi
91 -
92 local f
93 while IFS= read -r -d '' f; do # for all .la files
94 local archivefile=${f/%.la/.a}
95 @@ -1453,17 +1434,40 @@
96 # - respective static archive doesn't exist,
97 # - they are covered by a .pc file already,
98 # - they don't provide any new information (no libs & no flags).
99 - local reason
100 + local reason pkgconfig_scanned
101 if [[ ${removing_all} ]]; then
102 reason='requested'
103 elif [[ ! -f ${archivefile} ]]; then
104 reason='no static archive'
105 - elif has "${f##*/}" "${pc_libs[@]}"; then
106 - reason='covered by .pc'
107 elif [[ ! $(sed -nre \
108 "s/^(dependency_libs|inherited_linker_flags)='(.*)'$/\2/p" \
109 "${f}") ]]; then
110 reason='no libs & flags'
111 + else
112 + if [[ ! ${pkgconfig_scanned} ]]; then
113 + # Create a list of all .pc-covered libs.
114 + local pc_libs=()
115 + if [[ ! ${removing_all} ]]; then
116 + local f
117 + local tf=${T}/prune-lt-files.pc
118 + local pkgconf=$(tc-getPKG_CONFIG)
119 +
120 + while IFS= read -r -d '' f; do # for all .pc files
121 + local arg
122 +
123 + sed -e '/^Requires:/d' "${f}" > "${tf}"
124 + for arg in $("${pkgconf}" --libs "${tf}"); do
125 + [[ ${arg} == -l* ]] && pc_libs+=( lib${arg#-l}.la )
126 + done
127 + done < <(find "${D}" -type f -name '*.pc' -print0)
128 +
129 + rm -f "${tf}"
130 + fi
131 +
132 + pkgconfig_scanned=1
133 + fi
134 +
135 + has "${f##*/}" "${pc_libs[@]}" && reason='covered by .pc'
136 fi
137
138 if [[ ${reason} ]]; then