|
1 | | -# Maintainer: HyDE-Project <contact@hyde-project.org> |
| 1 | +# Maintainer: HyDE-Project https://github.com/HyDE-Project |
2 | 2 |
|
3 | | -pkgname=hyprquery-git |
4 | | -pkgver=0.0.0 |
| 3 | +_pkgname="hyprquery" |
| 4 | +pkgname="$_pkgname-git" |
| 5 | +pkgver=0.6.8.r1.r9.g646ed2e |
5 | 6 | pkgrel=1 |
6 | 7 | pkgdesc="CLI utility to query Hyprland config values" |
7 | 8 | arch=('x86_64' 'aarch64') |
8 | 9 | url="https://github.com/HyDE-Project/hyprquery" |
9 | | -license=('GPL') |
10 | | -options=('!debug' '!buildflags') |
| 10 | +license=('GPL-3.0-or-later') |
| 11 | + |
11 | 12 | depends=( |
12 | | - 'glibc' |
13 | | - 'hyprlang' |
14 | | - 'cli11' |
15 | | - 'nlohmann-json' |
16 | | - 'spdlog' |
| 13 | + gcc-libs |
| 14 | + glibc |
| 15 | + hyprlang |
| 16 | + cli11 |
| 17 | + nlohmann-json |
| 18 | + libxkbcommon |
17 | 19 | ) |
18 | 20 | makedepends=( |
19 | | - 'cmake' |
20 | | - 'git' |
21 | | - 'pkgconf' |
| 21 | + cmake |
| 22 | + git |
| 23 | + ninja |
22 | 24 | ) |
23 | | -provides=('hyprquery') |
24 | | -conflicts=('hyprquery') |
25 | | -source=("hyprquery::git+https://github.com/HyDE-Project/hyprquery.git") |
| 25 | + |
| 26 | +provides=("$_pkgname") |
| 27 | +conflicts=("$_pkgname") |
| 28 | + |
| 29 | +_pkgsrc=$_pkgname |
| 30 | +source=("$_pkgsrc::git+$url.git") |
26 | 31 | sha256sums=('SKIP') |
27 | 32 |
|
28 | 33 | pkgver() { |
29 | | - cd "${srcdir}/hyprquery" |
30 | | - printf "0.r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" |
| 34 | + cd "$_pkgsrc" |
| 35 | + git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' |
31 | 36 | } |
32 | 37 |
|
33 | 38 | build() { |
34 | | - local _src_link='/tmp/hyprquery-src' |
35 | | - local _build_dir='/tmp/hyprquery-build' |
36 | | - local _safe_cxxflags='-O2 -pipe -ffile-prefix-map=/tmp/hyprquery-src=/usr/src/debug/hyprquery' |
37 | | - local _cmake_args=( |
38 | | - -DCMAKE_BUILD_TYPE=None |
39 | | - -DCMAKE_INSTALL_PREFIX=/usr |
40 | | - -DCMAKE_CXX_FLAGS="${_safe_cxxflags}" |
41 | | - -DUSE_SYSTEM_HYPRLANG=ON |
| 39 | + local cmake_options=( |
| 40 | + -B build |
| 41 | + -S "$_pkgsrc" |
| 42 | + -G Ninja |
| 43 | + -W no-dev |
| 44 | + -D CMAKE_BUILD_TYPE=None |
| 45 | + -D CMAKE_INSTALL_PREFIX=/usr |
| 46 | + -D HYPRQUERY_DISTRO_BUILD=ON |
42 | 47 | ) |
43 | | - |
44 | | - if grep -q 'option(HYPRQUERY_DISTRO_BUILD' "${srcdir}/hyprquery/CMakeLists.txt"; then |
45 | | - _cmake_args+=( -DHYPRQUERY_DISTRO_BUILD=ON ) |
46 | | - fi |
47 | | - |
48 | | - rm -rf "${_build_dir}" |
49 | | - ln -sfn "${srcdir}/hyprquery" "${_src_link}" |
50 | | - |
51 | | - cmake -S "${_src_link}" -B "${_build_dir}" "${_cmake_args[@]}" |
52 | | - |
53 | | - cmake --build "${_build_dir}" |
| 48 | + cmake "${cmake_options[@]}" |
| 49 | + cmake --build build |
54 | 50 | } |
55 | 51 |
|
56 | 52 | package() { |
57 | | - cd "${srcdir}/hyprquery" |
58 | | - |
59 | | - install -Dm755 "bin/hyq" "${pkgdir}/usr/bin/hyq" |
60 | | - install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" |
61 | | - |
62 | | - if [[ -f "man/hyprquery" ]]; then |
63 | | - install -Dm644 "man/hyprquery" "${pkgdir}/usr/share/man/man1/hyq.1" |
64 | | - fi |
| 53 | + DESTDIR="$pkgdir" cmake --install build |
| 54 | + install -Dm644 "$_pkgsrc/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/" |
65 | 55 | } |
0 commit comments