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

Contents of /sys-libs/glibc/glibc-2.14.1-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.26 - (show annotations) (download)
Fri Mar 14 09:11:35 2014 UTC (6 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.25: +3 -3 lines
Inherit systemd & unpacker eclasses as newer eblits want.

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key D2E96200)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.14.1-r3.ebuild,v 1.25 2013/04/05 00:25:16 vapier Exp $
4
5 inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd 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.1+ BSD HPND inner-net"
11 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86"
12 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 LIBIDN_VER="" # it's integrated into the main tarball now
34 PATCH_VER="10" # Gentoo patchset
35 PORTS_VER=${RELEASE_VER} # version of glibc ports addon
36 LT_VER="" # version of linuxthreads addon
37 NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
38 #LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
39
40 IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
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-* ]] ; then
61 export CTARGET=${CATEGORY#cross-}
62 fi
63 fi
64
65 [[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
66
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 ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
85 >=app-misc/pax-utils-0.1.10
86 virtual/os-headers
87 !<sys-apps/sandbox-1.2.18.1-r2
88 !<sys-apps/portage-2.1.2
89 !<sys-devel/patch-2.6
90 selinux? ( sys-libs/libselinux )"
91 RDEPEND="!sys-kernel/ps3-sources
92 selinux? ( sys-libs/libselinux )"
93
94 if [[ ${CATEGORY} == cross-* ]] ; then
95 DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
96 [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
97 else
98 DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
99 RDEPEND="${RDEPEND}
100 vanilla? ( !sys-libs/timezone-data )
101 !vanilla? ( sys-libs/timezone-data )"
102 fi
103
104 SRC_URI=$(
105 upstream_uris() {
106 echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
107 }
108 gentoo_uris() {
109 local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
110 devspace=${devspace//HTTP/http://dev.gentoo.org/}
111 echo mirror://gentoo/$1 ${devspace//URI/$1}
112 }
113
114 TARNAME=${PN}
115 if [[ -n ${SNAP_VER} ]] ; then
116 TARNAME="${PN}-${RELEASE_VER}"
117 [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
118 upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
119 elif [[ -z ${EGIT_REPO_URIS} ]] ; then
120 upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
121 fi
122 [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
123 [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
124 [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
125 [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
126 [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_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 pkg_setup() {
179 eblit-run pkg_setup
180
181 # Static binary sanity check #332927
182 if [[ ${ROOT} == "/" ]] && \
183 has_version "<${CATEGORY}/${P}" && \
184 built_with_use sys-apps/coreutils static
185 then
186 eerror "Please rebuild coreutils with USE=-static, then install"
187 eerror "glibc, then you may rebuild coreutils with USE=static."
188 die "Avoiding system meltdown #332927"
189 fi
190 }
191
192 eblit-src_unpack-pre() {
193 GLIBC_PATCH_EXCLUDE+=" 1200_all_glibc-${PV}-x32.patch"
194 }
195
196 eblit-src_unpack-post() {
197 if use hardened ; then
198 cd "${S}"
199 einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
200 gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
201 epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
202 epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
203
204 einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
205 cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
206 debug/stack_chk_fail.c || die
207 cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
208 debug/chk_fail.c || die
209
210 if use debug ; then
211 # When using Hardened Gentoo stack handler, have smashes dump core for
212 # analysis - debug only, as core could be an information leak
213 # (paranoia).
214 sed -i \
215 -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
216 debug/Makefile \
217 || die "Failed to modify debug/Makefile for debug stack handler"
218 sed -i \
219 -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
220 debug/Makefile \
221 || die "Failed to modify debug/Makefile for debug fortify handler"
222 fi
223
224 # Build nscd with ssp-all
225 sed -i \
226 -e 's:-fstack-protector$:-fstack-protector-all:' \
227 nscd/Makefile \
228 || die "Failed to ensure nscd builds with ssp-all"
229 fi
230 }
231
232 eblit-pkg_preinst-post() {
233 if [[ ${CTARGET} == arm* ]] ; then
234 # Backwards compat support for renaming hardfp ldsos #417287
235 local oldso='/lib/ld-linux.so.3'
236 local nldso='/lib/ld-linux-armhf.so.3'
237 if [[ -e ${D}${nldso} ]] ; then
238 if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
239 ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
240 ewarn "Please rebuild all packages using this old ldso as compat"
241 ewarn "support will be dropped in the future."
242 ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
243 fi
244 fi
245 fi
246 }

  ViewVC Help
Powered by ViewVC 1.1.20