mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Merge pull request #77 from ZoiteChat/manjaro-package
Added a Manjaro/Arch-style PKGBUILD for a VCS package (zoitechat-git)…
This commit is contained in:
81
.github/workflows/manjaro-package-build.yml
vendored
Normal file
81
.github/workflows/manjaro-package-build.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
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 \
|
||||
glib2-devel \
|
||||
gtk3 \
|
||||
openssl \
|
||||
dbus-glib \
|
||||
libcanberra \
|
||||
libayatana-appindicator \
|
||||
luajit \
|
||||
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
|
||||
id -u builder >/dev/null 2>&1 || 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
|
||||
70
packaging/manjaro/PKGBUILD
Normal file
70
packaging/manjaro/PKGBUILD
Normal file
@@ -0,0 +1,70 @@
|
||||
# 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 -E 's/([^-]+)-([0-9]+)-g/\1.r\2.g/' \
|
||||
| sed 's/-/./g'
|
||||
else
|
||||
printf '0.r%s.%s\n' \
|
||||
"$(git rev-list --count HEAD)" \
|
||||
"$(git rev-parse --short=7 HEAD)"
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
arch-meson zoitechat build \
|
||||
-Dtext-frontend=false \
|
||||
-Dwith-checksum=true \
|
||||
-Dwith-fishlim=true \
|
||||
-Dwith-lua=lua \
|
||||
-Dwith-perl=perl \
|
||||
-Dwith-python=python3 \
|
||||
-Dwith-sysinfo=true \
|
||||
-Dinstall-plugin-metainfo=true
|
||||
|
||||
meson compile -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
meson install -C build --destdir "$pkgdir"
|
||||
}
|
||||
@@ -55,12 +55,39 @@ if host_machine.system() == 'windows'
|
||||
common_includes += include_directories('sysinfo')
|
||||
endif
|
||||
|
||||
marshal = gnome.genmarshal('marshal',
|
||||
sources: 'marshalers.list',
|
||||
prefix: '_zoitechat_marshal',
|
||||
internal: true
|
||||
glib_genmarshal = find_program(
|
||||
'glib-genmarshal',
|
||||
'glib-genmarshal-2.0',
|
||||
required: true,
|
||||
)
|
||||
|
||||
marshal = [
|
||||
custom_target('marshal_h',
|
||||
input: 'marshalers.list',
|
||||
output: 'marshal.h',
|
||||
command: [
|
||||
glib_genmarshal,
|
||||
'--prefix=_zoitechat_marshal',
|
||||
'--header',
|
||||
'@INPUT@',
|
||||
'--output',
|
||||
'@OUTPUT@',
|
||||
]
|
||||
),
|
||||
custom_target('marshal_c',
|
||||
input: 'marshalers.list',
|
||||
output: 'marshal.c',
|
||||
command: [
|
||||
glib_genmarshal,
|
||||
'--prefix=_zoitechat_marshal',
|
||||
'--body',
|
||||
'@INPUT@',
|
||||
'--output',
|
||||
'@OUTPUT@',
|
||||
]
|
||||
)
|
||||
]
|
||||
|
||||
make_te = find_program('make-te.py')
|
||||
|
||||
textevents = custom_target('textevents',
|
||||
|
||||
Reference in New Issue
Block a user