Skip to content

Commit 29beccd

Browse files
committed
Add hyprquery Arch package and CI
0 parents  commit 29beccd

4 files changed

Lines changed: 170 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Arch Packages CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
8+
jobs:
9+
validate-pkgbuilds:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: archlinux:latest
13+
14+
steps:
15+
- name: Install tools
16+
run: |
17+
pacman -Syu --noconfirm
18+
pacman -S --noconfirm --needed base-devel git pacman-contrib
19+
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Validate PKGBUILDs
24+
shell: bash
25+
run: |
26+
set -euo pipefail
27+
mapfile -t pkgbuilds < <(find arch -type f -name PKGBUILD | sort)
28+
if [ ${#pkgbuilds[@]} -eq 0 ]; then
29+
echo "No PKGBUILD files found under arch/"
30+
exit 1
31+
fi
32+
33+
for pkgbuild in "${pkgbuilds[@]}"; do
34+
pkgdir=$(dirname "$pkgbuild")
35+
echo "==> Checking ${pkgdir}"
36+
pushd "$pkgdir" >/dev/null
37+
38+
# Static PKGBUILD parse + metadata generation
39+
makepkg --printsrcinfo > .SRCINFO
40+
makepkg --packagelist >/dev/null
41+
42+
# Ensure source retrieval/extraction/prepare works (no full build)
43+
makepkg -o --nobuild --nodeps --skippgpcheck
44+
45+
popd >/dev/null
46+
done
47+
48+
- name: Upload generated SRCINFO
49+
if: always()
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: srcinfo-files
53+
path: |
54+
arch/**/.SRCINFO
55+
if-no-files-found: ignore

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Arch package build artifacts
2+
**/src/
3+
**/pkg/
4+
**/*.pkg.tar.zst
5+
**/*.pkg.tar.zst.sig
6+
**/*.pkg.tar.xz
7+
**/*.pkg.tar.gz
8+
**/*.tar.gz
9+
**/*.tar.xz
10+
**/*.tar.zst
11+
/arch/hyprquery/hyprquery/
12+
13+
# makepkg temp data and metadata
14+
**/*.log
15+
**/.SRCINFO.tmp
16+
17+
# Ignore hidden files/dirs by default, then allow required repo metadata.
18+
.*
19+
!.gitignore
20+
!.github/
21+
!.github/**
22+
!arch/**/.SRCINFO
23+
!arch/**/PKGBUILD
24+
25+
# editor/system
26+
.DS_Store

arch/hyprquery/.SRCINFO

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pkgbase = hyprquery-git
2+
pkgdesc = CLI utility to query Hyprland config values
3+
pkgver = 0.0.0
4+
pkgrel = 1
5+
url = https://github.com/HyDE-Project/hyprquery
6+
arch = x86_64
7+
arch = aarch64
8+
license = GPL
9+
makedepends = cmake
10+
makedepends = git
11+
makedepends = pkgconf
12+
depends = glibc
13+
depends = hyprlang
14+
depends = cli11
15+
depends = nlohmann-json
16+
depends = spdlog
17+
provides = hyprquery
18+
conflicts = hyprquery
19+
options = !debug
20+
options = !buildflags
21+
source = hyprquery::git+https://github.com/HyDE-Project/hyprquery.git
22+
sha256sums = SKIP
23+
24+
pkgname = hyprquery-git

arch/hyprquery/PKGBUILD

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Maintainer: HyDE-Project <contact@hyde-project.org>
2+
3+
pkgname=hyprquery-git
4+
pkgver=0.0.0
5+
pkgrel=1
6+
pkgdesc="CLI utility to query Hyprland config values"
7+
arch=('x86_64' 'aarch64')
8+
url="https://github.com/HyDE-Project/hyprquery"
9+
license=('GPL')
10+
options=('!debug' '!buildflags')
11+
depends=(
12+
'glibc'
13+
'hyprlang'
14+
'cli11'
15+
'nlohmann-json'
16+
'spdlog'
17+
)
18+
makedepends=(
19+
'cmake'
20+
'git'
21+
'pkgconf'
22+
)
23+
provides=('hyprquery')
24+
conflicts=('hyprquery')
25+
source=("hyprquery::git+https://github.com/HyDE-Project/hyprquery.git")
26+
sha256sums=('SKIP')
27+
28+
pkgver() {
29+
cd "${srcdir}/hyprquery"
30+
printf "0.r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
31+
}
32+
33+
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
42+
)
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}"
54+
}
55+
56+
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
65+
}

0 commit comments

Comments
 (0)