|
| 1 | +# Template file for 'scx' |
| 2 | +pkgname=scx |
| 3 | +version=1.0.20 |
| 4 | +revision=1 |
| 5 | +archs="x86_64* aarch64*" |
| 6 | +build_style=cargo |
| 7 | +# fails because it tries to read procfs dynamically |
| 8 | +# with bwrap containment even more fail |
| 9 | +make_check_args="-- --skip test_thread_operations" |
| 10 | +hostmakedepends="clang pkg-config elfutils-devel libseccomp-devel" |
| 11 | +makedepends="libbpf-devel zlib-devel libzstd-devel libseccomp-devel" |
| 12 | +short_desc="Sched_ext schedulers and tools" |
| 13 | +maintainer="Chloé Vulquin <code@toast.bunkerlabs.net>" |
| 14 | +license="GPL-2.0-only" |
| 15 | +homepage="https://github.com/sched-ext/scx" |
| 16 | +distfiles="https://github.com/sched-ext/scx/archive/refs/tags/v${version}.tar.gz" |
| 17 | +checksum=d9c6b3230915dafe21556da28c6ef2a11f272770f12912842ae1ad23b54d963e |
| 18 | + |
| 19 | +pre_build() { |
| 20 | + # workaround the cc-rs mixing CFLAGS for host and target. |
| 21 | + # https://github.com/rust-lang/cc-rs/issues/1469 |
| 22 | + export CFLAGS_${RUST_BUILD//-/_}="${CFLAGS_host}" \ |
| 23 | + CXXFLAGS_${RUST_BUILD//-/_}="${CXXFLAGS_host}" \ |
| 24 | + LDFLAGS_${RUST_BUILD//-/_}="${LDFLAGS_host}" \ |
| 25 | + CFLAGS_${RUST_TARGET//-/_}="${CFLAGS}" \ |
| 26 | + CXXFLAGS_${RUST_TARGET//-/_}="${CXXFLAGS}" \ |
| 27 | + LDFLAGS_${RUST_TARGET//-/_}="${LDFLAGS}" \ |
| 28 | + CFLAGS="" CXXFLAGS="" LDFLAGS="" |
| 29 | +} |
| 30 | + |
| 31 | +# cargo install does not support workspaces |
| 32 | +# alternative: specify the wanted packages only |
| 33 | +# requires setting do_* manually, but avoids useless build time |
| 34 | +do_install() { |
| 35 | + # POSIX for find … -maxdepth 1 -executable |
| 36 | + find target/"$RUST_TARGET"/release \ |
| 37 | + ! -path target/"$RUST_TARGET"/release -prune \ |
| 38 | + -type f -perm -0100 -name 'scx*' \ |
| 39 | + ! -name scx_arena_selftests \ |
| 40 | + -exec install -Dm755 -t "$PKGDESTDIR"/usr/bin '{}' \+ |
| 41 | +} |
| 42 | + |
| 43 | +post_install() { |
| 44 | + vinstall "${FILESDIR}"/00-pseudofs-scx.sh 644 /etc/runit/core-services |
| 45 | +} |
0 commit comments