commit:     e9a03616c762b689a02860e17347eb484d14addf
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  8 23:08:30 2021 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Thu Jul  8 23:08:30 2021 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=e9a03616

sys-kernel/linux-headers: Fix headers for newer kernels with musl

Closes: https://bugs.gentoo.org/791364
Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 sys-kernel/linux-headers/Manifest                  |  2 +
 .../0001-Use-stddefs.h-instead-of-compiler.h.patch | 25 +++++++++++
 .../linux-headers/linux-headers-5.10-r1.ebuild     | 48 ++++++++++++++++++++++
 sys-kernel/linux-headers/metadata.xml              | 11 +++++
 4 files changed, 86 insertions(+)

diff --git a/sys-kernel/linux-headers/Manifest 
b/sys-kernel/linux-headers/Manifest
new file mode 100644
index 0000000..537ef88
--- /dev/null
+++ b/sys-kernel/linux-headers/Manifest
@@ -0,0 +1,2 @@
+DIST gentoo-headers-5.10-1.tar.xz 4304 BLAKE2B 
b5006ff13c8ef8394806919d547f1b15ac32cc4d290e8c5f5a5073f54112db194a9e743177ae54941d8a504e15b662751258259183c47c574936744d7c51b405
 SHA512 
3154558df20e3a8821af23b2a585eaccb6c40877850b1cf752c435c170f7f322a48e77cee63bcc061b69aff8602987f4506d803c73f394929716295aface4f3d
+DIST linux-5.10.tar.xz 116606704 BLAKE2B 
b923d7b66309224f42f35f8a5fa219421b0a9362d2adacdadd8d96251f61f7230878ea297a269a7f3b3c56830f0b177e068691e1d7f88501a05653b0a13274d1
 SHA512 
95bc137d0cf9148da6a9d1f1a878698dc27b40f68e22c597544010a6c591ce1b256f083489d3ff45ff77753289b535135590194d88ef9f007d0ddab3d74de70e

diff --git 
a/sys-kernel/linux-headers/files/0001-Use-stddefs.h-instead-of-compiler.h.patch 
b/sys-kernel/linux-headers/files/0001-Use-stddefs.h-instead-of-compiler.h.patch
new file mode 100644
index 0000000..5598e02
--- /dev/null
+++ 
b/sys-kernel/linux-headers/files/0001-Use-stddefs.h-instead-of-compiler.h.patch
@@ -0,0 +1,25 @@
+From 9eb3c31415686ae1296d7d450f886eeba5861ec1 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <[email protected]>
+Date: Thu, 3 Jun 2021 18:41:28 -0500
+Subject: [PATCH] Use stddefs.h instead of compiler.h
+
+---
+ include/uapi/linux/swab.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
+index 7272f85..3736f2f 100644
+--- a/include/uapi/linux/swab.h
++++ b/include/uapi/linux/swab.h
+@@ -3,7 +3,7 @@
+ #define _UAPI_LINUX_SWAB_H
+ 
+ #include <linux/types.h>
+-#include <linux/compiler.h>
++#include <linux/stddef.h>
+ #include <asm/bitsperlong.h>
+ #include <asm/swab.h>
+ 
+-- 
+2.31.1
+

diff --git a/sys-kernel/linux-headers/linux-headers-5.10-r1.ebuild 
b/sys-kernel/linux-headers/linux-headers-5.10-r1.ebuild
new file mode 100644
index 0000000..c38b7aa
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-5.10-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 cris frv hexagon hppa ia64 
m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh 
sparc x86 xtensa"
+inherit kernel-2 toolchain-funcs
+detect_version
+
+PATCH_PV=${PV} # to ease testing new versions against not existing patches
+PATCH_VER="1"
+SRC_URI="${KERNEL_URI}
+       
${PATCH_VER:+mirror://gentoo/gentoo-headers-${PATCH_PV}-${PATCH_VER}.tar.xz}
+       
${PATCH_VER:+https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-${PATCH_PV}-${PATCH_VER}.tar.xz}
+"
+
+KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 x86"
+
+DEPEND="app-arch/xz-utils
+       dev-lang/perl"
+RDEPEND=""
+
+S=${WORKDIR}/linux-${PV}
+
+src_unpack() {
+       unpack ${A}
+}
+
+src_prepare() {
+       [[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}"/${PATCH_PV}/*.patch
+
+       eapply "${FILESDIR}"/0001-Use-stddefs.h-instead-of-compiler.h.patch
+
+       default
+}
+
+src_test() {
+       emake headers_check ${xmakeopts}
+}
+
+src_install() {
+       kernel-2_src_install
+
+       # hrm, build system sucks
+       find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+       find "${ED}" -depth -type d -delete 2>/dev/null
+}

diff --git a/sys-kernel/linux-headers/metadata.xml 
b/sys-kernel/linux-headers/metadata.xml
new file mode 100644
index 0000000..fcf3f04
--- /dev/null
+++ b/sys-kernel/linux-headers/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<maintainer type="project">
+  <email>[email protected]</email>
+  <name>Gentoo Toolchain Project</name>
+</maintainer>
+<upstream>
+  <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+</upstream>
+</pkgmetadata>

Reply via email to