| # Copyright 1999-2022 Gentoo Authors |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=7 |
| |
| # shellcheck disable=SC2034 |
| ETYPE="headers" |
| # shellcheck disable=SC2034 |
| 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" |
| inherit kernel-2 |
| detect_version |
| |
| # shellcheck disable=SC2154 |
| SRC_URI="${KERNEL_URI}" |
| S="${WORKDIR}/linux-${PV}" |
| |
| KEYWORDS="*" |
| |
| BDEPEND=" |
| app-arch/xz-utils |
| dev-lang/perl" |
| |
| src_unpack() { |
| # avoid kernel-2_src_unpack |
| default |
| } |
| |
| src_prepare() { |
| # avoid kernel-2_src_prepare |
| default |
| } |
| |
| src_install() { |
| kernel-2_src_install |
| |
| find "${ED}" \( -name '.install' -o -name '*.cmd' \) -delete || die |
| # delete empty directories |
| find "${ED}" -empty -type d -delete || die |
| } |
| |
| src_test() { |
| # Make sure no uapi/ include paths are used by accident. |
| grep -E -r \ |
| -e '# *include.*["<]uapi/' \ |
| "${D}" && die "#include uapi/xxx detected" |
| |
| einfo "Possible unescaped attribute/type usage" |
| grep -E -r \ |
| -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \ |
| -e '\<([us](8|16|32|64))\>' \ |
| . |
| |
| einfo "Missing linux/types.h include" |
| grep -E -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h |
| |
| emake ARCH="$(tc-arch-kernel)" headers_check |
| } |