summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6f1b1a2a8c3b717f41b7d9592993dd73b038465c (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
# Maintainer: Jack Chen <redchenjs@live.com>

pkgname=picotool-git
pkgver=r47.f6fe6b7
pkgrel=1
pkgdesc="Tool for interacting with a RP2040 device in BOOTSEL mode, or with a RP2040 binary"
arch=('x86_64')
url="https://github.com/raspberrypi/picotool"
license=('MIT')
depends=('gcc-libs' 'libusb')
makedepends=('git' 'cmake')
provides=('picotool')
conflicts=('picotool')
source=(
  "git+https://github.com/raspberrypi/picotool.git"
  "git+https://github.com/raspberrypi/pico-sdk.git"
)
sha512sums=(
  'SKIP'
  'SKIP'
)

pkgver() {
  cd "$srcdir/picotool"

  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "$srcdir/picotool"

  mkdir -p build && cd build
  PICO_SDK_PATH="$srcdir/pico-sdk" cmake ..
  make
}

package() {
  cd "$srcdir/picotool"

  install -Dm755 build/picotool "$pkgdir/usr/bin/picotool"
  install -Dm644 clipp/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}