summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2f024f118203b11f6b6725a7254fcce66552eb64 (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
# Maintainer: Sick Codes <info at sick dot codes>
# Maintainer: Christian Hoff <https://github.com/choff>
# Contributor: Tobias Martin <tm-x at gmx dot net>

pkgname=anbox-modules-dkms
_pkgname=anbox-modules
pkgver=5.19
arch="$(uname -r)"
url='https://github.com/choff/anbox-modules'
pkgrel=1
pkgdesc='Android kernel driver fork by @choff (binder/binderfs & ashmem) in DKMS format'
arch=('x86_64' 'aarch64' 'i386')
license=('GPL3')
provides=("${pkgname}")
depends=('dkms')
makedepends=('git')
source=("git+https://github.com/choff/${_pkgname}.git#commit=8148a162755bf5500a07cf41a65a02c8f3eb0af9"
  "https://github.com/sickcodes/anbox-modules/commit/7c19d3c66758747d854c63e4c34ef127ce201fa6.patch"
  "https://github.com/choff/anbox-modules/pull/4.patch"
  "linux-6.patch")
sha256sums=('SKIP'
            '7589f311fd9a503c30a214b54f1f687c26a2f160d4339098c65f655e9b1e3556'
            'fced11f849692dd1f0f36b50bb859d85aa244a536c2cef529a14bb73f568bb5e'
            'SKIP')
conflicts=(anbox-modules-dkms-git)

prepare() {
  cd "${srcdir}/${_pkgname}"

  # Patch for 5.10-lts
  patch -p1 -i "${srcdir}"/7c19d3c66758747d854c63e4c34ef127ce201fa6.patch

  # # Patch for 5.19
  patch -p1 -i "${srcdir}"/4.patch

  # # Patch for kernel 6.xx
  patch --forward --strip=1 --input="${srcdir}/linux-6.patch"
}

package() {
  
  install -dm755 "${pkgdir}/usr/src/binder-1"
  install -dm755 "${pkgdir}/usr/src/ashmem-1"
  
  cp -r "${srcdir}/${_pkgname}/binder/"* "${pkgdir}/usr/src/binder-1/"
  cp -r "${srcdir}/${_pkgname}/ashmem/"* "${pkgdir}/usr/src/ashmem-1/"
  
  cd "${srcdir}/${_pkgname}/binder"
  make
  make DESTDIR="${pkgdir}/usr/src/binder-1" install
  
  cd "${srcdir}/${_pkgname}/ashmem"
  make
  make DESTDIR="${pkgdir}/usr/src/ashmem-1" install
  
  echo '** To activate binder_linux and ashmem_linux **
# $ sudo modprobe binder_linux devices=binder,hwbinder,vndbinder,anbox-binder,anbox-hwbinder,anbox-vndbinder
# $ sudo modprobe ashmem_linux'

}

# sudo modprobe binder_linux devices=binder,hwbinder,vndbinder,anbox-binder,anbox-hwbinder,anbox-vndbinder
# sudo modprobe ashmem_linux

# vim:set ts=2 sw=2 et: