1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc x86 xtensa"
8 inherit kernel-2 toolchain-funcs
12 SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
13 https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-base-${PV}.tar.xz
14 ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
15 ${PATCH_VER:+https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
18 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
20 DEPEND="app-arch/xz-utils
24 S=${WORKDIR}/gentoo-headers-base-${PV}
33 [[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}"/${PV}/*.patch
39 # hrm, build system sucks
40 find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
41 find "${ED}" -depth -type d -delete 2>/dev/null
45 # Make sure no uapi/ include paths are used by accident.
47 -e '# *include.*["<]uapi/' \
48 "${D}" && die "#include uapi/xxx detected"
50 einfo "Possible unescaped attribute/type usage"
52 -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
53 -e '\<([us](8|16|32|64))\>' \
56 einfo "Missing linux/types.h include"
57 egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
59 emake ARCH=$(tc-arch-kernel) headers_check