blob: e3dd8c81bc8ed8248106d24ba121e840144158e5 (
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Contributor: Static_Rocket
pkgbase=asusctl
pkgname=(
asusctl
rog-control-center
gnome-shell-extension-asusctl-gnome
)
pkgver=5.0.10
pkgrel=0.3
pkgdesc="A control daemon, tools, and a collection of crates for interacting with ASUS ROG laptops"
arch=('x86_64')
url="https://asus-linux.org"
license=('MPL-2.0')
makedepends=(
"clang"
"cmake"
"fontconfig"
"git"
"hicolor-icon-theme"
"libayatana-appindicator"
"libusb"
"power-profiles-daemon"
"rust"
"systemd"
# gnome-shell-extension
"npm"
"unzip"
"yarn"
)
source=("git+https://gitlab.com/asus-linux/asusctl.git#tag=$pkgver")
b2sums=('2be7cd61489d223e511e71c8d62b4f68903a6efed98848491d7824cceb87e4cd3c90db015c1159020ec493aa088472572549126ac36349c475098ded0842fe88')
prepare() {
cd "${pkgbase}"
# Keep rust/cargo build-dependency management inside the build directory
export CARGO_HOME="${srcdir}/cargo"
# Follow Rust package guidelines
## https://wiki.archlinux.org/title/Rust_package_guidelines
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "${pkgbase}"
# Keep rust/cargo build-dependency management inside the build directory
export CARGO_HOME="${srcdir}/cargo"
# Follow Rust package guidelines
## https://wiki.archlinux.org/title/Rust_package_guidelines
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
make build
# gnome-shell extension
cd "desktop-extensions/gnome-45"
npm install
npm run build
mkdir asusctl-gnome@asus-linux.org
unzip asusctl-gnome@asus-linux.org.zip \
-d "asusctl-gnome@asus-linux.org/"
}
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
package_asusctl() {
pkgdesc="${pkgdesc/tools/CLI tools}"
depends=(
"hicolor-icon-theme"
"libusb"
"power-profiles-daemon"
"systemd"
)
install=asusctl.install
optdepends=(
'acpi_call: fan control'
'supergfxctl: hybrid GPU control'
'asusctltray: tray profile switcher'
'rog-control-center: app to control asusctl'
'gnome-shell-extension-asusctl-gnome: GNOME-shell extensions'
)
cd "${pkgbase}"
export CARGO_HOME="${srcdir}/cargo"
make DESTDIR="${pkgdir}" install
_pick rogcc "${pkgdir}/usr/bin/rog-control-center" \
"${pkgdir}/usr/share/applications/rog-control-center.desktop" \
"${pkgdir}/usr/share/icons/hicolor/512x512/apps/rog-control-center.png" \
"${pkgdir}/usr/share/rog-gui"
}
package_rog-control-center() {
depends=(
"asusctl"
"fontconfig"
"glib2"
"gtk3"
"hicolor-icon-theme"
"libayatana-appindicator"
)
pkgdesc="App to control asusctl"
mv rogcc/* "${pkgdir}"
}
package_gnome-shell-extension-asusctl-gnome() {
depends=(
"asusctl"
"dconf"
"gnome-shell"
)
install=gnome-shell-extension-asusctl-gnome.install
arch=('any')
pkgdesc="A gnome extension exposing some of the base features of asusd in a helpful and easy to use way"
cd "${pkgbase}/desktop-extensions/gnome-45"
install -dm755 "${pkgdir}/usr/share/glib-2.0/schemas"
mv "asusctl-gnome@asus-linux.org/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml" \
"${pkgdir}/usr/share/glib-2.0/schemas/"
rmdir "asusctl-gnome@asus-linux.org/schemas"
install -dm755 "${pkgdir}/usr/share/gnome-shell/extensions"
mv "asusctl-gnome@asus-linux.org" \
"${pkgdir}/usr/share/gnome-shell/extensions/"
}
|