1 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/linux-headers/linux-headers-3.1.ebuild,v 1.6 2012/02/01 21:37:30 ranger Exp $ |
4 |
|
5 |
EAPI="3" |
6 |
|
7 |
ETYPE="headers" |
8 |
H_SUPPORTEDARCH="alpha amd64 arm bfin cris hppa m68k mips ia64 ppc ppc64 s390 sh sparc x86" |
9 |
inherit kernel-2 |
10 |
detect_version |
11 |
|
12 |
PATCH_VER="1" |
13 |
SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz" |
14 |
[[ -n ${PATCH_VER} ]] && SRC_URI="${SRC_URI} mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz" |
15 |
|
16 |
KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-linux ~x86-linux" |
17 |
|
18 |
DEPEND="app-arch/xz-utils |
19 |
dev-lang/perl" |
20 |
RDEPEND="" |
21 |
|
22 |
S=${WORKDIR}/gentoo-headers-base-${PV} |
23 |
|
24 |
src_unpack() { |
25 |
unpack ${A} |
26 |
} |
27 |
|
28 |
src_prepare() { |
29 |
has x32 $(get_all_abis) || EPATCH_EXCLUDE+=" 90_all_x32-3.1.patch" |
30 |
[[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV} |
31 |
} |
32 |
|
33 |
src_install() { |
34 |
kernel-2_src_install |
35 |
cd "${D}" |
36 |
egrep -r \ |
37 |
-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \ |
38 |
-e '\<([us](8|16|32|64))\>' \ |
39 |
. |
40 |
headers___fix $(find -type f) |
41 |
|
42 |
egrep -l -r -e '__[us](8|16|32|64)' "${D}" | xargs grep -L linux/types.h |
43 |
|
44 |
# hrm, build system sucks |
45 |
find "${D}" '(' -name '.install' -o -name '*.cmd' ')' -print0 | xargs -0 rm -f |
46 |
|
47 |
# provided by libdrm (for now?) |
48 |
rm -rf "${D}"/$(kernel_header_destdir)/drm |
49 |
} |
50 |
|
51 |
src_test() { |
52 |
emake ARCH=$(tc-arch-kernel) headers_check || die |
53 |
} |