sys-kernel/pf-sources: bump to 5.6-pf3
[gentoo.git] / sys-kernel / linux-headers / linux-headers-4.4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="4"
5
6 ETYPE="headers"
7 H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa"
8 inherit kernel-2 toolchain-funcs
9 detect_version
10
11 PATCH_VER="1"
12 SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
13         ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
14
15 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~amd64-linux ~x86-linux"
16
17 DEPEND="app-arch/xz-utils
18         dev-lang/perl"
19 RDEPEND=""
20
21 S=${WORKDIR}/gentoo-headers-base-${PV}
22
23 src_unpack() {
24         unpack ${A}
25 }
26
27 src_prepare() {
28         [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
29 }
30
31 src_install() {
32         kernel-2_src_install
33
34         # hrm, build system sucks
35         find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
36         find "${ED}" -depth -type d -delete 2>/dev/null
37 }
38
39 src_test() {
40         # Make sure no uapi/ include paths are used by accident.
41         egrep -r \
42                 -e '# *include.*["<]uapi/' \
43                 "${D}" && die "#include uapi/xxx detected"
44
45         einfo "Possible unescaped attribute/type usage"
46         egrep -r \
47                 -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
48                 -e '\<([us](8|16|32|64))\>' \
49                 .
50
51         einfo "Missing linux/types.h include"
52         egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
53
54         emake ARCH=$(tc-arch-kernel) headers_check
55 }