]> git.wh0rd.org - patches.git/blob - newlib-ebuild-cleanup.patch
more random patches. who knows.
[patches.git] / newlib-ebuild-cleanup.patch
1 Index: newlib-1.14.0.ebuild
2 ===================================================================
3 RCS file: /var/cvsroot/gentoo-x86/sys-libs/newlib/newlib-1.14.0.ebuild,v
4 retrieving revision 1.2
5 diff -u -p -r1.2 newlib-1.14.0.ebuild
6 --- newlib-1.14.0.ebuild 23 Aug 2006 08:55:02 -0000 1.2
7 +++ newlib-1.14.0.ebuild 5 Nov 2006 23:07:17 -0000
8 @@ -2,7 +2,9 @@
9 # Distributed under the terms of the GNU General Public License v2
10 # $Header: /var/cvsroot/gentoo-x86/sys-libs/newlib/newlib-1.14.0.ebuild,v 1.2 2006/08/23 08:55:02 mr_bones_ Exp $
11
12 -inherit eutils flag-o-matic gnuconfig autotools
13 +WANT_AUTOCONF="latest"
14 +WANT_AUTOMAKE="latest"
15 +inherit eutils autotools flag-o-matic
16
17 export CBUILD=${CBUILD:-${CHOST}}
18 export CTARGET=${CTARGET:-${CHOST}}
19 @@ -20,7 +22,7 @@ fi
20 DESCRIPTION="Newlib is a C library intended for use on embedded systems"
21 HOMEPAGE="http://sourceware.org/newlib/"
22 SRC_URI="ftp://sources.redhat.com/pub/newlib/${P}.tar.gz
23 - mirror://gentoo/${P}-spu.patch.gz"
24 + mirror://gentoo/${P}-spu.patch.gz"
25
26 LICENSE="NEWLIB LIBGLOSS GPL-2"
27 [[ ${CTARGET} != ${CHOST} ]] \
28 @@ -28,71 +30,51 @@ LICENSE="NEWLIB LIBGLOSS GPL-2"
29 || SLOT="0"
30 KEYWORDS="-* ~ppc64 ~ppc"
31 IUSE="nls threads unicode multilib"
32 +RESTRICT="strip"
33
34 -DEPEND="sys-devel/gnuconfig"
35 +DEPEND=""
36 RDEPEND=""
37
38 -RESTRICT="nostrip"
39 -
40 NEWLIBBUILD="${WORKDIR}/build"
41
42 -alt_build_kprefix() {
43 - if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \
44 - || [[ -n ${UCLIBC_AND_GLIBC} ]]
45 - then
46 - echo /usr
47 - else
48 - echo /usr/${CTARGET}/usr
49 - fi
50 -}
51 -
52 src_unpack() {
53 unpack ${A}
54 - epatch ${WORKDIR}/${P}-spu.patch
55 - einfo "Updating configure scripts"
56 - cd ${S}
57 - gnuconfig_update
58 - export WANT_AUTOCONF=2.1
59 - # ugly workaround
60 - for a in libgloss libgloss/doc libgloss/libnosys
61 - do
62 - pushd ${S}/${a} >/dev/null
63 - aclocal 2>/dev/null
64 - autoconf 2>/dev/null
65 - popd >/dev/null
66 - done
67 - mkdir ${NEWLIBBUILD}
68 + epatch "${WORKDIR}"/${P}-spu.patch
69 + cd "${S}"
70 + eautoreconf
71 + mkdir -p "${NEWLIBBUILD}"
72 }
73
74 src_compile() {
75 + unset LDFLAGS
76 + CHOST=${CTARGET} strip-unsupported-flags
77 +
78 local myconf=""
79 -#hardwired to avoid breakages
80 + # hardwired to avoid breakages
81 [[ ${CTARGET} == *-softfloat-* ]] \
82 && myconf="--disable-newlib-hw-fp" \
83 || myconf="--enable-newlib-hw-fp"
84 -
85 -#to the user discretion
86 - myconf="${myconf} `use_enable unicode newlib-mb`"
87 - myconf="${myconf} `use_enable nls`"
88 - myconf="${myconf} `use_enable multilib`"
89 [[ ${CTARGET} == "spu" ]] \
90 && myconf="${myconf} --disable-threads" \
91 - || myconf="${myconf} `use_enable threads`"
92 + || myconf="${myconf} $(use_enable threads)"
93
94 - cd ${NEWLIBBUILD}
95 + cd "${NEWLIBBUILD}"
96
97 - ../${P}/configure \
98 - --host=${CHOST} \
99 - --target=${CTARGET} \
100 - --prefix=/usr \
101 - ${myconf} || die "econf failed"
102 + ECONF_SOURCE=${S} \
103 + econf \
104 + --host=${CTARGET} \
105 + $(use_enable unicode newlib-mb) \
106 + $(use_enable nls) \
107 + $(use_enable multilib) \
108 + ${myconf} \
109 + || die "econf failed"
110 emake || die "emake failed"
111 }
112
113 src_install() {
114 - cd ${NEWLIBBUILD}
115 - emake -j1 DESTDIR=${D} install
116 + cd "${NEWLIBBUILD}"
117 + emake -j1 DESTDIR="${D}" install
118 env -uRESTRICT CHOST=${CTARGET} prepallstrip
119 # minor hack to keep things clean
120 - rm -fR ${D}/usr/info
121 + rm -fR "${D}"/usr/info
122 }