/[gentoo-x86]/sys-libs/glibc/glibc-2.16.0.ebuild
Gentoo

Contents of /sys-libs/glibc/glibc-2.16.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Sun Aug 12 04:45:49 2012 UTC (2 years, 2 months ago) by vapier
Branch: MAIN
Changes since 1.3: +2 -2 lines
Add alpha/arm keywords since it builds for both.

(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)

1 vapier 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 vapier 1.4 # $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.16.0.ebuild,v 1.3 2012/08/12 03:11:58 vapier Exp $
4 vapier 1.1
5     inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib unpacker multiprocessing
6    
7     DESCRIPTION="GNU libc6 (also called glibc2) C library"
8     HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
9    
10     LICENSE="LGPL-2"
11 vapier 1.4 #KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
12 vapier 1.1 RESTRICT="strip" # strip ourself #46186
13     EMULTILIB_PKG="true"
14    
15     # Configuration variables
16     RELEASE_VER=""
17     BRANCH_UPDATE=""
18     SNAP_VER=""
19     case ${PV} in
20     9999*)
21     EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
22     EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
23     inherit git-2
24     ;;
25     *_p*)
26     RELEASE_VER=${PV%_p*}
27     SNAP_VER=${PV#*_p}
28     ;;
29     *)
30     RELEASE_VER=${PV}
31     ;;
32     esac
33     MANPAGE_VER="" # pregenerated manpages
34     INFOPAGE_VER="" # pregenerated infopages
35     LIBIDN_VER="" # it's integrated into the main tarball now
36 vapier 1.3 PATCH_VER="2" # Gentoo patchset
37 vapier 1.1 PORTS_VER=${RELEASE_VER} # version of glibc ports addon
38     NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.16"} # min kernel version nptl requires
39    
40     IUSE="debug gd hardened multilib selinux systemtap profile vanilla crosscompile_opts_headers-only"
41     [[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
42    
43     # Here's how the cross-compile logic breaks down ...
44     # CTARGET - machine that will target the binaries
45     # CHOST - machine that will host the binaries
46     # CBUILD - machine that will build the binaries
47     # If CTARGET != CHOST, it means you want a libc for cross-compiling.
48     # If CHOST != CBUILD, it means you want to cross-compile the libc.
49     # CBUILD = CHOST = CTARGET - native build/install
50     # CBUILD != (CHOST = CTARGET) - cross-compile a native build
51     # (CBUILD = CHOST) != CTARGET - libc for cross-compiler
52     # CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
53     # For install paths:
54     # CHOST = CTARGET - install into /
55     # CHOST != CTARGET - install into /usr/CTARGET/
56    
57     export CBUILD=${CBUILD:-${CHOST}}
58     export CTARGET=${CTARGET:-${CHOST}}
59     if [[ ${CTARGET} == ${CHOST} ]] ; then
60     if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
61     export CTARGET=${CATEGORY/cross-}
62     fi
63     fi
64    
65 vapier 1.2 [[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.16/2.6.20}
66 vapier 1.1
67     is_crosscompile() {
68     [[ ${CHOST} != ${CTARGET} ]]
69     }
70    
71     # Why SLOT 2.2 you ask yourself while sippin your tea ?
72     # Everyone knows 2.2 > 0, duh.
73     SLOT="2.2"
74    
75     # General: We need a new-enough binutils for as-needed
76     # arch: we need to make sure our binutils/gcc supports TLS
77     DEPEND=">=sys-devel/gcc-3.4.4
78     arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
79     x86? ( >=sys-devel/gcc-4.3 )
80     amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
81     ppc? ( >=sys-devel/gcc-4.1.0 )
82     ppc64? ( >=sys-devel/gcc-4.1.0 )
83     >=sys-devel/binutils-2.15.94
84     >=app-misc/pax-utils-0.1.10
85     virtual/os-headers
86     !<sys-apps/sandbox-1.2.18.1-r2
87     !<sys-apps/portage-2.1.2
88     selinux? ( sys-libs/libselinux )"
89     RDEPEND="!sys-kernel/ps3-sources
90     selinux? ( sys-libs/libselinux )
91     !sys-libs/nss-db"
92    
93     if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
94     DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
95     [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
96     else
97     DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
98     RDEPEND="${RDEPEND}
99     vanilla? ( !sys-libs/timezone-data )
100     !vanilla? ( sys-libs/timezone-data )"
101     fi
102    
103     SRC_URI=$(
104     upstream_uris() {
105     echo mirror://gnu/glibc/$1 ftp://sources.redhat.com/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
106     }
107     gentoo_uris() {
108     local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
109     devspace=${devspace//HTTP/http://dev.gentoo.org/}
110     echo mirror://gentoo/$1 ${devspace//URI/$1}
111     }
112    
113     TARNAME=${PN}
114     if [[ -n ${SNAP_VER} ]] ; then
115     TARNAME="${PN}-${RELEASE_VER}"
116     [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
117     upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
118     elif [[ -z ${EGIT_REPO_URIS} ]] ; then
119     upstream_uris ${TARNAME}-${RELEASE_VER}.tar.xz
120     fi
121     [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
122     [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.xz
123     [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
124     [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
125     [[ -n ${MANPAGE_VER} ]] && gentoo_uris glibc-manpages-${MANPAGE_VER}.tar.bz2
126     [[ -n ${INFOPAGE_VER} ]] && gentoo_uris glibc-infopages-${INFOPAGE_VER}.tar.bz2
127     )
128    
129     # eblit-include [--skip] <function> [version]
130     eblit-include() {
131     local skipable=false
132     [[ $1 == "--skip" ]] && skipable=true && shift
133     [[ $1 == pkg_* ]] && skipable=true
134    
135     local e v func=$1 ver=$2
136     [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
137     for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
138     e="${FILESDIR}/eblits/${func}${v}.eblit"
139     if [[ -e ${e} ]] ; then
140     source "${e}"
141     return 0
142     fi
143     done
144     ${skipable} && return 0
145     die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
146     }
147    
148     # eblit-run-maybe <function>
149     # run the specified function if it is defined
150     eblit-run-maybe() {
151     [[ $(type -t "$@") == "function" ]] && "$@"
152     }
153    
154     # eblit-run <function> [version]
155     # aka: src_unpack() { eblit-run src_unpack ; }
156     eblit-run() {
157     eblit-include --skip common "${*:2}"
158     eblit-include "$@"
159     eblit-run-maybe eblit-$1-pre
160     eblit-${PN}-$1
161     eblit-run-maybe eblit-$1-post
162     }
163    
164     src_unpack() { eblit-run src_unpack ; }
165     src_compile() { eblit-run src_compile ; }
166     src_test() { eblit-run src_test ; }
167     src_install() { eblit-run src_install ; }
168    
169     # FILESDIR might not be available during binpkg install
170     for x in setup {pre,post}inst ; do
171     e="${FILESDIR}/eblits/pkg_${x}.eblit"
172     if [[ -e ${e} ]] ; then
173     . "${e}"
174     eval "pkg_${x}() { eblit-run pkg_${x} ; }"
175     fi
176     done
177    
178     eblit-src_unpack-post() {
179     if use hardened ; then
180     cd "${S}"
181     einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
182     gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
183     epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
184     epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
185    
186     einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
187     cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
188     debug/stack_chk_fail.c || die
189     cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
190     debug/chk_fail.c || die
191    
192     if use debug ; then
193     # When using Hardened Gentoo stack handler, have smashes dump core for
194     # analysis - debug only, as core could be an information leak
195     # (paranoia).
196     sed -i \
197     -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
198     debug/Makefile \
199     || die "Failed to modify debug/Makefile for debug stack handler"
200     sed -i \
201     -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
202     debug/Makefile \
203     || die "Failed to modify debug/Makefile for debug fortify handler"
204     fi
205    
206     # Build nscd with ssp-all
207     sed -i \
208     -e 's:-fstack-protector$:-fstack-protector-all:' \
209     nscd/Makefile \
210     || die "Failed to ensure nscd builds with ssp-all"
211     fi
212     }
213    
214     eblit-pkg_preinst-post() {
215     if [[ ${CTARGET} == arm* ]] ; then
216     # Backwards compat support for renaming hardfp ldsos #417287
217     local oldso='/lib/ld-linux.so.3'
218     local nldso='/lib/ld-linux-armhf.so.3'
219     if [[ -e ${D}${nldso} ]] ; then
220     if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
221     ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
222     ewarn "Please rebuild all packages using this old ldso as compat"
223     ewarn "support will be dropped in the future."
224     ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
225     fi
226     fi
227     fi
228     }
229    
230     maint_pkg_create() {
231     local base="/usr/local/src/gnu/glibc/glibc-${PV:0:1}_${PV:2:1}"
232     cd ${base}
233     local stamp=$(date +%Y%m%d)
234     local d
235     for d in libc ports ; do
236     #(cd ${d} && cvs up)
237     case ${d} in
238     libc) tarball="${P}";;
239     ports) tarball="${PN}-ports-${PV}";;
240     esac
241     rm -f ${tarball}*
242     ln -sf ${d} ${tarball}
243     tar hcf - ${tarball} --exclude-vcs | lzma > "${T}"/${tarball}.tar.lzma
244     du -b "${T}"/${tarball}.tar.lzma
245     done
246     }

  ViewVC Help
Powered by ViewVC 1.1.20