aboutsummaryrefslogtreecommitdiffstats
path: root/sys-kernel/sifive-sources/sifive-sources-5.16.10.ebuild
blob: 3eccc3867155e5dd605fb28c747c7a0fea0714e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="8"
ETYPE="sources"
K_WANT_GENPATCHES="base extras experimental"
K_GENPATCHES_VER="11"

inherit kernel-2
detect_version
detect_arch

KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
HOMEPAGE="https://github.com/sifive/meta-sifive"
IUSE="experimental"

META_SIFIVE="2021.11"

DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree and meta-sifive-${META_SIFIVE} patches"
SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} https://github.com/sifive/meta-sifive/archive/refs/heads/${META_SIFIVE}.zip -> meta-sifive-${META_SIFIVE}.zip"

src_prepare() {
	unpack meta-sifive-${META_SIFIVE}.zip
	rm "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files/0002-riscv-sifive-unmatched-update-regulators-values.patch"
	rm "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files/0003-riscv-sifive-unmatched-define-PWM-LEDs.patch"
	rm "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files/0004-riscv-sifive-unmatched-add-gpio-poweroff-node.patch"
	rm "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files/0005-SiFive-HiFive-Unleashed-Add-PWM-LEDs-D1-D2-D3-D4.patch"
	rm "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files/0007-riscv-enable-generic-PCI-resource-mapping.patch"
	rm "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files/29868ae1478fe18231672da94c4e862a03218a25.patch"
	eapply "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files"
	cp "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}/recipes-kernel/linux/files/defconfig" "${WORKDIR}/linux-${KV_FULL}/arch/riscv/configs/unmatched_defconfig"
	rm -R "${WORKDIR}/linux-${KV_FULL}/meta-sifive-${META_SIFIVE}"
	eapply_user
}

pkg_postinst() {
	kernel-2_pkg_postinst
	einfo "For more info on this patchset, and how to report problems, see:"
	einfo "${HOMEPAGE}"
}

pkg_postrm() {
	kernel-2_pkg_postrm
}