summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 80d9a16d594a228e4d1d129797f7fff4d5b2953c (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: Patrick josé Pereira  <gmail.com@patrickelectric>
# Contributor: Helio Loureiro <helio@loureiro.eng.br>
pkgname=qhot-git
_realname=qhot
confilicts=('qhot')
pkgver=qt6+1.1.0+2.r89.20240421.9f515c6
pkgrel=1
gittag=qt6-1.1.0
pkgdesc="Hot reload for nested QML files!"
arch=('i686' 'x86_64')
url="https://github.com/patrickelectric/qhot"
license=('GPL3')
buildDepends=('git')
depends=(
  'qt6-base'
  'qt6-declarative'
  'qt6-quick3d'
  'qt6-charts'
  'qt6-imageformats'
  'qt6-location'
  'qt6-multimedia'
  'qt6-svg'
  'qt6-tools'
  'qt6-translations'
  'qt6-webengine'
  'qt6-websockets'
  'clang'
)
source=('git+https://github.com/patrickelectric/qhot.git')
sha1sums=(SKIP)

pkgver() {
  cd ${srcdir}/$_realname
  _ver="$(git describe  --tags | sed 's|^[vV]||' | sed 's|-g[0-9a-fA-F]*$||' | tr '-' '+')"
  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_ver}" ]; then
    error "Version could not be determined."
    return 1
  else
    printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
  fi
}

build() {
  cd ${srcdir}/${_realname}
  cmake -B build -DCMAKE_BUILD_TYPE=Release
  cmake --build build --parallel --config Release
  cat<<EOF > build/${_realname}.desktop 
[Desktop Entry]
Type=Application
Name=QHot
Comment=${pkgdesc}
Path=/opt/${pkgname}/
Exec=/usr/bin/${_realname}
Terminal=true
Categories=Qt;Utility;
EOF
}

package(){
  cd ${srcdir}/${_realname}/build

  mkdir -p "${pkgdir}/opt/" "${pkgdir}/usr/bin" "${pkgdir}/usr/share/applications"
  cp src/${_realname} "${pkgdir}/usr/bin/${_realname}"
  cp "${_realname}.desktop" "${pkgdir}/opt/${pkgname}"

  ln -s "/opt/${pkgname}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}