Added a Manjaro/Arch-style PKGBUILD for a VCS package (zoitechat-git) under packaging/manjaro/PKGBUILD, including package metadata, runtime/build deps, pkgver() generation from git history, and build()/package() functions using Meson (arch-meson, meson compile, meson install).

Added a new GitHub Actions workflow .github/workflows/manjaro-package-build.yml that:

runs in a manjarolinux/base container,

installs Manjaro packaging/build tooling,

builds via makepkg as a non-root user,

generates .SRCINFO,

runs namcap checks on both PKGBUILD and the built package,

uploads package artifacts plus PKGBUILD/.SRCINFO.
This commit is contained in:
2026-02-23 09:35:36 -07:00
parent 0081d5c492
commit b731d3fb18
2 changed files with 143 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
name: Manjaro Package Build
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:
permissions:
contents: read
jobs:
manjaro-package:
runs-on: ubuntu-latest
container:
image: manjarolinux/base:latest
steps:
- name: Install packaging toolchain
run: |
set -euxo pipefail
pacman -Syu --noconfirm
pacman -S --noconfirm --needed \
base-devel \
git \
namcap \
meson \
ninja \
pkgconf \
glib2 \
gtk3 \
openssl \
dbus-glib \
libcanberra \
libayatana-appindicator \
iso-codes \
lua \
perl \
python \
python-cffi \
pciutils
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Build package and generate .SRCINFO (non-root)
run: |
set -euxo pipefail
useradd -m builder
chown -R builder:builder "$GITHUB_WORKSPACE"
su builder -c "cd '$GITHUB_WORKSPACE/packaging/manjaro' && makepkg --noconfirm --syncdeps --cleanbuild"
su builder -c "cd '$GITHUB_WORKSPACE/packaging/manjaro' && makepkg --printsrcinfo > .SRCINFO"
- name: Lint PKGBUILD and package with namcap
run: |
set -euxo pipefail
cd "$GITHUB_WORKSPACE/packaging/manjaro"
namcap PKGBUILD
pkg_file="$(find . -maxdepth 1 -type f -name '*.pkg.tar.*' | head -n1)"
namcap "$pkg_file"
- name: Collect artifacts
run: |
set -euxo pipefail
mkdir -p artifacts
cp -v "$GITHUB_WORKSPACE"/packaging/manjaro/*.pkg.tar.* artifacts/
cp -v "$GITHUB_WORKSPACE"/packaging/manjaro/PKGBUILD artifacts/
cp -v "$GITHUB_WORKSPACE"/packaging/manjaro/.SRCINFO artifacts/
- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: zoitechat-manjaro-package
path: artifacts/*
if-no-files-found: error

View File

@@ -0,0 +1,64 @@
# Maintainer: ZoiteChat Maintainers <zoitechat@users.noreply.github.com>
pkgname=zoitechat-git
pkgver=0
pkgrel=1
pkgdesc='IRC client for GNOME (ZoiteChat development snapshot)'
arch=('x86_64')
url='https://github.com/zoitechat/zoitechat'
license=('GPL-2.0-or-later')
depends=(
'dbus-glib'
'glib2'
'gtk3'
'iso-codes'
'libcanberra'
'lua'
'openssl'
'perl'
'python-cffi'
)
makedepends=(
'git'
'meson'
'ninja'
'pkgconf'
'python'
)
optdepends=(
'libayatana-appindicator: Ayatana/AppIndicator tray backend'
'pciutils: sysinfo plugin hardware detection details'
)
provides=('zoitechat')
conflicts=('zoitechat')
_repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
source=("zoitechat::git+file://${_repo_root}")
sha256sums=('SKIP')
pkgver() {
cd "$srcdir/zoitechat"
if git describe --long --tags --abbrev=7 >/dev/null 2>&1; then
git describe --long --tags --abbrev=7 \
| sed 's/^v//' \
| sed 's/-/.r/;s/-/./'
else
printf '0.r%s.%s\n' \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short=7 HEAD)"
fi
}
build() {
arch-meson zoitechat build \
-Dbuildtype=plain \
-Dtext-frontend=false \
-Dinstall-plugin-metainfo=true
meson compile -C build
}
package() {
meson install -C build --destdir "$pkgdir"
}