/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.410 Revision 1.411
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.410 2013/02/10 11:42:48 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.411 2013/02/26 14:36:40 mgorny Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
1405# 1405#
1406# The .a files are only removed whenever corresponding .la files state 1406# The .a files are only removed whenever corresponding .la files state
1407# that they should not be linked to, i.e. whenever these files 1407# that they should not be linked to, i.e. whenever these files
1408# correspond to plugins. 1408# correspond to plugins.
1409# 1409#
1410# Note: if your package installs both static libraries and .pc files, 1410# Note: if your package installs both static libraries and .pc files
1411# which use variable substitution for -l flags, you need to add
1411# you need to add pkg-config to your DEPEND. 1412# pkg-config to your DEPEND.
1412prune_libtool_files() { 1413prune_libtool_files() {
1413 debug-print-function ${FUNCNAME} "$@" 1414 debug-print-function ${FUNCNAME} "$@"
1414 1415
1415 local removing_all removing_modules opt 1416 local removing_all removing_modules opt
1416 for opt; do 1417 for opt; do
1471 local pc 1472 local pc
1472 local tf=${T}/prune-lt-files.pc 1473 local tf=${T}/prune-lt-files.pc
1473 local pkgconf=$(tc-getPKG_CONFIG) 1474 local pkgconf=$(tc-getPKG_CONFIG)
1474 1475
1475 while IFS= read -r -d '' pc; do # for all .pc files 1476 while IFS= read -r -d '' pc; do # for all .pc files
1476 local arg 1477 local arg libs
1477 1478
1479 # Use pkg-config if available (and works),
1480 # fallback to sed.
1481 if ${pkgconf} --exists "${pc}" &>/dev/null; then
1478 sed -e '/^Requires:/d' "${pc}" > "${tf}" 1482 sed -e '/^Requires:/d' "${pc}" > "${tf}"
1479 for arg in $("${pkgconf}" --libs "${tf}"); do 1483 libs=$(${pkgconf} --libs "${tf}")
1480 [[ ${arg} == -l* ]] && pc_libs+=( lib${arg#-l}.la ) 1484 else
1485 libs=$(sed -ne 's/^Libs://p' "${pc}")
1486 fi
1487
1488 for arg in ${libs}; do
1489 if [[ ${arg} == -l* ]]; then
1490 if [[ ${arg} == '*$*' ]]; then
1491 eqawarn "${FUNCNAME}: variable substitution likely failed in ${pc}"
1492 eqawarn "(arg: ${arg})"
1493 eqawarn "Most likely, you need to add virtual/pkgconfig to DEPEND."
1494 fi
1495
1496 pc_libs+=( lib${arg#-l}.la )
1497 fi
1481 done 1498 done
1482 done < <(find "${D}" -type f -name '*.pc' -print0) 1499 done < <(find "${D}" -type f -name '*.pc' -print0)
1483 1500
1484 rm -f "${tf}" 1501 rm -f "${tf}"
1485 fi 1502 fi

Legend:
Removed from v.1.410  
changed lines
  Added in v.1.411

  ViewVC Help
Powered by ViewVC 1.1.20