-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathPKGBUILD
63 lines (47 loc) · 1.92 KB
/
PKGBUILD
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
pkgname=maccel-dkms
_pkgname="maccel"
pkgver=0.4.1
pkgrel=1
pkgdesc="Mouse acceleration driver and kernel module for Linux."
arch=("x86_64")
url="https://www.maccel.org/"
license=("GPL-2.0-or-later")
install=maccel.install
depends=("dkms")
makedepends=("git" "cargo")
# DEBUG_CFLAGS="$DEBUG_CFLAGS -DDEBUG"
options=(!debug)
source=("git+https://github.com/Gnarus-G/maccel.git")
sha256sums=("SKIP")
prepare() {
export RUSTUP_TOOLCHAIN=stable
platform="$(rustc -vV | sed -n 's/host: //p')"
cargo fetch --locked --target "${platform}" --manifest-path="${srcdir}/maccel/cli/Cargo.toml"
}
build() {
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
# Build the CLI
cargo build --profile=release-with-debug --frozen --all-features --manifest-path="${srcdir}/maccel/cli/Cargo.toml"
}
package() {
# Add group
install -Dm 644 "${srcdir}/maccel/maccel.sysusers" "${pkgdir}/usr/lib/sysusers.d/${_pkgname}.conf"
# Install Driver
install -Dm 644 "${srcdir}/maccel/dkms.conf" "${pkgdir}/usr/src/${_pkgname}-${pkgver}/dkms.conf"
# Escape path separators from debug flags values
EXTRA_CFLAGS=$(echo ${DEBUG_CFLAGS} | sed -e "s/\//\\\\\\//g")
# Set name and version
sed -e "s/@_PKGNAME@/${_pkgname}/" \
-e "s/@PKGVER@/${pkgver}/" \
-e "s/@EXTRA_CFLAGS@/'${EXTRA_CFLAGS}'/" \
-i "${pkgdir}/usr/src/${_pkgname}-${pkgver}/dkms.conf"
cp -r "${srcdir}/maccel/driver/." "${pkgdir}/usr/src/${_pkgname}-${pkgver}/"
# Install CLI
install -Dm 755 "${srcdir}/target/release-with-debug/maccel" "${pkgdir}/usr/bin/maccel"
# Install udev rules
install -Dm 644 "${srcdir}/maccel/udev_rules/99-maccel.rules" "${pkgdir}/usr/lib/udev/rules.d/99-maccel.rules"
install -Dm 755 "${srcdir}/maccel/udev_rules/maccel_param_ownership_and_resets" "${pkgdir}/usr/lib/udev/maccel_param_ownership_and_resets"
# Install License
install -Dm 644 "${srcdir}/maccel/LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
}