1 # Copyright 2020-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit kernel-build toolchain-funcs
9 GENPATCHES_P
=genpatches-
${PV%.*}-$
((${PV##*.} + 2))
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"
33 >=virtual/dist-kernel-${PV}"
35 QA_FLAGS_IGNORED
="usr/src/linux-.*/scripts/gcc-plugins/.*.so"
39 ewarn
"${PN} is *not* supported by the Gentoo Kernel Project in any way."
40 ewarn
"You have to configure the kernel by yourself."
41 ewarn
"Generally emerge this package using default config will fail to boot."
42 ewarn
"If you need support, please contact the ${HOMEPAGE} or maintainer directly."
43 ewarn
"Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
44 ewarn
"the ebuilds. Thank you."
46 python-any-r1_pkg_setup
"$@"
47 if use clang
&& ! tc-is-clang
; then
54 export OBJCOPY
=llvm-objcopy
55 export OBJDUMP
=llvm-objdump
56 export READELF
=llvm-readelf
57 export STRIP
=llvm-strip
64 # delete linux version patches
65 rm "${WORKDIR}"/10*.
patch || die
71 "${WORKDIR}"/patch-${PV}-xanmod${XV}
74 PATCHES+=("${DISTDIR}/cjktty-
${PV%.*}.
patch")
78 # prepare the default config
82 cp "${S}/CONFIGS
/xanmod
/clang
/config
" .config || die
84 cp "${S}/CONFIGS
/xanmod
/gcc
/config
" .config || die
88 die "Unsupported arch
${ARCH}"
92 local myversion="-xanmod${XV}"
93 echo "CONFIG_LOCALVERSION
=\"${myversion}\"" >"${T}"/version.config || die
94 echo "CONFIG_MODPROBE_PATH
=\"/sbin
/modprobe
\"" >"${T}"/modprobe.config || die
98 "${T}"/modprobe.config
101 kernel-build_merge_configs "${merge_configs[@]}"
102 # delete localversion
103 rm "${S}/localversion
" || die