Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GitHub Actions and PKGBUILDS for swayfx and scenefx #1

Merged
merged 7 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/aur_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test building the PKGBUILDs

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
pkgname: [ swayfx, swayfx-git, scenefx-git ]

name: Test PKGBUILD ${{matrix.pkgname}}
runs-on: ubuntu-latest

steps:
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Test building PKGBUILD
id: makepkg
uses: edlanglois/pkgbuild-action@v1
with:
pkgdir: ${{matrix.pkgname}}
51 changes: 51 additions & 0 deletions .github/workflows/aur_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Package for the AUR

# Only run when pushed to main
on:
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
publish:
strategy:
fail-fast: false
matrix:
include:
- pkgname: swayfx
assets: |
./swayfx/sway-portals.conf
./swayfx/50-systemd-user.conf
./swayfx/sway.install

- pkgname: swayfx-git
assets: |
./swayfx-git/sway-portals.conf
./swayfx-git/50-systemd-user.conf
./swayfx-git/sway.install

- pkgname: scenefx-git
assets: []

runs-on: ubuntu-latest
working-directory: ${{ matrix.pkgname }}
name: ${{ matrix.pkgname }}
steps:
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Publish AUR Stable package
uses: ulises-jeremias/github-actions-aur-publish@v1
with:
pkgname: ${{ matrix.pkgname }}
pkgbuild: PKGBUILD
assets: ${{ matrix.assets }}
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
update_pkgver: false
43 changes: 43 additions & 0 deletions scenefx-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Maintainer: Erik Reider <[email protected]>

_pkgname=scenefx
pkgname="$_pkgname-git"
pkgver=r213.e1f4bc5
pkgrel=1
license=("MIT")
pkgdesc="A drop-in replacement for the wlroots scene API that allows wayland compositors to render surfaces with eye-candy effects"
url="https://github.com/wlrfx/scenefx"
arch=("x86_64")
depends=(
"libwlroots.so"
"libglvnd"
"wayland"
"libdrm"
"libpixman-1.so"
)
makedepends=(
"git"
"glslang"
"meson"
"ninja"
"wayland-protocols"
)
optdepends=()
provides=("libscenefx.so")
options=("debug")
source=("${pkgname%-*}::git+${url}.git")
sha512sums=("SKIP")

pkgver() {
cd "$_pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
arch-meson -Dwerror=false "$_pkgname" build
meson compile -C build
}

package() {
DESTDIR="$pkgdir" meson install -C build
}
16 changes: 16 additions & 0 deletions swayfx-git/50-systemd-user.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
# See FS#63021
# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.

# Upstream refuses to set XDG_CURRENT_DESKTOP so we have to.
exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway
exec systemctl --user import-environment DISPLAY \
SWAYSOCK \
WAYLAND_DISPLAY \
XDG_CURRENT_DESKTOP

exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY \
SWAYSOCK \
XDG_CURRENT_DESKTOP=sway \
WAYLAND_DISPLAY
85 changes: 85 additions & 0 deletions swayfx-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Maintainer: Erik Reider <[email protected]>
_pkgname=swayfx
pkgname="$_pkgname-git"
pkgver=r7046.8d1641c5
pkgrel=1
license=("MIT")
pkgdesc="SwayFX: Sway, but with eye candy!"
makedepends=(git meson ninja scdoc setconf wayland-protocols)
depends=(
"cairo"
"gdk-pixbuf2"
"libevdev.so"
"libinput"
"libscenefx.so"
"libjson-c.so"
"libpixman-1.so"
"libudev.so"
"libwayland-server.so"
"libwlroots.so"
"libxcb"
"libxkbcommon.so"
"pango"
"pcre2"
"ttf-font"
"xcb-util-wm"
)
optdepends=(
"dmenu: dmenu_path support (used alongside wmenu in default $menu)"
"foot: Terminal emulator used in the default configuration"
"i3status: Status line generation"
"mako: Lightweight notification daemon"
"polkit: System privilege control. Required if not using seatd service"
"swaybg: Wallpaper tool for sway"
"sway-contrib: Collection of user-contributed scripts for sway"
"swayidle: Idle management daemon"
"swaylock: Screen locker"
"waybar: Highly customizable bar"
"wmenu: Application launcher used in default config"
"xorg-xwayland: X11 support"
"xdg-desktop-portal-gtk: Default xdg-desktop-portal for file picking"
"xdg-desktop-portal-wlr: xdg-desktop-portal backend"
)
backup=(
etc/sway/config
etc/sway/config.d/50-systemd-user.conf
)
arch=("i686" "x86_64")
url="https://github.com/WillPower3309/swayfx"
source=("${pkgname%-*}::git+${url}.git#branch=scenefx-submodule"
50-systemd-user.conf
sway-portals.conf)
sha512sums=(
"SKIP"
"d5f9aadbb4bbef067c31d4c8c14dad220eb6f3e559e9157e20e1e3d47faf2f77b9a15e52519c3ffc53dc8a5202cb28757b81a4b3b0cc5dd50a4ddc49e03fe06e"
"4f9576b7218aef8152eb60e646985e96b13540b7a4fd34ba68fdc490199cf7a7b46bbee85587e41bffe81fc730222cf408d5712e6251edc85a0a0b0408c1a2df")
provides=("sway" "swayfx")
conflicts=("sway" "swayfx")
options=(debug)
install=sway.install

pkgver() {
cd "$_pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
arch-meson \
-Dwerror=false \
-Dsd-bus-provider=libsystemd \
"$_pkgname" build
meson compile -C build
}

package() {
install -Dm644 50-systemd-user.conf -t "$pkgdir/etc/sway/config.d/"
install -Dm644 sway-portals.conf "$pkgdir/usr/share/xdg-desktop-portal/sway-portals.conf"

DESTDIR="$pkgdir" meson install -C build

cd "$_pkgname"
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
for util in autoname-workspaces.py inactive-windows-transparency.py grimshot; do
install -Dm755 "contrib/$util" -t "$pkgdir/usr/share/$pkgname/scripts"
done
}
9 changes: 9 additions & 0 deletions swayfx-git/sway-portals.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[preferred]
default=gtk
org.freedesktop.impl.portal.ScreenCast=wlr
org.freedesktop.impl.portal.Screenshot=wlr
# xdg-desktop-portal-gtk's implementation uses org.gnome.SessionManager and
# org.freedesktop.ScreenSaver, neither of which is implemented by Sway. This
# will cause some programs (e.g. Firefox) to use Wayland's idle-inhibit
# protocol instead, which sway does implement.
org.freedesktop.impl.portal.Inhibit=none
23 changes: 23 additions & 0 deletions swayfx-git/sway.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
post_install() {
cat << EOD
Sway requires additional setup for privilege escalation. Without this setup,
sway will fail to start with session activation permission failures. Choose one
of the two available options (In alphabetical, not recommended, order):

1. polkit: This will make sway "just work" right after installation but may be
a weightier solution than desired.

2. seatd: Already required as a sway dependency, this is a lighter-weight
solution but requires some user configuration: Enabling the service,
adding your user to the "seat" group, then logging out/in again.

Either option should provide the same functionality/stability. Refer to the
Sway wiki page for information.
EOD

setcap cap_sys_nice+ep usr/bin/sway
}

post_upgrade() {
setcap cap_sys_nice+ep usr/bin/sway
}
16 changes: 16 additions & 0 deletions swayfx/50-systemd-user.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
# See FS#63021
# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.

# Upstream refuses to set XDG_CURRENT_DESKTOP so we have to.
exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway
exec systemctl --user import-environment DISPLAY \
SWAYSOCK \
WAYLAND_DISPLAY \
XDG_CURRENT_DESKTOP

exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY \
SWAYSOCK \
XDG_CURRENT_DESKTOP=sway \
WAYLAND_DISPLAY
78 changes: 78 additions & 0 deletions swayfx/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Maintainer: Erik Reider <[email protected]>
_pkgname=swayfx
pkgname="$_pkgname"
pkgver=0.3.2
pkgrel=5
license=("MIT")
pkgdesc="SwayFX: Sway, but with eye candy!"
makedepends=(
"git"
"meson"
"scdoc"
"wayland-protocols"
)
depends=(
"cairo"
"gdk-pixbuf2"
"libevdev.so"
"libinput"
"libjson-c.so"
"libudev.so"
"libwayland-server.so"
"libwlroots.so=11"
"libxcb"
"libxkbcommon.so"
"pango"
"pcre2"
"ttf-font"
)
optdepends=(
"alacritty: Terminal emulator used by the default config"
"dmenu: Application launcher"
"grim: Screenshot utility"
"i3status: Status line"
"mako: Lightweight notification daemon"
"slurp: Select a region"
"swayidle: Idle management daemon"
"swaylock: Screen locker"
"wallutils: Timed wallpapers"
"waybar: Highly customizable bar"
"xdg-desktop-portal-gtk: Default xdg-desktop-portal for file picking"
"xdg-desktop-portal-wlr: xdg-desktop-portal backend"
)
backup=(etc/sway/config)
arch=("i686" "x86_64")
url="https://github.com/WillPower3309/swayfx"
source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/$pkgver.tar.gz"
50-systemd-user.conf
sway-portals.conf)
sha512sums=(
"SKIP"
"d5f9aadbb4bbef067c31d4c8c14dad220eb6f3e559e9157e20e1e3d47faf2f77b9a15e52519c3ffc53dc8a5202cb28757b81a4b3b0cc5dd50a4ddc49e03fe06e"
"790741df028822bf4d83170dea57e1c63f7d7938cf31969e4cd347b0fc07330322b603c9ec0091b7a3f425132bed9dee6f261074cc273555120858beaaaf5da1")
provides=("sway" "swayfx")
conflicts=("sway" "swayfx")
options=(debug)
install=sway.install

build() {
export PKG_CONFIG_PATH='/usr/lib/wlroots0.16/pkgconfig'
arch-meson \
-Dwerror=false \
-Dsd-bus-provider=libsystemd \
"${_pkgname}-${pkgver}" build
meson compile -C build
}

package() {
install -Dm644 50-systemd-user.conf -t "$pkgdir/etc/sway/config.d/"
install -Dm644 sway-portals.conf "$pkgdir/usr/share/xdg-desktop-portal/sway-portals.conf"

DESTDIR="$pkgdir" meson install -C build

cd "${_pkgname}-${pkgver}"
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
for util in autoname-workspaces.py inactive-windows-transparency.py grimshot; do
install -Dm755 "contrib/$util" -t "$pkgdir/usr/share/$pkgname/scripts"
done
}
6 changes: 6 additions & 0 deletions swayfx/sway-portals.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[preferred]
# Use xdg-desktop-portal-gtk for every portal interface...
default=gtk
# ... except for the ScreenCast and Screenshot
org.freedesktop.impl.portal.ScreenCast=wlr
org.freedesktop.impl.portal.Screenshot=wlr
Loading
Loading