summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9116fe91bf57b44bc31dc3baae4e8b9ed0e1308a (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
# Maintainer: Serene-Arc
pkgname=qmk-git
pkgver=1.0.0.r2.gbb1a9e4
_qmk_pkgver=master
pkgrel=1
pkgdesc="CLI tool for customizing supported mechanical keyboards."
arch=('any')
url="https://github.com/qmk/qmk_cli"
license=('MIT')
_branch=qmk_cli
depends=(
    'arm-none-eabi-binutils'
    'arm-none-eabi-gcc'
    'arm-none-eabi-newlib'
    'avr-binutils'
    'avr-gcc'
    'avr-libc'
    'avrdude'
    'clang'
    'dfu-programmer'
    'dfu-util'
    'diffutils'
    'flake8'
    'gcc'
    'git'
    'libusb-compat'
    'python-dotty-dict'
    'python-hidapi'
    'python-hjson'
    'python-jsonschema'
    'python-milc'
    'python-pyusb'
    'unzip'
    'wget'
    'zip'
)
makedepends=(
    'python'
    'python-build'
    'python-pip'
)
conflicts=('qmk')
provides=('qmk')
source=(
    'git+https://github.com/qmk/qmk_cli.git'
    "50-qmk.rules_${_qmk_pkgver}::https://raw.githubusercontent.com/qmk/qmk_firmware/${_qmk_pkgver}/util/udev/50-qmk.rules"
)
sha256sums=(
    'SKIP'
    '4692f4f31fabfe28b0c4fd05edaec941487dc9cc6bfd62c34958a5e72ff9404f'
)

pkgver() {
  cd "$_branch"
  echo $(git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
}

build() {
    cd "$_branch"
    python -m build --skip-dependency-check --wheel
}

package() {
    cd "$_branch"
    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps dist/*.whl
    python -O -m compileall "${pkgdir}"

    install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -d "${pkgdir}/usr/lib/udev/rules.d"
    install -Dm644 "${srcdir}/50-qmk.rules_${_qmk_pkgver}" "${pkgdir}/usr/lib/udev/rules.d/50-qmk.rules"
}