commit: fa002dd811de1257dc56e1c63ee6c44418f14497 Author: Violet Purcell <vimproved <AT> inventati <DOT> org> AuthorDate: Fri Jul 11 23:27:45 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Jul 12 05:54:56 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa002dd8
sys-kernel/scx: add 1.0.14 Additionally add missing BDEPEND on protobuf and missing RDEPEND on libseccomp, as discussed in https://github.com/sched-ext/scx/pull/2267. Signed-off-by: Violet Purcell <vimproved <AT> inventati.org> Part-of: https://github.com/gentoo/gentoo/pull/42961 Closes: https://github.com/gentoo/gentoo/pull/42961 Signed-off-by: Sam James <sam <AT> gentoo.org> sys-kernel/scx/Manifest | 2 + .../scx-1.0.14-builtin-preserve-enum-value.patch | 12 ++ sys-kernel/scx/scx-1.0.14.ebuild | 136 +++++++++++++++++++++ 3 files changed, 150 insertions(+) diff --git a/sys-kernel/scx/Manifest b/sys-kernel/scx/Manifest index 5c27e9e745d0..241fca3c4696 100644 --- a/sys-kernel/scx/Manifest +++ b/sys-kernel/scx/Manifest @@ -7,3 +7,5 @@ DIST scx-1.0.12-remove-unnecessary-rustc-requirement.patch 917 BLAKE2B 4cb308340 DIST scx-1.0.12.tar.gz 4702884 BLAKE2B fe812e98986bd6eda63f6a0b51774da08e75832805e27e57085a0eee8f8b5309d56daeee8d28ad7dda54f980442fa7a1834474edaff98fd984e4ed523c9a115e SHA512 5ee06c65c516b3f9a72d81865efb05dab68552ce781b856eb936622b9afe0935f1423f92daddb5b17e3159d6574bb79fa6c4dcc15a8a124ee0c23fe212458632 DIST scx-1.0.13-crates.tar.xz 32013000 BLAKE2B ffb07ed99b740a0d76289f6f99cb6432a920cdc049eef030b90a8df256ab359c59a0db438736cbdf9eac1f06faeac6a439765ec0aa4d54c03e21cbc8747bb2c1 SHA512 63dcc8e05045902017dc9d123dd2ca33f95971137369b2b2a42b88bb0eb2e81c0314319222639b499c1b4b62b77ad305572563fbe380a664f842f9fa523999d2 DIST scx-1.0.13.tar.gz 4824853 BLAKE2B 9630b758e1b9aca4ac8c3e78541c483384ff0962fe957c4b2ab51d463a5dc9dcd29b59a9414f688e1a5d7e8232cba884a740a18d4a1e11d59fa95c117e61ed06 SHA512 23ebe4dba95d194ad0436a44f750d3104b240c97a22194dc08725a278b62f49ee52bc93623be63fcea167b08400938ed7129594f68d78b194e9c030b5305402d +DIST scx-1.0.14-crates.tar.xz 44676328 BLAKE2B 4e74857975734f81c6e1d6f9ff7d098dabace034407539cc9b7b13d1ce546d784d52a210b8ecf2fee1085c8f442a64ca4ae8d561da1f863991e53e206e2ff71b SHA512 b585cdc7fbef16818191936afa0448b50f8f505b8532580aa328869219d566c394ec17ea194b91b7243c4b82bc948b58d3f45988359793380bfd74c64aca6509 +DIST scx-1.0.14.tar.gz 4775481 BLAKE2B 026e758f81455b5d5a2776f3cca8fd59d047ad792125603bb76c4d374ce8348982c3625159066ff8647988f98963d1975f9ddbdde4129b2fb4a598b4b447d2e2 SHA512 6b269cf0208f0f63e592f49d089084e78fbbeb10be74b9e800f5377c7b5f811e222c8b0dd2a3beb35b87a0d1f979b7b479f975662b6e035f26b211a37dcaa9e4 diff --git a/sys-kernel/scx/files/scx-1.0.14-builtin-preserve-enum-value.patch b/sys-kernel/scx/files/scx-1.0.14-builtin-preserve-enum-value.patch new file mode 100644 index 000000000000..897b49d16117 --- /dev/null +++ b/sys-kernel/scx/files/scx-1.0.14-builtin-preserve-enum-value.patch @@ -0,0 +1,12 @@ +Taken from https://github.com/sched-ext/scx/commit/7d9b2cc26473526883297df78e8eee3f2e7b6194. + +--- a/lib/scxtest/overrides.h ++++ b/lib/scxtest/overrides.h +@@ -13,7 +13,7 @@ + * that we want to get rid of that belongs here. + */ + #define __builtin_preserve_field_info(x,y) 1 +-#define __builtin_preserve_enum_value(x,y,z) 1 ++#define __builtin_preserve_enum_value(x,y) 1 + + #define bpf_addr_space_cast(var, dst_as, src_as) diff --git a/sys-kernel/scx/scx-1.0.14.ebuild b/sys-kernel/scx/scx-1.0.14.ebuild new file mode 100644 index 000000000000..347451f44b88 --- /dev/null +++ b/sys-kernel/scx/scx-1.0.14.ebuild @@ -0,0 +1,136 @@ +# Copyright 2024-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( {16..20} ) + +CRATES=" +" + +RUST_MIN_VER="1.74.1" + +inherit llvm-r2 linux-info cargo rust-toolchain toolchain-funcs meson + +DESCRIPTION="sched_ext schedulers and tools" +HOMEPAGE="https://github.com/sched-ext/scx" +SRC_URI=" + https://github.com/sched-ext/scx/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + ${CARGO_CRATE_URIS} +" +if [[ ${PKGBUMPING} != ${PVR} ]]; then + SRC_URI+=" + https://github.com/gentoo-crate-dist/scx/releases/download/v${PV}/scx-${PV}-crates.tar.xz + " +fi + +LICENSE="GPL-2" +# Dependent crate licenses +LICENSE+=" + Apache-2.0 BSD-2 BSD CC0-1.0 ISC MIT MPL-2.0 Unicode-3.0 ZLIB +" +SLOT="0" +KEYWORDS="~amd64" +IUSE="systemd" + +DEPEND=" + virtual/libelf:= + sys-libs/libseccomp + sys-libs/zlib:= + >=dev-libs/libbpf-1.5:= +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + app-misc/jq + dev-libs/protobuf[protoc(+)] + >=dev-util/bpftool-7.5.0 + $(llvm_gen_dep ' + llvm-core/clang:${LLVM_SLOT}=[llvm_targets_BPF(-)] + ') +" + +PATCHES=( + # backport + "${FILESDIR}/${P}-builtin-preserve-enum-value.patch" +) + +CONFIG_CHECK=" + ~BPF + ~BPF_EVENTS + ~BPF_JIT + ~BPF_SYSCALL + ~DEBUG_INFO_BTF + ~FTRACE + ~SCHED_CLASS_EXT +" + +QA_PREBUILT="/usr/bin/scx_loader" + +pkg_setup() { + linux-info_pkg_setup + llvm-r2_pkg_setup + rust_pkg_setup +} + +src_prepare() { + default + + if tc-is-cross-compiler; then + # Inject the rust_abi value into install_rust_user_scheds + sed -i "s;\${MESON_BUILD_ROOT};\${MESON_BUILD_ROOT}/$(rust_abi);" \ + meson-scripts/install_rust_user_scheds || die + fi + + # bug #944832 + sed -i 's;^#!/usr/bin/;#!/sbin/;' \ + services/openrc/scx.initrd || die +} + +src_configure() { + BUILD_DIR="${BUILD_DIR:-${WORKDIR}/${P}-build}" + + local emesonargs=( + -Dbpf_clang="$(get_llvm_prefix)/bin/clang" + -Dbpftool=disabled + -Dlibbpf_a=disabled + -Dcargo="${EPREFIX}/usr/bin/cargo" + -Dcargo_home="${ECARGO_HOME}" + -Doffline=true + -Denable_rust=true + -Dlibalpm=disabled + -Dopenrc=disabled + $(meson_feature systemd) + ) + + cargo_env meson_src_configure +} + +src_compile() { + cargo_env meson_src_compile +} + +src_test() { + cargo_env meson_src_test +} + +src_install() { + cargo_env meson_src_install + + dodoc README.md + + local readme readme_name + for readme in scheds/{rust,c}/*/README.md ./rust/*/README.md; do + [[ -e ${readme} ]] || continue + readme_name="${readme#*/rust/}" + readme_name="${readme_name#*/c/}" + readme_name="${readme_name%/README.md}" + newdoc "${readme}" "${readme_name}.md" + done + + newinitd services/openrc/scx.initrd scx + insinto /etc/default + doins services/scx + dosym ../default/scx /etc/conf.d/scx +}
