summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5a2551f96e1329b740a8147f639238aa3a04aa68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Maintainer: Tejun Heo <tj@kernel.org>
# Maintainer: Peter Jung ptr1337 <admin@ptr1337.dev>
# Maintainer: Piotr Górski <lucjan.lucjanov@gmail.com>

pkgname=scx-scheds
_gitname=scx
pkgver=1.0.6
pkgrel=2
pkgdesc='sched_ext schedulers and tools'
url='https://github.com/sched-ext/scx'
arch=('x86_64' 'aarch64')
backup=('etc/default/scx')
license=('GPL-2.0-only')
depends=(
  bpf
  jq
  libbpf
  libelf
  zlib
)
makedepends=(
  clang
  git
  llvm
  llvm-libs
  meson
  python
  rust
)
options=(!lto)
source=("git+https://github.com/sched-ext/scx?signed#tag=v$pkgver")
sha256sums=('81ebebdef84d9e02fb56b766633545ecfa875c297381c4912448409592aa407a')
validpgpkeys=(
  697C63013E65270255EBC2608744DC1EB26B5A9A  # Tejun Heo <tj@kernel.org>
  F5504C7B7B8107B40EF9E97AA1148BB3207BCC33  # David Vernet
)

_backports=(
)

_reverts=(
)

prepare() {
 cd $_gitname

 local _c _l
  for _c in "${_backports[@]}"; do
    if [[ "${_c}" == *..* ]]; then _l='--reverse'; else _l='--max-count=1'; fi
    git log --oneline "${_l}" "${_c}"
    git cherry-pick --mainline 1 --no-commit "${_c}"
  done
  for _c in "${_reverts[@]}"; do
    if [[ "${_c}" == *..* ]]; then _l='--reverse'; else _l='--max-count=1'; fi
    git log --oneline "${_l}" "${_c}"
    git revert --mainline 1 --no-commit "${_c}"
  done

  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = *.patch ]] || continue
    echo "Applying patch $src..."
    patch -Np1 < "../$src"
  done
}

build() {
  cd $_gitname
  arch-meson . build -D openrc=disabled -D libbpf_a=disabled -D bpftool=disabled -D cargo_home="$srcdir"/scx
  meson compile -C build
}

package() {
  cd $_gitname
  meson install -C build --destdir "${pkgdir}"
}