From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 66D73138010 for ; Wed, 29 Aug 2012 13:43:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB886E0602; Wed, 29 Aug 2012 13:42:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 67B69E0602 for ; Wed, 29 Aug 2012 13:42:45 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7CA2833D7C6 for ; Wed, 29 Aug 2012 13:42:44 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2279) id 2CD7F20B4D; Wed, 29 Aug 2012 13:42:43 +0000 (UTC) From: "Michal Gorny (mgorny)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, mgorny@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog eutils.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: ChangeLog eutils.eclass X-VCS-Directories: eclass X-VCS-Committer: mgorny X-VCS-Committer-Name: Michal Gorny Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20120829134243.2CD7F20B4D@flycatcher.gentoo.org> Date: Wed, 29 Aug 2012 13:42:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bc2d2fdd-458c-4495-9183-08fcd4c13f56 X-Archives-Hash: 823504c81bfa555ef3ca1eecc998970e mgorny 12/08/29 13:42:43 Modified: ChangeLog eutils.eclass Log: prune_libtool_files: run pkg-config code only if necessary. Revision Changes Path 1.383 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.383&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.383&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.382&r2=1.383 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.382 retrieving revision 1.383 diff -u -r1.382 -r1.383 --- ChangeLog 28 Aug 2012 15:28:01 -0000 1.382 +++ ChangeLog 29 Aug 2012 13:42:42 -0000 1.383 @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.382 2012/08/28 15:28:01 mpagano Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.383 2012/08/29 13:42:42 mgorny Exp $ + + 29 Aug 2012; Michał Górny eutils.eclass: + prune_libtool_files: run pkg-config code only if necessary. 28 Aug 2012; Michael Pagano linux-mod.eclass: Remove deprecated and unrecommended parameter -r from depmod 1.402 eclass/eutils.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.402&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.402&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.401&r2=1.402 Index: eutils.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v retrieving revision 1.401 retrieving revision 1.402 diff -u -r1.401 -r1.402 --- eutils.eclass 20 Aug 2012 19:45:57 -0000 1.401 +++ eutils.eclass 29 Aug 2012 13:42:42 -0000 1.402 @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.401 2012/08/20 19:45:57 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.402 2012/08/29 13:42:42 mgorny Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -1395,8 +1395,8 @@ # that they should not be linked to, i.e. whenever these files # correspond to plugins. # -# Note: if your package installs any .pc files, this function implicitly -# calls pkg-config. You should add it to your DEPEND in that case. +# Note: if your package installs both static libraries and .pc files, +# you need to add pkg-config to your DEPEND. prune_libtool_files() { debug-print-function ${FUNCNAME} "$@" @@ -1411,25 +1411,6 @@ esac done - # Create a list of all .pc-covered libs. - local pc_libs=() - if [[ ! ${removing_all} ]]; then - local f - local tf=${T}/prune-lt-files.pc - local pkgconf=$(tc-getPKG_CONFIG) - - while IFS= read -r -d '' f; do # for all .pc files - local arg - - sed -e '/^Requires:/d' "${f}" > "${tf}" - for arg in $("${pkgconf}" --libs "${tf}"); do - [[ ${arg} == -l* ]] && pc_libs+=( lib${arg#-l}.la ) - done - done < <(find "${D}" -type f -name '*.pc' -print0) - - rm -f "${tf}" - fi - local f while IFS= read -r -d '' f; do # for all .la files local archivefile=${f/%.la/.a} @@ -1453,17 +1434,40 @@ # - respective static archive doesn't exist, # - they are covered by a .pc file already, # - they don't provide any new information (no libs & no flags). - local reason + local reason pkgconfig_scanned if [[ ${removing_all} ]]; then reason='requested' elif [[ ! -f ${archivefile} ]]; then reason='no static archive' - elif has "${f##*/}" "${pc_libs[@]}"; then - reason='covered by .pc' elif [[ ! $(sed -nre \ "s/^(dependency_libs|inherited_linker_flags)='(.*)'$/\2/p" \ "${f}") ]]; then reason='no libs & flags' + else + if [[ ! ${pkgconfig_scanned} ]]; then + # Create a list of all .pc-covered libs. + local pc_libs=() + if [[ ! ${removing_all} ]]; then + local f + local tf=${T}/prune-lt-files.pc + local pkgconf=$(tc-getPKG_CONFIG) + + while IFS= read -r -d '' f; do # for all .pc files + local arg + + sed -e '/^Requires:/d' "${f}" > "${tf}" + for arg in $("${pkgconf}" --libs "${tf}"); do + [[ ${arg} == -l* ]] && pc_libs+=( lib${arg#-l}.la ) + done + done < <(find "${D}" -type f -name '*.pc' -print0) + + rm -f "${tf}" + fi + + pkgconfig_scanned=1 + fi + + has "${f##*/}" "${pc_libs[@]}" && reason='covered by .pc' fi if [[ ${reason} ]]; then