Skip to content

Commit 86cfec8

Browse files
committed
comply with proper pkgbuild
1 parent 3a17583 commit 86cfec8

1 file changed

Lines changed: 35 additions & 45 deletions

File tree

arch/hyprquery-git/PKGBUILD

Lines changed: 35 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,55 @@
1-
# Maintainer: HyDE-Project <contact@hyde-project.org>
1+
# Maintainer: HyDE-Project https://github.com/HyDE-Project
22

3-
pkgname=hyprquery-git
4-
pkgver=0.0.0
3+
_pkgname="hyprquery"
4+
pkgname="$_pkgname-git"
5+
pkgver=0.6.8.r1.r9.g646ed2e
56
pkgrel=1
67
pkgdesc="CLI utility to query Hyprland config values"
78
arch=('x86_64' 'aarch64')
89
url="https://github.com/HyDE-Project/hyprquery"
9-
license=('GPL')
10-
options=('!debug' '!buildflags')
10+
license=('GPL-3.0-or-later')
11+
1112
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
1719
)
1820
makedepends=(
19-
'cmake'
20-
'git'
21-
'pkgconf'
21+
cmake
22+
git
23+
ninja
2224
)
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")
2631
sha256sums=('SKIP')
2732

2833
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'
3136
}
3237

3338
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
4247
)
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
5450
}
5551

5652
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/"
6555
}

0 commit comments

Comments
 (0)