xanmod-{kernel, sources}: version bump
[gentoo-zh.git] / sys-kernel / xanmod-sources / xanmod-sources-5.18.19.ebuild
blobb75578a08761470d9783a4c3fbd97bd14d519145
1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI="8"
5 K_WANT_GENPATCHES="base extras"
6 #Note: to bump xanmod, check K_GENPATCHES_VER in sys-kernel/gentoo-sources
7 K_GENPATCHES_VER="23"
8 K_SECURITY_UNSUPPORTED="1"
9 K_NOSETEXTRAVERSION="1"
10 ETYPE="sources"
11 inherit kernel-2
12 detect_version
14 DESCRIPTION="Full XanMod source, including the Gentoo patchset and other patch options."
15 HOMEPAGE="https://xanmod.org
16 https://github.com/zhmars/cjktty-patches
17 https://github.com/hamadmarri/TT-CPU-Scheduler"
18 LICENSE+=" CDDL"
19 KEYWORDS="~amd64"
22 # Freeze the 'tt' use flag until the corresponding patch is released upstream.
24 #IUSE="cjktty tt"
26 IUSE="cjktty"
27 SLOT="edge"
28 XANMOD_VERSION="1"
29 XANMOD_URI="https://github.com/xanmod/linux/releases/download/"
30 OKV="${OKV}-xanmod"
31 TT_URI="https://raw.githubusercontent.com/hamadmarri/TT-CPU-Scheduler/master/patches/"
32 CJKTTY_URI="https://raw.githubusercontent.com/zhmars/cjktty-patches/master/v${KV_MAJOR}.x/"
33 SRC_URI="
34 ${KERNEL_BASE_URI}/linux-${KV_MAJOR}.${KV_MINOR}.tar.xz
35 ${GENPATCHES_URI}
36 ${XANMOD_URI}/${OKV}${XANMOD_VERSION}/patch-${OKV}${XANMOD_VERSION}.xz
37 ${CJKTTY_URI}/cjktty-${KV_MAJOR}.${KV_MINOR}.patch
39 #${TT_URI}/${KV_MAJOR}.${KV_MINOR}/tt-${KV_MAJOR}.${KV_MINOR}.patch
40 #${CJKTTY_URI}/cjktty-${KV_MAJOR}.${KV_MINOR}.patch
43 src_unpack() {
44 universal_unpack
45 mkdir "${WORKDIR}/genpatches" || die
46 for i in ${K_WANT_GENPATCHES}; do
47 tar xf "${DISTDIR}/genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz" -C "${WORKDIR}/genpatches"
48 done
50 rm "${WORKDIR}"/genpatches/*linux-"${KV_MAJOR}"."${KV_MINOR}"*.patch || die
52 UNIPATCH_LIST=""
53 for i in $(dir "${WORKDIR}"/genpatches/*.patch); do
54 UNIPATCH_LIST+=" ${i}"
55 done
57 if use cjktty; then
58 UNIPATCH_LIST+=" ${DISTDIR}/cjktty-${KV_MAJOR}.${KV_MINOR}.patch"
61 UNIPATCH_LIST+=" ${DISTDIR}/patch-${OKV}${XANMOD_VERSION}.xz"
62 unipatch "${UNIPATCH_LIST}"
63 unpack_fix_install_path
64 env_setup_xmakeopts
65 cd "${S}" || die
68 pkg_postinst() {
69 elog "MICROCODES"
70 elog "Use xanmod-sources with microcodes"
71 elog "Read https://wiki.gentoo.org/wiki/Intel_microcode"
73 kernel-2_pkg_postinst
76 pkg_postrm() {
77 kernel-2_pkg_postrm