summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b88adb148bd5f932a6ee199e210efbedc126cb22 (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
# Maintainer:
# Contributor: Thomas Gatzweiler <thomas.gatzweiler@gmail.com>

_pkgname=qlog
pkgname="$_pkgname-git"
pkgver=0.34.0.r0.g5f8bf45
pkgrel=1
pkgdesc="Amateur radio logbook software"
arch=("x86_64" "i686")
url="https://github.com/foldynl/QLog"
license=('GPL')

depends=(
  'hamlib'
  'qt6-base'
  'qt6-charts'
  'qt6-serialport'
  'qt6-webengine'
  'qt6-websockets'
  'qtkeychain-qt6'
)
makedepends=(
  'git'
)
optdepends=(
  'org.freedesktop.secrets: keyring/password support'
)

provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

_source_qlog() {
  source+=(
    'foldynl.qlog-flags'::'git+https://github.com/foldynl/QLog-Flags.git'
  )
  sha256sums+=(
    'SKIP'
  )

  _prepare_qlog() (
    cd "$srcdir/$_pkgsrc"
    local _submodules=(
      'foldynl.qlog-flags'::'res/flags'
    )
    _submodule_update
  )
}

_source_qlog

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  _submodule_update() {
    local _module
    for _module in "${_submodules[@]}" ; do
      git submodule init "${_module##*::}"
      git submodule set-url "${_module##*::}" "$srcdir/${_module%::*}"
      git -c protocol.file.allow=always submodule update "${_module##*::}"
    done
  }

  _prepare_qlog
}

build() {
  cd "$_pkgsrc"
  qmake6 PREFIX="$pkgdir/usr" QLog.pro
  make
}

package() {
  cd "$_pkgsrc"
  make install
}