/[gentoo-x86]/eclass/multilib-build.eclass
Gentoo

Diff of /eclass/multilib-build.eclass

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

Revision 1.28 Revision 1.29
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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/multilib-build.eclass,v 1.28 2014/03/29 03:00:44 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.29 2014/03/30 08:41:53 mgorny Exp $
4 4
5# @ECLASS: multilib-build.eclass 5# @ECLASS: multilib-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: flags and utility functions for building multilib packages 8# @BLURB: flags and utility functions for building multilib packages
244# A list of tool executables to preserve for each multilib ABI. 244# A list of tool executables to preserve for each multilib ABI.
245# The listed executables will be renamed to ${CHOST}-${basename}, 245# The listed executables will be renamed to ${CHOST}-${basename},
246# and the native variant will be symlinked to the generic name. 246# and the native variant will be symlinked to the generic name.
247# 247#
248# This variable has to be a bash array. Paths shall be relative to 248# This variable has to be a bash array. Paths shall be relative to
249# installation root (${ED}), and name regular files. Recursive wrapping 249# installation root (${ED}), and name regular files or symbolic
250# is not supported. 250# links to regular files. Recursive wrapping is not supported.
251#
252# If symbolic link is passed, both symlink path and symlink target
253# will be changed. As a result, the symlink target is expected
254# to be wrapped as well (either by listing in MULTILIB_CHOST_TOOLS
255# or externally).
251# 256#
252# Please note that tool wrapping is *discouraged*. It is preferred to 257# Please note that tool wrapping is *discouraged*. It is preferred to
253# install pkg-config files for each ABI, and require reverse 258# install pkg-config files for each ABI, and require reverse
254# dependencies to use that. 259# dependencies to use that.
255# 260#
372 f=${f#/} 377 f=${f#/}
373 378
374 local dir=${f%/*} 379 local dir=${f%/*}
375 local fn=${f##*/} 380 local fn=${f##*/}
376 381
382 if [[ -L ${root}/${f} ]]; then
383 # rewrite the symlink target
384 local target=$(readlink "${root}/${f}")
385 local target_dir
386 local target_fn=${target##*/}
387
388 [[ ${target} == */* ]] && target_dir=${target%/*}
389
390 ln -f -s "${target_dir+${target_dir}/}${CHOST}-${target_fn}" \
391 "${root}/${f}" || die
392 fi
393
377 mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die 394 mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
378 395
379 # symlink the native one back 396 # symlink the native one back
380 if multilib_build_binaries; then 397 if multilib_build_binaries; then
381 ln -s "${CHOST}-${fn}" "${root}/${f}" || die 398 ln -s "${CHOST}-${fn}" "${root}/${f}" || die

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.20