summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 293c24a54108e80383ddf5a16fbe90e656a1f618 (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
# Maintainer: Rafael Silva <perigoso@riseup.net>

_pkgbase='black-magic-debug'
pkgbase="${_pkgbase}-git"
pkgname=(black-magic-debug-app-git black-magic-debug-udev-git)
pkgver=1.10.0.r618.gefe259ab
pkgrel=1
pkgdesc='Plug&Play in application debugger for microcontrollers'
arch=('any')
url='https://black-magic.org'
license=('GPL' 'BSD' 'MIT')
makedepends=('git' 'hidapi' 'python')
source=("git+https://github.com/blackmagic-debug/blackmagic.git")
sha256sums=('SKIP')

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

prepare() {
    cd blackmagic
    meson subprojects download
}

build() {
    cd blackmagic
    arch-meson . build -Dprobe='' -Drtt_support=true -Dadvertise_noackmode=true -Denable_gpiod=disabled
    meson compile -C build
}

package_black-magic-debug-udev-git() {
    conflicts=('black-magic-debug-udev')
    provides=('black-magic-debug-udev')

    cd blackmagic
    install -Dm 644 driver/99-blackmagic-uucp.rules "${pkgdir}"/usr/lib/udev/rules.d/99-blackmagic-uucp.rules
}

package_black-magic-debug-app-git() {
    conflicts=('black-magic-debug-app')
    provides=('black-magic-debug-app')
    depends=('libusb' 'libftdi' 'libhidapi-libusb.so')

    cd blackmagic
    install -Dm 755 build/blackmagic "${pkgdir}"/usr/bin/blackmagic
    install -Dm644 -t "${pkgdir}/usr/share/licenses/${_pkgbase}" COPYING*
}