diff --git a/.gitea/workflows/arch-package.yml b/.gitea/workflows/arch-package.yml new file mode 100644 index 0000000..d5eb55d --- /dev/null +++ b/.gitea/workflows/arch-package.yml @@ -0,0 +1,28 @@ +name: Arch Linux Package + +on: + push: + tags: + - "*" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: https://git.quad4.io/actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + fetch-depth: 0 + + - name: Build Arch Package + run: | + docker build -t arch-builder -f Dockerfile.arch-builder . + docker run --rm -v $(pwd):/home/build/project arch-builder + + - name: Upload Artifact + uses: https://git.quad4.io/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3.2.1 + with: + name: arch-package + path: packaging/arch/*.pkg.tar.zst + diff --git a/Dockerfile.arch-builder b/Dockerfile.arch-builder new file mode 100644 index 0000000..adaacf0 --- /dev/null +++ b/Dockerfile.arch-builder @@ -0,0 +1,39 @@ +FROM archlinux:latest + +# Install build dependencies +RUN pacman -Syu --noconfirm --needed \ + base-devel \ + git \ + sudo \ + nodejs \ + pnpm \ + python \ + python-poetry \ + opus \ + opusfile \ + portaudio \ + espeak-ng \ + nss \ + atk \ + at-spi2-core \ + libxcomposite \ + libxrandr \ + libxdamage \ + mesa \ + alsa-lib \ + libx11 + +# Create a non-root user for makepkg +RUN useradd -m build && \ + echo "build ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/build + +# Set up build directory +USER build +WORKDIR /home/build/project + +# Copy packaging files +COPY --chown=build:build packaging/arch /home/build/project/packaging/arch + +# Default command to build the package +CMD ["/bin/bash", "-c", "cd packaging/arch && makepkg -s --noconfirm"] + diff --git a/packaging/arch/.SRCINFO b/packaging/arch/.SRCINFO new file mode 100644 index 0000000..11f0f63 --- /dev/null +++ b/packaging/arch/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = reticulum-meshchatx-git + pkgdesc = A simple mesh network communications app powered by the Reticulum Network Stack + pkgver = 4.0.0.r627.g4976722 + pkgrel = 1 + url = https://git.quad4.io/RNS-Things/MeshChatX + arch = x86_64 + arch = aarch64 + license = MIT + makedepends = git + makedepends = nodejs + makedepends = pnpm + makedepends = python + makedepends = python-poetry + depends = opus + depends = opusfile + depends = portaudio + depends = espeak-ng + depends = nss + depends = atk + depends = at-spi2-core + depends = libxcomposite + depends = libxrandr + depends = libxdamage + depends = mesa + depends = alsa-lib + depends = libx11 + provides = reticulum-meshchatx + conflicts = reticulum-meshchatx + source = reticulum-meshchatx::git+https://git.quad4.io/RNS-Things/MeshChatX.git + source = reticulum-meshchatx.desktop + sha256sums = SKIP + sha256sums = 366182e198df672bb51893f7cf7f339079bf80319c24c107216c1b96d33fd267 + +pkgname = reticulum-meshchatx-git diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD new file mode 100644 index 0000000..44b5b3c --- /dev/null +++ b/packaging/arch/PKGBUILD @@ -0,0 +1,57 @@ +# Maintainer: Ivan +pkgname=reticulum-meshchatx-git +_pkgname=reticulum-meshchatx +pkgver=3.3.2.r90.g978d917 +pkgrel=1 +pkgdesc="A simple mesh network communications app powered by the Reticulum Network Stack" +arch=('x86_64' 'aarch64') +url="https://git.quad4.io/RNS-Things/MeshChatX" +license=('MIT') +depends=('opus' 'opusfile' 'portaudio' 'espeak-ng' 'nss' 'atk' 'at-spi2-core' 'libxcomposite' 'libxrandr' 'libxdamage' 'mesa' 'alsa-lib' 'libx11') +makedepends=('git' 'nodejs' 'pnpm' 'python' 'python-poetry') +provides=("$_pkgname") +conflicts=("$_pkgname") +source=("$_pkgname::git+https://git.quad4.io/RNS-Things/MeshChatX.git" + "reticulum-meshchatx.desktop") +sha256sums=('SKIP' + '366182e198df672bb51893f7cf7f339079bf80319c24c107216c1b96d33fd267') + +pkgver() { + cd "$_pkgname" + git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || \ + printf "4.0.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$_pkgname" + export PNPM_HOME="$srcdir/.pnpm-home" + export POETRY_CACHE_DIR="$srcdir/.poetry-cache" + export POETRY_VIRTUALENVS_IN_PROJECT=true + + pnpm install + poetry install +} + +build() { + cd "$_pkgname" + export PNPM_HOME="$srcdir/.pnpm-home" + export POETRY_CACHE_DIR="$srcdir/.poetry-cache" + export POETRY_VIRTUALENVS_IN_PROJECT=true + + pnpm run build + pnpm exec electron-builder --linux --dir +} + +package() { + cd "$_pkgname" + + install -d "$pkgdir/usr/lib/$_pkgname" + cp -a dist/linux-unpacked/* "$pkgdir/usr/lib/$_pkgname/" + + install -d "$pkgdir/usr/bin" + ln -s "/usr/lib/$_pkgname/reticulum-meshchatx" "$pkgdir/usr/bin/$_pkgname" + + install -Dm644 "$srcdir/reticulum-meshchatx.desktop" "$pkgdir/usr/share/applications/reticulum-meshchatx.desktop" + install -Dm644 logo/logo.png "$pkgdir/usr/share/icons/hicolor/512x512/apps/reticulum-meshchatx.png" +} + diff --git a/packaging/arch/reticulum-meshchatx.desktop b/packaging/arch/reticulum-meshchatx.desktop new file mode 100644 index 0000000..c13dbd4 --- /dev/null +++ b/packaging/arch/reticulum-meshchatx.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Reticulum MeshChatX +Comment=A simple mesh network communications app powered by the Reticulum Network Stack +Exec=reticulum-meshchatx +Icon=reticulum-meshchatx +Terminal=false +Type=Application +Categories=Network; +