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

Diff of /eclass/libtool.eclass

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

Revision 1.95 Revision 1.96
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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/libtool.eclass,v 1.95 2011/11/14 17:08:49 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.96 2011/11/18 17:32:14 vapier Exp $
4 4
5# @ECLASS: libtool.eclass 5# @ECLASS: libtool.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: quickly update bundled libtool code 8# @BLURB: quickly update bundled libtool code
12# 12#
13# Note, this eclass does not require libtool as it only applies patches to 13# Note, this eclass does not require libtool as it only applies patches to
14# generated libtool files. We do not run the libtoolize program because that 14# generated libtool files. We do not run the libtoolize program because that
15# requires a regeneration of the main autotool files in order to work properly. 15# requires a regeneration of the main autotool files in order to work properly.
16 16
17# If an overlay has eclass overrides, but doesn't actually override the
18# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's
19# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So
20# add a check to locate the ELT-patches/ regardless of what's going on.
21ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*}
22elt_patch_dir() {
23 local d="${ECLASSDIR}/ELT-patches"
24 if [[ ! -d ${d} ]] ; then
25 d="${ECLASSDIR_LOCAL}/ELT-patches"
26 fi
27 echo "${d}"
28}
29
17DESCRIPTION="Based on the ${ECLASS} eclass" 30DESCRIPTION="Based on the ${ECLASS} eclass"
18 31
19inherit multilib toolchain-funcs 32inherit multilib toolchain-funcs
20
21ELT_PATCH_DIR="${ECLASSDIR}/ELT-patches"
22 33
23# 34#
24# See if we can apply $2 on $1, and if so, do it 35# See if we can apply $2 on $1, and if so, do it
25# 36#
26ELT_try_and_apply_patch() { 37ELT_try_and_apply_patch() {
68ELT_walk_patches() { 79ELT_walk_patches() {
69 local patch tmp 80 local patch tmp
70 local ret=1 81 local ret=1
71 local file=$1 82 local file=$1
72 local patch_set=$2 83 local patch_set=$2
73 local patch_dir="${ELT_PATCH_DIR}/${patch_set}" 84 local patch_dir="$(elt_patch_dir)/${patch_set}"
74 local rem_int_dep=$3 85 local rem_int_dep=$3
75 86
76 [[ -z ${patch_set} ]] && return 1 87 [[ -z ${patch_set} ]] && return 1
77 [[ ! -d ${patch_dir} ]] && return 1 88 [[ ! -d ${patch_dir} ]] && return 1
78 89
82 # replace @REM_INT_DEP@ with what was passed 93 # replace @REM_INT_DEP@ with what was passed
83 # to --remove-internal-dep 94 # to --remove-internal-dep
84 sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ) 95 sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" )
85 fi 96 fi
86 97
87 pushd "${ELT_PATCH_DIR}" >/dev/null || die 98 pushd "$(elt_patch_dir)" >/dev/null || die
88 99
89 # Go through the patches in reverse order (newer version to older) 100 # Go through the patches in reverse order (newer version to older)
90 for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do 101 for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do
91 tmp="${T}/libtool-elt.patch" 102 tmp="${T}/libtool-elt.patch"
92 sed "${sed_args[@]}" "${patch}" > "${tmp}" || die 103 sed "${sed_args[@]}" "${patch}" > "${tmp}" || die

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.96

  ViewVC Help
Powered by ViewVC 1.1.20