summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c8288f32f85341190097346662ffc99537379431 (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
# Maintainer: Chris Osgood <chris_github@functionalfuture.com>

_pkgbase=applesmc-next
pkgname=${_pkgbase}-dkms
pkgver=0.1.5
pkgrel=1
pkgdesc='Updated applesmc driver with charge threshold'
arch=('x86_64')
url='https://gurumeditation.org/1256/applesmc-next-battery-charge-thresholds-for-linux-on-apple-hardware/'
license=('GPL2')
depends=('dkms')
optdepends=('tlp: battery charge threshold support')
makedepends=()
provides=('APPLESMC-MODULE' 'SBS-MODULE')

source=(
   "https://github.com/c---/applesmc-next/archive/refs/tags/${pkgver}.tar.gz"
)

sha256sums=(
   '63b8516674d85422e91f72e0d565b6f000c51af4cbf28d29188c5ffb569390c2'
)

package() {
   (cd "${_pkgbase}-${pkgver}"/applesmc && make TARGET="${pkgdir}/usr/src/${_pkgbase}-${pkgver}/applesmc" srcinstall)
   (cd "${_pkgbase}-${pkgver}"/sbs && make TARGET="${pkgdir}/usr/src/${_pkgbase}-${pkgver}/sbs" srcinstall)

   install -Dm755 "${_pkgbase}-${pkgver}"/45-apple "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/"
   install -Dm644 "${_pkgbase}-${pkgver}"/dkms.conf "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/"
   install -Dm644 "${_pkgbase}-${pkgver}"/Makefile "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/"

   mkdir -p "${pkgdir}/usr/share/tlp/bat.d"
   ln -sf "/usr/src/${_pkgbase}-${pkgver}/45-apple" "${pkgdir}/usr/share/tlp/bat.d/45-apple"

   sed -i -e "s/@PKGNAME@/${pkgname}/" \
       -e "s/@_PKGBASE@/${_pkgbase}/" \
       -e "s/@PKGVER@/${pkgver}/" \
       "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf
}