summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d7ca19d95c1fbf4e34fb0bad7105307b480aeb5f (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
# Maintainer: HyDE-Project https://github.com/HyDE-Project

_pkgname="hyprquery"
pkgname="$_pkgname-git"
pkgver=0.6.8.r1.r9.g646ed2e
pkgrel=1
pkgdesc="CLI utility to query Hyprland config values"
arch=('x86_64' 'aarch64')
url="https://github.com/HyDE-Project/hyprquery"
license=('GPL-3.0-or-later')

depends=(
  gcc-libs
  glibc
  hyprlang
  cli11
  nlohmann-json
  libxkbcommon
)
makedepends=(
  cmake
  git
  ninja
)

provides=("$_pkgname")
conflicts=("$_pkgname")

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

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

build() {
  local cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -W no-dev
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D HYPRQUERY_DISTRO_BUILD=ON
  )
  cmake "${cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 "$_pkgsrc/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
}