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

Diff of /eclass/libtool.eclass

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

Revision 1.11 Revision 1.18
1#!/bin/bash
2# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2002 Gentoo Technologies, Inc.
3# Distributed under the terms of the GNU General Public License, v2 or later 2# Distributed under the terms of the GNU General Public License v2
4# Author: Martin Schlemmer <azarah@gentoo.org> 3# Author: Martin Schlemmer <azarah@gentoo.org>
5# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.11 2002/07/03 19:11:27 azarah Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.18 2002/12/16 02:36:05 azarah Exp $
6# This eclass patches ltmain.sh distributed with libtoolized packages with the 5# This eclass patches ltmain.sh distributed with libtoolized packages with the
7# relink and portage patch 6# relink and portage patch
7
8ECLASS=libtool 8ECLASS=libtool
9INHERITED="$INHERITED $ECLASS"
10
9newdepend sys-devel/libtool 11newdepend "!bootstrap? ( sys-devel/libtool )"
10 12
11DESCRIPTION="Based on the ${ECLASS} eclass" 13DESCRIPTION="Based on the ${ECLASS} eclass"
12 14
13ELIBTOOL_VERSION=1.8.1 15ELIBTOOL_VERSION=1.8.1
14 16
21 local dorelink="yes" 23 local dorelink="yes"
22 local dotmp="yes" 24 local dotmp="yes"
23 local doportage="yes" 25 local doportage="yes"
24 local portage="no" 26 local portage="no"
25 local reversedeps="no" 27 local reversedeps="no"
28 local removeinternaldep="no"
29 local deptoremove=""
26 local mylist="" 30 local mylist=""
27 31
28 mylist="$(find_ltmain)" 32 mylist="$(find_ltmain)"
29 for x in ${*} 33 for x in ${*}
30 do 34 do
39 # http://bugzilla.gnome.org/show_bug.cgi?id=75635 43 # http://bugzilla.gnome.org/show_bug.cgi?id=75635
40 if [ "${x}" = "--reverse-deps" ] 44 if [ "${x}" = "--reverse-deps" ]
41 then 45 then
42 reversedeps="yes" 46 reversedeps="yes"
43 fi 47 fi
48 if [ `echo ${x} | grep "^--remove-internal-dep="` ]
49 then
50 removeinternaldep="yes"
51 deptoremove=`echo ${x} | sed -e 's/--remove-internal-dep=//'`
52 fi
44 # Only patch the ltmain.sh in ${S} 53 # Only patch the ltmain.sh in ${S}
45 if [ "${x}" = "--shallow" ] 54 if [ "${x}" = "--shallow" ]
46 then 55 then
47 if [ -f ${S}/ltmain.sh ] 56 if [ -f ${S}/ltmain.sh ]
48 then 57 then
65 dotmp="yes" 74 dotmp="yes"
66 doportage="yes" 75 doportage="yes"
67 76
68 for y in test_patch relink_patch tmp_patch portage_patch 77 for y in test_patch relink_patch tmp_patch portage_patch
69 do 78 do
70 if ! eval ${y} --test $>${T}/libtool.foo 79 if ! eval ${y} --test $>${T}/elibtool.log
71 then 80 then
72 case ${y} in 81 case ${y} in
73 test_patch) 82 test_patch)
74 # non critical patch 83 # non critical patch
75 dotest="no" 84 dotest="no"
140 fi 149 fi
141 ;; 150 ;;
142 esac 151 esac
143 152
144 einfo "Applying libtool-${y/_patch/}.patch..." 153 einfo "Applying libtool-${y/_patch/}.patch..."
145 eval ${y} $>${T}/libtool.foo 154 eval ${y} $>${T}/elibtool.log
146 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] 155 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] && [ "${removeinternaldep}" = "no" ]
147 then 156 then
148 ewarn "Cannot apply any patch, running libtoolize..." 157 ewarn "Cannot apply any patch, running libtoolize..."
149 libtoolize --copy --force 158 libtoolize --copy --force
150 break 159 break
151 fi 160 fi
155 then 164 then
156 if eval reversedeps_patch --test $>${T}/libtool.foo 165 if eval reversedeps_patch --test $>${T}/libtool.foo
157 then 166 then
158 einfo "Applying libtool-reverse-deps.patch..." 167 einfo "Applying libtool-reverse-deps.patch..."
159 eval reversedeps_patch $>${T}/libtool.foo 168 eval reversedeps_patch $>${T}/libtool.foo
169 else
170 ewarn "Not applying libtool-reverse-deps.patch..."
171 fi
172 fi
173
174 if [ "${removeinternaldep}" = "yes" ]
175 then
176 if eval remove_internal_dep_patch $deptoremove --test $>${T}/libtool.foo
177 then
178 einfo "Applying remove-internal-dep.patch (removing $deptoremove)..."
179 eval remove_internal_dep_patch $deptoremove $>${T}/libtool.foo
180 else
181 ewarn "Not applying libtool-remove-internal-dep.patch..."
160 fi 182 fi
161 fi 183 fi
162 done 184 done
163 185
164 if [ -f libtool ] 186 if [ -f libtool ]
382 fi 404 fi
383 fi 405 fi
384 406
385 ENDPATCH 407 ENDPATCH
386 408
387 retval=$? 409 retval=$?
388 410
389 # This one dont apply clean to libtool-1.4.2a, so do it manually. 411 # This one dont apply clean to libtool-1.4.2a, so do it manually.
390 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ] 412 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ]
391 then 413 then
392 cp ltmain.sh ltmain.sh.orig 414 cp ltmain.sh ltmain.sh.orig
393 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \ 415 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \
394 ltmain.sh.orig > ltmain.sh 416 ltmain.sh.orig > ltmain.sh
395 rm -f ltmain.sh.orig 417 rm -f ltmain.sh.orig
396 fi 418 fi
397 419
398 return ${retval} 420 return ${retval}
399} 421}
400 422
401tmp_patch() { 423tmp_patch() {
402 424
403 local opts="" 425 local opts=""
770 ;; 792 ;;
771 *) tmp_libs="$tmp_libs $deplib" ;; 793 *) tmp_libs="$tmp_libs $deplib" ;;
772 ENDPATCH 794 ENDPATCH
773} 795}
774 796
797remove_internal_dep_patch() {
798 local opts=""
799
800 if [ "${2}" = "--test" ]
801 then
802 opts="--force --dry-run"
803 fi
804
805 patch ${opts} -p0 <<-ENDPATCH
806 --- ltmain.sh.orig 2002-11-01 19:56:50.000000000 -0600
807 +++ ltmain.sh 2002-11-01 19:57:03.000000000 -0600
808 @@ -4551,6 +4551,8 @@
809 if test "\$installed" = yes && test "\$D"; then
810 install_libdir="\`echo "\$install_libdir" |sed -e "s:\$D::g" -e 's://:/:g'\`"
811 fi
812 + # Removing $1 from dependency_libs in .la
813 + dependency_libs=\`echo \$dependency_libs | \$Xsed -e 's%\([^ ]*lib${1}\.\(so\|la\|a\)\)\|\(-l${1}\)%%g'\`
814 \$echo > \$output "\\
815 # \$outputname - a libtool library file
816 # Generated by \$PROGRAM - GNU \$PACKAGE \$VERSION\$TIMESTAMP
817 ENDPATCH
818}
819

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20