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

Contents of /sys-libs/glibc/glibc-2.13-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.25 - (show annotations) (download)
Fri Mar 14 09:11:35 2014 UTC (7 months, 2 weeks ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.24: +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.13-r4.ebuild,v 1.24 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 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86"
12 RESTRICT="strip" # strip ourself #46186
13 EMULTILIB_PKG="true"
14
15 # Configuration variables
16 if [[ ${PV} == *_p* ]] ; then
17 RELEASE_VER=${PV%_p*}
18 BRANCH_UPDATE=""
19 SNAP_VER=${PV#*_p}
20 else
21 RELEASE_VER=${PV}
22 BRANCH_UPDATE=""
23 SNAP_VER=""
24 fi
25 LIBIDN_VER="" # it's integrated into the main tarball now
26 PATCH_VER="11" # Gentoo patchset
27 PORTS_VER="2.13" # version of glibc ports addon
28 LT_VER="" # version of linuxthreads addon
29 NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
30 #LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
31
32 IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
33 S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
34
35 # Here's how the cross-compile logic breaks down ...
36 # CTARGET - machine that will target the binaries
37 # CHOST - machine that will host the binaries
38 # CBUILD - machine that will build the binaries
39 # If CTARGET != CHOST, it means you want a libc for cross-compiling.
40 # If CHOST != CBUILD, it means you want to cross-compile the libc.
41 # CBUILD = CHOST = CTARGET - native build/install
42 # CBUILD != (CHOST = CTARGET) - cross-compile a native build
43 # (CBUILD = CHOST) != CTARGET - libc for cross-compiler
44 # CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
45 # For install paths:
46 # CHOST = CTARGET - install into /
47 # CHOST != CTARGET - install into /usr/CTARGET/
48
49 export CBUILD=${CBUILD:-${CHOST}}
50 export CTARGET=${CTARGET:-${CHOST}}
51 if [[ ${CTARGET} == ${CHOST} ]] ; then
52 if [[ ${CATEGORY} == cross-* ]] ; then
53 export CTARGET=${CATEGORY#cross-}
54 fi
55 fi
56
57 [[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
58
59 is_crosscompile() {
60 [[ ${CHOST} != ${CTARGET} ]]
61 }
62
63 # Why SLOT 2.2 you ask yourself while sippin your tea ?
64 # Everyone knows 2.2 > 0, duh.
65 SLOT="2.2"
66
67 # General: We need a new-enough binutils for as-needed
68 # arch: we need to make sure our binutils/gcc supports TLS
69 DEPEND=">=sys-devel/gcc-3.4.4
70 arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
71 x86? ( >=sys-devel/gcc-4.3 )
72 amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
73 ppc? ( >=sys-devel/gcc-4.1.0 )
74 ppc64? ( >=sys-devel/gcc-4.1.0 )
75 >=sys-devel/binutils-2.15.94
76 ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
77 >=app-misc/pax-utils-0.1.10
78 virtual/os-headers
79 !<sys-apps/sandbox-1.2.18.1-r2
80 !<sys-apps/portage-2.1.2
81 !<sys-devel/patch-2.6
82 selinux? ( sys-libs/libselinux )"
83 RDEPEND="!sys-kernel/ps3-sources
84 selinux? ( sys-libs/libselinux )"
85
86 if [[ ${CATEGORY} == cross-* ]] ; then
87 DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
88 [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
89 else
90 DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
91 RDEPEND="${RDEPEND}
92 vanilla? ( !sys-libs/timezone-data )
93 !vanilla? ( sys-libs/timezone-data )"
94 fi
95
96 SRC_URI=$(
97 upstream_uris() {
98 echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
99 }
100 gentoo_uris() {
101 local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
102 devspace=${devspace//HTTP/http://dev.gentoo.org/}
103 echo mirror://gentoo/$1 ${devspace//URI/$1}
104 }
105
106 TARNAME=${PN}
107 if [[ -n ${SNAP_VER} ]] ; then
108 TARNAME="${PN}-${RELEASE_VER}"
109 [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
110 upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
111 else
112 upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
113 fi
114 [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
115 [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
116 [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
117 [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
118 [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
119 )
120
121 # eblit-include [--skip] <function> [version]
122 eblit-include() {
123 local skipable=false
124 [[ $1 == "--skip" ]] && skipable=true && shift
125 [[ $1 == pkg_* ]] && skipable=true
126
127 local e v func=$1 ver=$2
128 [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
129 for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
130 e="${FILESDIR}/eblits/${func}${v}.eblit"
131 if [[ -e ${e} ]] ; then
132 source "${e}"
133 return 0
134 fi
135 done
136 ${skipable} && return 0
137 die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
138 }
139
140 # eblit-run-maybe <function>
141 # run the specified function if it is defined
142 eblit-run-maybe() {
143 [[ $(type -t "$@") == "function" ]] && "$@"
144 }
145
146 # eblit-run <function> [version]
147 # aka: src_unpack() { eblit-run src_unpack ; }
148 eblit-run() {
149 eblit-include --skip common "${*:2}"
150 eblit-include "$@"
151 eblit-run-maybe eblit-$1-pre
152 eblit-${PN}-$1
153 eblit-run-maybe eblit-$1-post
154 }
155
156 src_unpack() { eblit-run src_unpack ; }
157 src_compile() { eblit-run src_compile ; }
158 src_test() { eblit-run src_test ; }
159 src_install() { eblit-run src_install ; }
160
161 # FILESDIR might not be available during binpkg install
162 for x in setup {pre,post}inst ; do
163 e="${FILESDIR}/eblits/pkg_${x}.eblit"
164 if [[ -e ${e} ]] ; then
165 . "${e}"
166 eval "pkg_${x}() { eblit-run pkg_${x} ; }"
167 fi
168 done
169
170 pkg_setup() {
171 eblit-run pkg_setup
172
173 # Static binary sanity check #332927
174 if [[ ${ROOT} == "/" ]] && \
175 has_version "<${CATEGORY}/${P}" && \
176 built_with_use sys-apps/coreutils static
177 then
178 eerror "Please rebuild coreutils with USE=-static, then install"
179 eerror "glibc, then you may rebuild coreutils with USE=static."
180 die "Avoiding system meltdown #332927"
181 fi
182 }
183
184 eblit-src_unpack-post() {
185 if use hardened ; then
186 cd "${S}"
187 einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
188 gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
189 epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
190 epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
191
192 einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
193 cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
194 debug/stack_chk_fail.c || die
195 cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
196 debug/chk_fail.c || die
197
198 if use debug ; then
199 # When using Hardened Gentoo stack handler, have smashes dump core for
200 # analysis - debug only, as core could be an information leak
201 # (paranoia).
202 sed -i \
203 -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
204 debug/Makefile \
205 || die "Failed to modify debug/Makefile for debug stack handler"
206 sed -i \
207 -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
208 debug/Makefile \
209 || die "Failed to modify debug/Makefile for debug fortify handler"
210 fi
211
212 # Build nscd with ssp-all
213 sed -i \
214 -e 's:-fstack-protector$:-fstack-protector-all:' \
215 nscd/Makefile \
216 || die "Failed to ensure nscd builds with ssp-all"
217 fi
218 }

  ViewVC Help
Powered by ViewVC 1.1.20