1 |
vapier 11/10/03 04:04:46 |
2 |
|
3 |
Modified: libtool.eclass |
4 |
Log: |
5 |
clean up patch applying a bit, and add support for @GENTOO_LIBDIR@ replacements in patches |
6 |
|
7 |
Revision Changes Path |
8 |
1.94 eclass/libtool.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/libtool.eclass?rev=1.94&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/libtool.eclass?rev=1.94&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/libtool.eclass?r1=1.93&r2=1.94 |
13 |
|
14 |
Index: libtool.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v |
17 |
retrieving revision 1.93 |
18 |
retrieving revision 1.94 |
19 |
diff -u -r1.93 -r1.94 |
20 |
--- libtool.eclass 10 Jun 2011 16:17:57 -0000 1.93 |
21 |
+++ libtool.eclass 3 Oct 2011 04:04:46 -0000 1.94 |
22 |
@@ -1,6 +1,6 @@ |
23 |
-# Copyright 1999-2010 Gentoo Foundation |
24 |
+# Copyright 1999-2011 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.93 2011/06/10 16:17:57 flameeyes Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.94 2011/10/03 04:04:46 vapier Exp $ |
28 |
|
29 |
# @ECLASS: libtool.eclass |
30 |
# @MAINTAINER: |
31 |
@@ -16,7 +16,7 @@ |
32 |
|
33 |
DESCRIPTION="Based on the ${ECLASS} eclass" |
34 |
|
35 |
-inherit toolchain-funcs |
36 |
+inherit multilib toolchain-funcs |
37 |
|
38 |
ELT_PATCH_DIR="${ECLASSDIR}/ELT-patches" |
39 |
|
40 |
@@ -27,17 +27,22 @@ |
41 |
local ret=0 |
42 |
local file=$1 |
43 |
local patch=$2 |
44 |
- |
45 |
- echo -e "\nTrying $(basename "$(dirname "${patch}")")-${patch##*/}.patch on ${file}" \ |
46 |
- >> "${T}/elibtool.log" 2>&1 |
47 |
+ local src=$3 |
48 |
+ local disp="${src} patch" |
49 |
+ local log="${T}/elibtool.log" |
50 |
+ |
51 |
+ if [[ -z ${__ELT_NOTED_TMP} ]] ; then |
52 |
+ __ELT_NOTED_TMP=true |
53 |
+ printf 'temp patch: %s\n' "${patch}" > "${log}" |
54 |
+ fi |
55 |
+ printf '\nTrying %s\n' "${disp}" >> "${log}" |
56 |
|
57 |
# We only support patchlevel of 0 - why worry if its static patches? |
58 |
- if patch -p0 --dry-run "${file}" "${patch}" >> "${T}/elibtool.log" 2>&1 ; then |
59 |
- einfo " Applying $(basename "$(dirname "${patch}")")-${patch##*/}.patch ..." |
60 |
- patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" \ |
61 |
- >> "${T}/elibtool.log" 2>&1 |
62 |
+ if patch -p0 --dry-run "${file}" "${patch}" >> "${log}" 2>&1 ; then |
63 |
+ einfo " Applying ${disp} ..." |
64 |
+ patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" >> "${log}" 2>&1 |
65 |
ret=$? |
66 |
- export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${patch##*/}" |
67 |
+ export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${src}" |
68 |
else |
69 |
ret=1 |
70 |
fi |
71 |
@@ -61,7 +66,7 @@ |
72 |
# apply to $1 ... |
73 |
# |
74 |
ELT_walk_patches() { |
75 |
- local patch |
76 |
+ local patch tmp |
77 |
local ret=1 |
78 |
local file=$1 |
79 |
local patch_set=$2 |
80 |
@@ -71,20 +76,21 @@ |
81 |
[[ -z ${patch_set} ]] && return 1 |
82 |
[[ ! -d ${patch_dir} ]] && return 1 |
83 |
|
84 |
- pushd "${ELT_PATCH_DIR}" >/dev/null |
85 |
+ # Allow patches to use @GENTOO_LIBDIR@ replacements |
86 |
+ local sed_args=( -e "s:@GENTOO_LIBDIR@:$(get_libdir):g" ) |
87 |
+ if [[ -n ${rem_int_dep} ]] ; then |
88 |
+ # replace @REM_INT_DEP@ with what was passed |
89 |
+ # to --remove-internal-dep |
90 |
+ sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ) |
91 |
+ fi |
92 |
+ |
93 |
+ pushd "${ELT_PATCH_DIR}" >/dev/null || die |
94 |
|
95 |
# Go through the patches in reverse order (newer version to older) |
96 |
for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do |
97 |
- # For --remove-internal-dep ... |
98 |
- if [[ -n ${rem_int_dep} ]] ; then |
99 |
- # For replace @REM_INT_DEP@ with what was passed |
100 |
- # to --remove-internal-dep |
101 |
- local tmp="${T}/$$.rem_int_deps.patch" |
102 |
- sed -e "s|@REM_INT_DEP@|${rem_int_dep}|g" "${patch}" > "${tmp}" |
103 |
- patch=${tmp} |
104 |
- fi |
105 |
- |
106 |
- if ELT_try_and_apply_patch "${file}" "${patch}" ; then |
107 |
+ tmp="${T}/libtool-elt.patch" |
108 |
+ sed "${sed_args[@]}" "${patch}" > "${tmp}" || die |
109 |
+ if ELT_try_and_apply_patch "${file}" "${tmp}" "${patch}" ; then |
110 |
# Break to unwind w/popd rather than return directly |
111 |
ret=0 |
112 |
break |