summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0e04805f7559080e493748270c38a4e6f43b0e6e (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
# Maintainer: L. Bradley LaBoon <me@bradleylaboon.com>

## links
# https://flipperzero.one/update
# https://github.com/flipperdevices/qFlipper

_pkgname="qflipper"
pkgname="$_pkgname"
pkgver=1.3.3
pkgrel=2
pkgdesc="Desktop application for updating Flipper Zero firmware via PC"
url="https://flipperzero.one/update"
license=('GPL-3.0-only')
arch=('x86_64')

depends=(
  'libusb'
  'qt6-5compat'
  'qt6-declarative'
  'qt6-serialport'
  'qt6-svg'
)
makedepends=(
  'git'
  'qt6-tools'
)

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+https://github.com/flipperdevices/qFlipper.git#tag=$pkgver")
sha256sums=('SKIP')

source+=(
  "libwdi"::"git+https://github.com/pbatard/libwdi"
  "nanopb"::"git+https://github.com/nanopb/nanopb"
)
sha256sums+=(
  'SKIP'
  'SKIP'
)

prepare() {
  cd "$_pkgsrc"
  git submodule init
  git config submodule.driver-tool/libwdi.url "$srcdir/libwdi"
  git config submodule.3rdparty/nanopb.url "$srcdir/nanopb"
  git -c protocol.file.allow=always submodule update

  # Use uucp group instead of dialout for udev rules
  sed -i 's/dialout/uucp/g' installer-assets/udev/42-flipperzero.rules
}

build() {
  local _qmake_options=(
    ../qFlipper.pro
    -spec linux-g++
    CONFIG+=qtquickcompiler
    DEFINES+=DISABLE_APPLICATION_UPDATES
    PREFIX=/usr
  )

  mkdir -p "$_pkgsrc/build"
  cd "$_pkgsrc/build"

  qmake6 "${_qmake_options[@]}"

  make qmake_all
  make
}

package() {
  make -C "$_pkgsrc/build" INSTALL_ROOT="$pkgdir" install
}