mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-29 06:22:07 -04:00
distros(Void): Prep DMS to host Void packages
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
name: Void Linux XBPS Repository
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'distro/void/srcpkgs/**'
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
force_rebuild:
|
||||
description: 'Force rebuilding packages even if they already exist in the repository'
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
build_git:
|
||||
description: 'Build dms-git package'
|
||||
type: boolean
|
||||
required: false
|
||||
default: true
|
||||
build_stable:
|
||||
description: 'Build stable dms & dms-greeter packages'
|
||||
type: boolean
|
||||
required: false
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
name: Build & Deploy XBPS packages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout gh-pages branch
|
||||
run: |
|
||||
git clone --branch gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git gh-pages-repo || {
|
||||
echo "⚠️ gh-pages branch not found or empty, initializing a new one..."
|
||||
mkdir gh-pages-repo
|
||||
cd gh-pages-repo
|
||||
git init
|
||||
git checkout -b gh-pages
|
||||
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
cd ..
|
||||
}
|
||||
|
||||
- name: Install XBPS Static Utilities
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/xbps
|
||||
curl -s -L https://repo-default.voidlinux.org/static/xbps-static-latest.x86_64-musl.tar.xz | tar -xJ -C ${{ github.workspace }}/xbps
|
||||
echo "${{ github.workspace }}/xbps/usr/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Clone void-packages
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/void-linux/void-packages.git
|
||||
|
||||
- name: Inject templates
|
||||
run: |
|
||||
cp -R distro/void/srcpkgs/dms void-packages/srcpkgs/
|
||||
cp -R distro/void/srcpkgs/dms-greeter void-packages/srcpkgs/
|
||||
cp -R distro/void/srcpkgs/dms-git void-packages/srcpkgs/
|
||||
|
||||
- name: Enable unprivileged user namespaces (Ubuntu 24.04)
|
||||
run: |
|
||||
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
|
||||
|
||||
- name: Bootstrap xbps-src
|
||||
run: |
|
||||
cd void-packages
|
||||
./xbps-src binary-bootstrap
|
||||
|
||||
- name: Configure signing keys and trust
|
||||
run: |
|
||||
# Write private key; extract and register the public key for
|
||||
# host and chroot trust (needed to fetch from sibling repos).
|
||||
echo "${{ secrets.XBPS_PRIVATE_KEY }}" > /tmp/xbps_privkey.pem
|
||||
chmod 600 /tmp/xbps_privkey.pem
|
||||
|
||||
openssl rsa -in /tmp/xbps_privkey.pem -pubout -out /tmp/dms-key.pub
|
||||
rm -f /tmp/xbps_privkey.pem # cleaned up; re-written only for signing step
|
||||
|
||||
sudo mkdir -p /var/db/xbps/keys
|
||||
sudo cp /tmp/dms-key.pub /var/db/xbps/keys/dms-key.pub
|
||||
|
||||
mkdir -p void-packages/masterdir/var/db/xbps/keys
|
||||
cp /tmp/dms-key.pub void-packages/masterdir/var/db/xbps/keys/dms-key.pub
|
||||
rm -f /tmp/dms-key.pub
|
||||
|
||||
- name: Configure repositories
|
||||
run: |
|
||||
# Enable sibling danklinux repo to resolve dependencies (like dgop)
|
||||
echo "repository=https://avengemedia.github.io/DankLinux/current" > void-packages/etc/xbps.d/90-danklinux.conf
|
||||
|
||||
# Add any existing compiled packages to the build cache directory to avoid rebuilds
|
||||
if [ -d "gh-pages-repo/current" ]; then
|
||||
mkdir -p void-packages/hostdir/binpkgs
|
||||
cp -L gh-pages-repo/current/*.xbps void-packages/hostdir/binpkgs/ 2>/dev/null || true
|
||||
xbps-rindex -a void-packages/hostdir/binpkgs/*.xbps 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Build packages
|
||||
run: |
|
||||
mkdir -p gh-pages-repo/current
|
||||
|
||||
BUILD_STABLE="${{ github.event.inputs.build_stable || 'true' }}"
|
||||
BUILD_GIT="${{ github.event.inputs.build_git || 'true' }}"
|
||||
FORCE_REBUILD="${{ github.event.inputs.force_rebuild || 'false' }}"
|
||||
|
||||
if [ "${{ github.event_name }}" = "push" ]; then
|
||||
BUILD_STABLE="false"
|
||||
BUILD_GIT="true"
|
||||
fi
|
||||
|
||||
if [ "${{ github.event_name }}" = "release" ]; then
|
||||
BUILD_STABLE="true"
|
||||
BUILD_GIT="false"
|
||||
fi
|
||||
|
||||
echo "=== Starting Builds ==="
|
||||
echo "Stable build enabled: $BUILD_STABLE"
|
||||
echo "Git build enabled: $BUILD_GIT"
|
||||
echo "Force rebuild: $FORCE_REBUILD"
|
||||
|
||||
cd void-packages
|
||||
|
||||
# 1. Build dms-git (development package)
|
||||
if [ "$BUILD_GIT" = "true" ]; then
|
||||
# Calculate dynamic git version (tag.commits.hash)
|
||||
GIT_VER=$(git -C .. describe --tags --always | sed 's/^v//; s/-/./g')
|
||||
echo "🔨 Preparing dms-git version $GIT_VER"
|
||||
|
||||
# Stage source tarball in the xbps-src source cache.
|
||||
# --transform adds a top-level directory so xbps-src can extract
|
||||
# into $wrksrc (create_wrksrc=yes handles the rest).
|
||||
SRC_CACHE="hostdir/sources/dms-git-${GIT_VER}"
|
||||
mkdir -p "$SRC_CACHE"
|
||||
tar -czf "${SRC_CACHE}/dms-git-${GIT_VER}.tar.gz" \
|
||||
--transform "s,^\.,dms-git-${GIT_VER}," \
|
||||
--exclude=void-packages \
|
||||
--exclude=gh-pages-repo \
|
||||
--exclude=.git \
|
||||
--exclude=danklinux \
|
||||
-C .. .
|
||||
|
||||
CHECKSUM=$(sha256sum "${SRC_CACHE}/dms-git-${GIT_VER}.tar.gz" | cut -d' ' -f1)
|
||||
|
||||
# Dynamically patch template version, checksum, and distfiles
|
||||
sed -i "s/^version=.*/version=${GIT_VER}/" srcpkgs/dms-git/template
|
||||
sed -i "s/^checksum=.*/checksum=${CHECKSUM}/" srcpkgs/dms-git/template
|
||||
sed -i "s|^distfiles=.*|distfiles=\"dms-git-${GIT_VER}.tar.gz\"|" srcpkgs/dms-git/template
|
||||
|
||||
EXPECTED_GIT_FILE="dms-git-${GIT_VER}_1.x86_64.xbps"
|
||||
|
||||
if [ -f "../gh-pages-repo/current/$EXPECTED_GIT_FILE" ] && [ "$FORCE_REBUILD" != "true" ]; then
|
||||
echo "✅ $EXPECTED_GIT_FILE already exists, skipping build."
|
||||
else
|
||||
echo "🔨 Compiling dms-git..."
|
||||
./xbps-src pkg dms-git
|
||||
rm -f "../gh-pages-repo/current/${EXPECTED_GIT_FILE}"
|
||||
cp -L hostdir/binpkgs/dms-git-*.xbps ../gh-pages-repo/current/
|
||||
fi
|
||||
fi
|
||||
|
||||
# 2. Build stable packages (dms & dms-greeter)
|
||||
if [ "$BUILD_STABLE" = "true" ]; then
|
||||
STABLE_VER=$(grep -E '^version=' srcpkgs/dms/template | cut -d= -f2 | tr -d '"')
|
||||
STABLE_REV=$(grep -E '^revision=' srcpkgs/dms/template | cut -d= -f2 | tr -d '"')
|
||||
|
||||
# Build dms
|
||||
EXPECTED_DMS_FILE="dms-${STABLE_VER}_${STABLE_REV}.x86_64.xbps"
|
||||
if [ -f "../gh-pages-repo/current/$EXPECTED_DMS_FILE" ] && [ "$FORCE_REBUILD" != "true" ]; then
|
||||
echo "✅ $EXPECTED_DMS_FILE already exists, skipping build."
|
||||
else
|
||||
echo "🔨 Compiling dms ($STABLE_VER)..."
|
||||
./xbps-src pkg dms
|
||||
rm -f "../gh-pages-repo/current/${EXPECTED_DMS_FILE}"
|
||||
cp -L hostdir/binpkgs/dms-${STABLE_VER}_${STABLE_REV}.x86_64.xbps ../gh-pages-repo/current/
|
||||
fi
|
||||
|
||||
# Build dms-greeter (read version/revision from its own template)
|
||||
GREETER_VER=$(grep -E '^version=' srcpkgs/dms-greeter/template | cut -d= -f2 | tr -d '"')
|
||||
GREETER_REV=$(grep -E '^revision=' srcpkgs/dms-greeter/template | cut -d= -f2 | tr -d '"')
|
||||
EXPECTED_GREETER_FILE="dms-greeter-${GREETER_VER}_${GREETER_REV}.x86_64.xbps"
|
||||
if [ -f "../gh-pages-repo/current/$EXPECTED_GREETER_FILE" ] && [ "$FORCE_REBUILD" != "true" ]; then
|
||||
echo "✅ $EXPECTED_GREETER_FILE already exists, skipping build."
|
||||
else
|
||||
echo "🔨 Compiling dms-greeter ($GREETER_VER)..."
|
||||
./xbps-src pkg dms-greeter
|
||||
rm -f "../gh-pages-repo/current/${EXPECTED_GREETER_FILE}"
|
||||
cp -L hostdir/binpkgs/dms-greeter-${GREETER_VER}_${GREETER_REV}.x86_64.xbps ../gh-pages-repo/current/
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Index and sign repository
|
||||
run: |
|
||||
cd gh-pages-repo/current
|
||||
|
||||
# Clean up any stale or dangling signature files to prevent O_CREAT ENOENT errors
|
||||
rm -f *.sig2 *.sig
|
||||
|
||||
# Guard: nothing to index if no .xbps files exist
|
||||
if ! ls *.xbps 1>/dev/null 2>&1; then
|
||||
echo "⚠️ No .xbps files found to index, skipping."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Regenerate repo index
|
||||
xbps-rindex -a $(pwd)/*.xbps
|
||||
|
||||
# Sign repository
|
||||
echo "${{ secrets.XBPS_PRIVATE_KEY }}" > /tmp/xbps_privkey.pem
|
||||
chmod 600 /tmp/xbps_privkey.pem
|
||||
|
||||
xbps-rindex --sign --signedby "AvengeMedia <AvengeMedia.US@gmail.com>" --privkey /tmp/xbps_privkey.pem $(pwd)
|
||||
xbps-rindex --sign-pkg --privkey /tmp/xbps_privkey.pem $(pwd)/*.xbps
|
||||
|
||||
rm -f /tmp/xbps_privkey.pem
|
||||
|
||||
- name: Deploy to gh-pages branch
|
||||
run: |
|
||||
cd gh-pages-repo
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add current/
|
||||
git diff --quiet && git diff --staged --quiet || (git commit -m "Update XBPS packages [skip ci]" && git push origin gh-pages)
|
||||
+33
-8
@@ -13,16 +13,41 @@ All build from source.
|
||||
|
||||
## Distribution
|
||||
|
||||
These packages target the official
|
||||
[`void-linux/void-packages`](https://github.com/void-linux/void-packages)
|
||||
repository, so they install with a plain `xbps-install dms` and no extra setup.
|
||||
Most dependencies (`quickshell`, `matugen`, `cava`, `niri`, `greetd`, …) are
|
||||
already in Void; `dgop` and `danksearch` are packaged alongside in the
|
||||
[danklinux repo](https://github.com/AvengeMedia/danklinux/tree/master/distro/void).
|
||||
This is a DMS maintained repo for VoidLinux until these packages are officially merged upstream in the Void Linux repositories, you can install them from our self-hosted custom XBPS repositories served via GitHub Pages.
|
||||
|
||||
### Using the Self-Hosted Repositories
|
||||
|
||||
We serve both stable release and development packages directly from our repository branches.
|
||||
|
||||
#### 1. Add Repository Configurations
|
||||
|
||||
Create configuration files in `/etc/xbps.d/` pointing to our repositories (needed for both stable and git/nightly variants):
|
||||
|
||||
```sh
|
||||
echo "repository=https://avengemedia.github.io/DankMaterialShell/current" | sudo tee /etc/xbps.d/dms.conf
|
||||
echo "repository=https://avengemedia.github.io/DankLinux/current" | sudo tee /etc/xbps.d/danklinux.conf
|
||||
```
|
||||
|
||||
#### 2. Install DMS
|
||||
|
||||
Synchronize repositories and install the package:
|
||||
|
||||
* For the **stable** variant:
|
||||
|
||||
```sh
|
||||
sudo xbps-install -S dms
|
||||
```
|
||||
|
||||
* For the **git/nightly** variant (this will conflict with and replace the stable package):
|
||||
|
||||
```sh
|
||||
sudo xbps-install -S dms-git
|
||||
```
|
||||
|
||||
*Note: On the first sync, `xbps-install` will output our signing key fingerprint and ask you to type `y` to trust and import it. Verify that the key matches our official signing fingerprint.*
|
||||
|
||||
The templates here are the source of truth: copy each into a void-packages
|
||||
checkout at `srcpkgs/<pkg>/template` to build or submit it. Only tagged releases
|
||||
are packaged (no `-git`/nightly variant).
|
||||
checkout at `srcpkgs/<pkg>/template` to build or submit it.
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# Template file for 'dms-git'
|
||||
#
|
||||
# DankMaterialShell git development release
|
||||
#
|
||||
# NOTE: This template is built exclusively by CI. The workflow stages a local
|
||||
# source tarball and dynamically patches version, checksum, and distfiles
|
||||
# before calling xbps-src. Do not attempt to build this template manually
|
||||
# without first providing the source archive.
|
||||
#
|
||||
# The binary is built with the `distro_binary` build tag (drops the in-app
|
||||
# self-update command).
|
||||
pkgname=dms-git
|
||||
version=1.4.6.git
|
||||
revision=1
|
||||
create_wrksrc=yes
|
||||
build_style=go
|
||||
build_wrksrc="core"
|
||||
go_import_path="github.com/AvengeMedia/DankMaterialShell/core"
|
||||
go_package="${go_import_path}/cmd/dms"
|
||||
go_build_tags="distro_binary"
|
||||
go_ldflags="-X main.Version=${version}"
|
||||
short_desc="DankMaterialShell — Material 3 desktop shell for Wayland (git variant)"
|
||||
maintainer="AvengeMedia <AvengeMedia.US@gmail.com>"
|
||||
license="MIT"
|
||||
homepage="https://danklinux.com"
|
||||
# CI populates distfiles/checksum dynamically; these are placeholders.
|
||||
distfiles="https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${version}.tar.gz"
|
||||
checksum=badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb
|
||||
|
||||
# Conflicts and provides
|
||||
conflicts="dms"
|
||||
provides="dms-${version}_${revision}"
|
||||
|
||||
# Optional feature deps (XBPS has no "recommends") are listed in distro/void/README.md.
|
||||
depends="quickshell accountsservice dgop matugen"
|
||||
|
||||
post_install() {
|
||||
# QML shell tree (build_style=go already installed the dms binary)
|
||||
vmkdir usr/share/quickshell/dms
|
||||
vcopy "${wrksrc}/quickshell/*" usr/share/quickshell/dms
|
||||
echo "${version}" > "${DESTDIR}/usr/share/quickshell/dms/VERSION"
|
||||
|
||||
# Desktop entry + icon
|
||||
vinstall "${wrksrc}/assets/dms-open.desktop" 644 usr/share/applications
|
||||
vinstall "${wrksrc}/assets/com.danklinux.dms.desktop" 644 usr/share/applications
|
||||
vinstall "${wrksrc}/assets/danklogo.svg" 644 usr/share/icons/hicolor/scalable/apps
|
||||
|
||||
# Shell completions (generated by the built binary; skip when cross-building)
|
||||
vmkdir usr/share/bash-completion/completions
|
||||
vmkdir usr/share/zsh/site-functions
|
||||
vmkdir usr/share/fish/vendor_completions.d
|
||||
if [ -z "$CROSS_BUILD" ]; then
|
||||
"${DESTDIR}/usr/bin/dms" completion bash > "${DESTDIR}/usr/share/bash-completion/completions/dms"
|
||||
"${DESTDIR}/usr/bin/dms" completion zsh > "${DESTDIR}/usr/share/zsh/site-functions/_dms"
|
||||
"${DESTDIR}/usr/bin/dms" completion fish > "${DESTDIR}/usr/share/fish/vendor_completions.d/dms.fish"
|
||||
fi
|
||||
|
||||
vlicense "${wrksrc}/LICENSE"
|
||||
}
|
||||
Reference in New Issue
Block a user