blob: d130d2a9a9117fefc20ead740dbf4bd1f170de6d (
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
# Maintainer: dreieck (https://aur.archlinux.org/account/dreieck)
# Contributor: Antheas Kapenekakis (https://aur.archlinux.org/account/antheas)
_pkgbase=hhd
_vcssuffix="-git"
pkgbase="${_pkgbase}${_vcssuffix}"
pkgname=(
"${pkgbase}"
"${_pkgbase}-systemd${_vcssuffix}"
"${_pkgbase}-license${_vcssuffix}"
"${_pkgbase}-doc${_vcssuffix}"
)
pkgver=3.6.0+1.r1456.20241118.3d5dd52
pkgrel=1
pkgdesc='Handheld Daemon. A tool for managing the quirks of handheld devices. Latest git checkout.'
arch=(
'x86_64'
)
url='https://github.com/hhd-dev/hhd'
license=('MIT')
makedepends=(
'git'
'libusb'
'python-'{'build','installer','setuptools','wheel'}
)
source=(
"${_pkgbase}::git+${url}.git"
)
sha256sums=(
'SKIP'
)
prepare() {
cd "${srcdir}/${_pkgbase}"
git log > git.log
}
pkgver() {
cd "${srcdir}/${_pkgbase}"
_ver="$(git describe --tags | sed 's|^[vV]||' | sed 's|-g[0-9a-fA-F]*$||' | tr '-' '+')"
_rev="$(git rev-list --count HEAD)"
_date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
_hash="$(git rev-parse --short HEAD)"
if [ -z "${_ver}" ]; then
error "Version could not be determined."
return 1
else
printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
fi
}
build() {
cd "${srcdir}/${_pkgbase}"
python -m build --wheel --no-isolation
}
package_hhd-git() {
depends=(
"${_pkgbase}-license${_vcssuffix}"
'libusb'
'python'
'python-evdev'
'python-rich'
'python-xlib'
'python-yaml'
)
optdepends=(
"${_pkgbase}-doc: For documentation."
"${_pkgbase}-ui: A (browser based) graphical user interface for ${_pkgbase}."
"${_pkgbase}-user: allows running hhd as a user service."
"${_pkgbase}-systemd: For automatic startup at system boot."
)
provides=(
"${_pkgbase}=${pkgver}"
)
conflicts=(
"${_pkgbase}"
)
cd "${srcdir}/${_pkgbase}"
python -m installer --destdir="${pkgdir}" dist/*.whl
}
package_hhd-systemd-git() {
pkgdesc="Systemd service file for '${_pkgbase}'. Latest git checkout."
arch=('any')
depends=(
"${_pkgbase}"
"${_pkgbase}-license${_vcssuffix}"
"python-setuptools"
)
optdepends=(
"systemd: To make use of this systemd service."
)
provides=(
"${_pkgbase}-systemd=${pkgver}"
)
conflicts=(
"${_pkgbase}-systemd"
)
cd "${srcdir}/${_pkgbase}"
# Install minimally necessary rules for running as a system service
install -Dvm644 usr/lib/udev/rules.d/83-hhd.rules "${pkgdir}/usr/lib/udev/rules.d/83-hhd.rules"
install -Dvm644 usr/lib/systemd/system/hhd@.service "${pkgdir}/usr/lib/systemd/system/hhd@.service"
install -dvm755 "${pkgdir}/usr/share/licenses/${pkgname}"
ln -svr "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
package_hhd-doc-git() {
pkgdesc="Documentation for '${_pkgbase}'."
arch=('any')
depends=(
"${_pkgbase}-license${_vcssuffix}"
)
optdepends=(
"${_pkgbase}: The software this Documentation is for."
)
provides=(
"${_pkgbase}-doc=${pkgver}"
)
conflicts=(
"${_pkgbase}-doc"
)
cd "${srcdir}/${_pkgbase}"
install -dvm755 "${pkgdir}/usr/share/doc/${_pkgbase}"
cp -rv docs "${pkgdir}/usr/share/doc/${_pkgbase}"/
install -Dvm644 -t "${pkgdir}/usr/share/doc/${_pkgbase}" git.log readme.md
install -dvm755 "${pkgdir}/usr/share/licenses/${pkgname}"
ln -svr "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
package_hhd-license-git() {
pkgdesc="Common license file for '${pkgbase}' and '${_pkgbase}-systemd${_vcssuffix}'."
arch=('any')
depends=()
optdepends=(
"${pkgbase}: The software this license file is for."
"${_pkgbase}-systemd${_vcssuffix}: The code this license file is for."
)
provides=()
conflicts=()
cd "${srcdir}/${_pkgbase}"
install -Dvm644 -t "${pkgdir}/usr/share/licenses/${pkgbase}" LICENSE
install -dvm755 "${pkgdir}/usr/share/licenses/${pkgname}"
ln -svr "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|