summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bdc57d4f53e7b82e104acea25f0564dc2da8a526 (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
79
80
# Maintainer: Samsagax <samsagax at gmail dot com>
_pkgbase=chimeraos-device-quirks
pkgname=${_pkgbase}-sk-git
pkgver=r308.0324575
pkgrel=1
pkgdesc="A collection of device specific configuration files"
arch=('any')
url="https://github.com/ChimeraOS/device-quirks"
license=('MIT')
depends=('acpica'
         'cpio'
         'systemd'
         'swh-plugins')
makedepends=('git')
source=("${_pkgbase}::git+https://github.com/honjow/device-quirks.git#branch=dev")
md5sums=('SKIP')
backup=("etc/device-quirks/device-quirks.conf")
provides=("${_pkgbase}-git")
conflicts=("${_pkgbase}-git")

pkgver() {
	cd "$srcdir/${_pkgbase}"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
	cd "$srcdir/${_pkgbase}"

	# Install binaries
	install -v -m755 -D -t "${pkgdir}/usr/bin/" usr/bin/*

	# Install module tweaks
	install -m644 -D -t "${pkgdir}/usr/lib/modprobe.d/" usr/lib/modprobe.d/*
	install -m644 -D -t "${pkgdir}/usr/lib/modules-load.d/" usr/lib/modules-load.d/*

	# Install udev tweaks
	install -m644 -D -t "${pkgdir}/usr/lib/udev/rules.d/" usr/lib/udev/rules.d/*
	install -m644 -D -t "${pkgdir}/usr/lib/udev/hwdb.d/" usr/lib/udev/hwdb.d/*

	# Install systemd units
	install -m644 -D -t "${pkgdir}/usr/lib/systemd/user/" usr/lib/systemd/user/*
	install -m644 -D -t "${pkgdir}/usr/lib/systemd/system/" usr/lib/systemd/system/*
	install -v -m755 -D -t "${pkgdir}/usr/lib/systemd/system-sleep/" usr/lib/systemd/system-sleep/*

	# Install firmware
	install -m644 -D -t "${pkgdir}/usr/lib/firmware/" usr/lib/firmware/*.bin

	# Install firmware DSDT and EDID
	install -m644 -D -t "${pkgdir}/usr/lib/firmware/dsdt/" usr/lib/firmware/dsdt/*
	install -m644 -D -t "${pkgdir}/usr/lib/firmware/edid/" usr/lib/firmware/edid/*

	install -dm755 "${pkgdir}/usr/lib/firmware/aw87xxx"
	cp -rv usr/lib/firmware/aw87xxx/* "${pkgdir}/usr/lib/firmware/aw87xxx/."
	ln -sf /etc/device-quirks/firmware/aw87xxx_acf.bin "${pkgdir}/usr/lib/firmware/aw87xxx_acf.bin"

	# Install sysctl configurations
	install -m644 -D -t "${pkgdir}/usr/lib/sysctl.d/" usr/lib/sysctl.d/*

	#Install scripts
	mkdir -p "${pkgdir}/usr/share/device-quirks"
	cp -rv usr/share/device-quirks/* "${pkgdir}/usr/share/device-quirks/."

	# Install pipewire hardware configs
	mkdir -p "${pkgdir}/usr/share/pipewire/hardware-profiles"
	cp -rv usr/share/pipewire/hardware-profiles/* "${pkgdir}/usr/share/pipewire/hardware-profiles/."

	# Install wireplumber hardware configs 
	mkdir -p "${pkgdir}/usr/share/wireplumber/hardware-profiles"
	cp -rv usr/share/wireplumber/hardware-profiles/* "${pkgdir}/usr/share/wireplumber/hardware-profiles/."
	
	install -dm755 "${pkgdir}/usr/share/wireplumber/wireplumber.conf.d"
	install -v -m644 -D -t "${pkgdir}/usr/share/wireplumber/wireplumber.conf.d/" usr/share/wireplumber/wireplumber.conf.d/*
	
	#Install device-quirks config
	mkdir -p "${pkgdir}/etc/device-quirks"
	cp -rv etc/device-quirks/* "${pkgdir}/etc/device-quirks/."

	# Install license
	install -m644 -D -t "${pkgdir}/usr/share/licenses/${_pkgbase}/" LICENSE
}