dev-db/mongodb: fix mask format
[gentoo-zh.git] / sys-kernel / xanmod-kernel / xanmod-kernel-5.10.112.ebuild
blobc75c565ff3c4dda48ad8304e7f0a6d044066e397
1 # Copyright 2020-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=7
6 inherit kernel-build python-any-r1
8 MY_P=linux-${PV%.*}
9 GENPATCHES_P=genpatches-${PV%.*}-$((${PV##*.} + 8))
10 XV="1"
12 DESCRIPTION="XanMod lts kernel built with Gentoo patches and cjktty"
13 HOMEPAGE="https://www.kernel.org/"
14 SRC_URI+=" https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 1).x/${MY_P}.tar.xz
15 https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.base.tar.xz
16 https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.extras.tar.xz
17 https://github.com/xanmod/linux/releases/download/${PV}-xanmod${XV}/patch-${PV}-xanmod${XV}.xz
18 https://raw.githubusercontent.com/zhmars/cjktty-patches/master/v5.x/cjktty-${PV%.*}.patch"
19 S=${WORKDIR}/${MY_P}
21 LICENSE="GPL-2"
22 KEYWORDS="~amd64"
23 IUSE="cjk"
24 SLOT="lts"
26 PDEPEND="
27 >=virtual/dist-kernel-${PV}"
29 QA_FLAGS_IGNORED="usr/src/linux-.*/scripts/gcc-plugins/.*.so"
31 pkg_setup() {
32 ewarn ""
33 ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
34 ewarn "You have to configure the kernel by yourself."
35 ewarn "Generally emerge this package using default config will fail to boot."
36 ewarn "If you need support, please contact the ${HOMEPAGE} or maintainer directly."
37 ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
38 ewarn "the ebuilds. Thank you."
39 ewarn ""
40 python-any-r1_pkg_setup "$@"
43 src_prepare() {
44 # delete linux version patches
45 rm "${WORKDIR}"/*${MY_P}*.patch || die
47 local PATCHES=(
48 # genpatches
49 "${WORKDIR}"/*.patch
50 # xanmod patches
51 "${WORKDIR}"/patch-${PV}-xanmod${XV}
53 if use cjk; then
54 PATCHES+=("${DISTDIR}/cjktty-${PV%.*}.patch")
56 default
58 # prepare the default config
59 case ${ARCH} in
60 amd64)
61 cp "${S}/CONFIGS/xanmod/gcc/config" .config || die
64 die "Unsupported arch ${ARCH}"
66 esac
68 local myversion="-xanmod${XV}"
69 echo "CONFIG_LOCALVERSION=\"${myversion}\"" >"${T}"/version.config || die
70 echo "CONFIG_MODPROBE_PATH=\"/sbin/modprobe\"" >"${T}"/modprobe.config || die
72 local merge_configs=(
73 "${T}"/version.config
74 "${T}"/modprobe.config
77 kernel-build_merge_configs "${merge_configs[@]}"
78 # delete localversion
79 rm "${S}/localversion" || die