diff --git a/.github/workflows/aur_build.yml b/.github/workflows/aur_build.yml index 14883d1..1223506 100644 --- a/.github/workflows/aur_build.yml +++ b/.github/workflows/aur_build.yml @@ -2,8 +2,12 @@ name: Test building the PKGBUILDs on: push: + paths: + - aur/** branches: [ main ] pull_request: + paths: + - aur/** branches: [ main ] # Allows you to run this workflow manually from the Actions tab @@ -30,5 +34,5 @@ jobs: uses: edlanglois/pkgbuild-action@v1 with: aurDeps: true - pkgdir: ${{matrix.pkgname}} + pkgdir: aur/${{matrix.pkgname}} diff --git a/.github/workflows/aur_publish.yml b/.github/workflows/aur_publish.yml index 3985aec..e066241 100644 --- a/.github/workflows/aur_publish.yml +++ b/.github/workflows/aur_publish.yml @@ -3,6 +3,8 @@ name: Package for the AUR # Only run when pushed to main on: push: + paths: + - aur/** branches: [main] # Allows you to run this workflow manually from the Actions tab @@ -15,15 +17,15 @@ jobs: include: - pkgname: swayfx assets: | - ./swayfx/sway-portals.conf - ./swayfx/50-systemd-user.conf - ./swayfx/sway.install + ./aur/swayfx/sway-portals.conf + ./aur/swayfx/50-systemd-user.conf + ./aur/swayfx/sway.install - pkgname: swayfx-git assets: | - ./swayfx-git/sway-portals.conf - ./swayfx-git/50-systemd-user.conf - ./swayfx-git/sway.install + ./aur/swayfx-git/sway-portals.conf + ./aur/swayfx-git/50-systemd-user.conf + ./aur/swayfx-git/sway.install - pkgname: scenefx - pkgname: scenefx-git @@ -40,7 +42,7 @@ jobs: uses: ulises-jeremias/github-actions-aur-publish@v1 with: pkgname: ${{ matrix.pkgname }} - pkgbuild: ${{matrix.pkgname}}/PKGBUILD + pkgbuild: aur/${{matrix.pkgname}}/PKGBUILD assets: ${{ matrix.assets }} commit_username: ${{ secrets.AUR_USERNAME }} commit_email: ${{ secrets.AUR_EMAIL }} diff --git a/.github/workflows/copr_build.yml b/.github/workflows/copr_build.yml new file mode 100644 index 0000000..2101913 --- /dev/null +++ b/.github/workflows/copr_build.yml @@ -0,0 +1,66 @@ +name: Build RPMs + +on: + push: + paths: + - COPR/** + branches: [ main ] + pull_request: + paths: + - COPR/** + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + RPM-build: + name: Build RPM swayfx + container: fedora:latest + runs-on: ubuntu-latest + steps: + - name: Install tooling for source RPM build + run: | + dnf -y install rpkg @rpm-development-tools 'dnf-command(builddep)' + + - name: Check out sources + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: SceneFX Download RPM Spec sources + run: | + cd COPR/scenefx + spectool -g ./scenefx.rpkg.spec + + - name: SceneFX Install build dependencies + run: | + cd COPR/scenefx + dnf -y builddep ./scenefx.rpkg.spec + + - name: SceneFX Build RPM + run: | + cd COPR/scenefx + mkdir -p out + rpkg local --out `pwd`/out + + - name: SceneFX Install RPMs + run: | + cd COPR/scenefx + dnf -y install ./out/**/*.rpm + + - name: SwayFX Download RPM Spec sources + run: | + cd COPR/swayfx + spectool -g ./swayfx.rpkg.spec + + - name: SwayFX Install build dependencies + run: | + cd COPR/swayfx + dnf -y builddep ./swayfx.rpkg.spec + + - name: SwayFX Build RPM + run: | + cd COPR/swayfx + mkdir -p out + rpkg local --out `pwd`/out diff --git a/.github/workflows/copr_upload.yml b/.github/workflows/copr_upload.yml new file mode 100644 index 0000000..b969757 --- /dev/null +++ b/.github/workflows/copr_upload.yml @@ -0,0 +1,49 @@ +name: Package for Copr repo + +on: + push: + paths: + - COPR/** + branches: [main] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + upload-copr: + strategy: + fail-fast: false + matrix: + pkgname: [ swayfx, scenefx ] + + container: fedora:latest + runs-on: ubuntu-latest + steps: + - name: Install API token for copr-cli + env: + # To generate a new token: https://copr.fedorainfracloud.org/api/. + API_LOGIN: ${{ secrets.COPR_API_LOGIN }} + API_USERNAME: ${{ secrets.COPR_API_USERNAME }} + API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }} + run: | + mkdir -p "$HOME/.config" + # To generate a new token: https://copr.fedorainfracloud.org/api/. + echo "[copr-cli]" >> "$HOME/.config/copr" + echo "login = $API_LOGIN" >> "$HOME/.config/copr" + echo "username = $API_USERNAME" >> "$HOME/.config/copr" + echo "token = $API_TOKEN_CONTENT" >> "$HOME/.config/copr" + echo "copr_url = https://copr.fedorainfracloud.org" >> "$HOME/.config/copr" + + - name: Install dependencies + run: | + dnf -y install copr-cli + + - name: Check out sources + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Submit the build to copr + run: | + cd COPR/${{matrix.pkgname}} + rpkg -v copr-build -w ${{ secrets.COPR_REPO_NAME }} diff --git a/COPR/scenefx/scenefx.rpkg.spec b/COPR/scenefx/scenefx.rpkg.spec new file mode 100644 index 0000000..9bc7db2 --- /dev/null +++ b/COPR/scenefx/scenefx.rpkg.spec @@ -0,0 +1,86 @@ +# vim: syntax=spec + +### CHANGE THESE VARIABLES BEFORE RELEASE: +# Change to current SceneFX tag! +%global tag 0.1 +# Version of the .so library +%global abi_ver 1 + +Name: scenefx +Version: %{tag} +Release: 1%{?dist} +Summary: A drop-in replacement for the wlroots scene API that allows wayland compositors to render surfaces with eye-candy effects +License: MIT +URL: https://github.com/wlrfx/scenefx +Source0: %{url}/archive/refs/tags/%{tag}.tar.gz + + +BuildRequires: gcc +BuildRequires: glslang +BuildRequires: gnupg2 +BuildRequires: meson >= 0.59.0 + +BuildRequires: (pkgconfig(wlroots) >= 0.17.0 with pkgconfig(wlroots) < 0.18) +BuildRequires: pkgconfig(egl) +BuildRequires: pkgconfig(gbm) >= 17.1.0 +BuildRequires: pkgconfig(glesv2) +BuildRequires: pkgconfig(hwdata) +BuildRequires: pkgconfig(libdrm) >= 2.4.114 +BuildRequires: pkgconfig(pixman-1) >= 0.42.0 +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-protocols) >= 1.32 +BuildRequires: pkgconfig(wayland-scanner) +BuildRequires: pkgconfig(wayland-server) >= 1.22 + +%description +%{summary} + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} == %{version}-%{release} +# for examples +Suggests: gcc +Suggests: meson >= 0.58.0 +Suggests: pkgconfig(wayland-egl) + +%description devel +Development files for %{name}. + + +%prep +%autosetup -N + +%build +MESON_OPTIONS=( + # Disable options requiring extra/unpackaged dependencies + -Dexamples=false + -Dwerror=false +) + +%{meson} "${MESON_OPTIONS[@]}" +%{meson_build} + + +%install +%{meson_install} + + +%check +%{meson_test} + + +%files +%license LICENSE +%doc README.md +%{_libdir}/lib%{name}.so.%{abi_ver}{,.*} + + +%files devel +%{_includedir}/scenefx +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + + +# Changelog will be empty until you make first annotated Git tag. +# %changelog diff --git a/swayfx-git/50-systemd-user.conf b/COPR/swayfx/50-systemd-user.conf similarity index 100% rename from swayfx-git/50-systemd-user.conf rename to COPR/swayfx/50-systemd-user.conf diff --git a/swayfx/sway-portals.conf b/COPR/swayfx/sway-portals.conf similarity index 100% rename from swayfx/sway-portals.conf rename to COPR/swayfx/sway-portals.conf diff --git a/COPR/swayfx/swayfx.rpkg.spec b/COPR/swayfx/swayfx.rpkg.spec new file mode 100644 index 0000000..b53bcba --- /dev/null +++ b/COPR/swayfx/swayfx.rpkg.spec @@ -0,0 +1,122 @@ +# vim: syntax=spec + +### CHANGE THESE VARIABLES BEFORE RELEASE: +# Change to current Sway base version! +%global SwayBaseVersion 1.9.0 +# Change to current SwayFX tag! +%global tag 0.4 + +Name: swayfx +Version: %{tag} +Release: 1%{?dist} +Summary: SwayFX: Sway, but with eye candy! +License: MIT +URL: https://github.com/WillPower3309/swayfx +Source0: %{url}/archive/refs/tags/%{tag}.tar.gz +Source101: sway-portals.conf + +# Upstream patches + +# Fedora patches + +# Conditional patches + +BuildRequires: gcc-c++ +BuildRequires: gnupg2 +BuildRequires: meson >= 0.60.0 +BuildRequires: pkgconfig(cairo) +BuildRequires: pkgconfig(gdk-pixbuf-2.0) +BuildRequires: pkgconfig(glesv2) +BuildRequires: pkgconfig(json-c) >= 0.13 +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(libevdev) +BuildRequires: pkgconfig(libinput) >= 1.21.0 +BuildRequires: pkgconfig(libpcre2-8) +BuildRequires: pkgconfig(libsystemd) >= 239 +BuildRequires: pkgconfig(libudev) +BuildRequires: pkgconfig(pango) +BuildRequires: pkgconfig(pangocairo) +BuildRequires: pkgconfig(pixman-1) +BuildRequires: pkgconfig(scdoc) +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-cursor) +BuildRequires: pkgconfig(wayland-server) >= 1.21.0 +BuildRequires: pkgconfig(wayland-protocols) >= 1.24 +BuildRequires: (pkgconfig(wlroots) >= 0.17.0 with pkgconfig(wlroots) < 0.18) +BuildRequires: (pkgconfig(scenefx) >= 0.1 with pkgconfig(scenefx) < 0.2) +BuildRequires: pkgconfig(xcb) +BuildRequires: pkgconfig(xcb-icccm) +BuildRequires: pkgconfig(xkbcommon) >= 1.5.0 + +# Require any of the available configuration packages; +# Prefer the -upstream one if none are directly specified in the package manager transaction +Requires: %{name}-config +Suggests: %{name}-config-upstream + + +Conflicts: sway +Provides: sway = %{SwayBaseVersion} + +%description +SwayFX: Sway, but with eye candy! + +# The artwork is heavy and we don't use it with our default config +%package wallpapers +Summary: Wallpapers for Sway +BuildArch: noarch +License: CC0 + +%description wallpapers +Wallpaper collection provided with Sway + + +%prep +%autosetup -N -n %{name}-%{tag} + +# apply unconditional patches +%autopatch -p1 -M99 +# apply conditional patches + +%build +%meson \ + -Dsd-bus-provider=libsystemd \ + -Dwerror=false +%meson_build + +%install +%meson_install +# Install portals.conf for xdg-desktop-portal +install -D -m644 -pv %{SOURCE101} %{buildroot}%{_datadir}/xdg-desktop-portal/sway-portals.conf +# Create directory for extra config snippets +install -d -m755 -pv %{buildroot}%{_sysconfdir}/sway/config.d + + +%files +%license LICENSE +%dir %{_sysconfdir}/sway +%dir %{_sysconfdir}/sway/config.d +%{_mandir}/man1/sway* +%{_mandir}/man5/* +%{_mandir}/man7/* +%caps(cap_sys_nice=ep) %{_bindir}/sway +%{_bindir}/swaybar +%{_bindir}/swaymsg +%{_bindir}/swaynag + +%config(noreplace) %{_sysconfdir}/sway/config +%{_datadir}/wayland-sessions/sway.desktop + +%dir %{_datadir}/xdg-desktop-portal +%{_datadir}/xdg-desktop-portal/sway-portals.conf + +%{bash_completions_dir}/sway* +%{fish_completions_dir}/sway*.fish +%{zsh_completions_dir}/_sway* + + +%files wallpapers +%license assets/LICENSE +%{_datadir}/backgrounds/sway + +# Changelog will be empty until you make first annotated Git tag. +# %changelog diff --git a/scenefx-git/.SRCINFO b/aur/scenefx-git/.SRCINFO similarity index 100% rename from scenefx-git/.SRCINFO rename to aur/scenefx-git/.SRCINFO diff --git a/scenefx-git/PKGBUILD b/aur/scenefx-git/PKGBUILD similarity index 100% rename from scenefx-git/PKGBUILD rename to aur/scenefx-git/PKGBUILD diff --git a/scenefx/.SRCINFO b/aur/scenefx/.SRCINFO similarity index 100% rename from scenefx/.SRCINFO rename to aur/scenefx/.SRCINFO diff --git a/scenefx/PKGBUILD b/aur/scenefx/PKGBUILD similarity index 100% rename from scenefx/PKGBUILD rename to aur/scenefx/PKGBUILD diff --git a/swayfx-git/.SRCINFO b/aur/swayfx-git/.SRCINFO similarity index 100% rename from swayfx-git/.SRCINFO rename to aur/swayfx-git/.SRCINFO diff --git a/swayfx/50-systemd-user.conf b/aur/swayfx-git/50-systemd-user.conf similarity index 100% rename from swayfx/50-systemd-user.conf rename to aur/swayfx-git/50-systemd-user.conf diff --git a/swayfx-git/PKGBUILD b/aur/swayfx-git/PKGBUILD similarity index 100% rename from swayfx-git/PKGBUILD rename to aur/swayfx-git/PKGBUILD diff --git a/swayfx-git/sway-portals.conf b/aur/swayfx-git/sway-portals.conf similarity index 100% rename from swayfx-git/sway-portals.conf rename to aur/swayfx-git/sway-portals.conf diff --git a/swayfx-git/sway.install b/aur/swayfx-git/sway.install similarity index 100% rename from swayfx-git/sway.install rename to aur/swayfx-git/sway.install diff --git a/swayfx/.SRCINFO b/aur/swayfx/.SRCINFO similarity index 100% rename from swayfx/.SRCINFO rename to aur/swayfx/.SRCINFO diff --git a/aur/swayfx/50-systemd-user.conf b/aur/swayfx/50-systemd-user.conf new file mode 100644 index 0000000..8781db9 --- /dev/null +++ b/aur/swayfx/50-systemd-user.conf @@ -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 diff --git a/swayfx/PKGBUILD b/aur/swayfx/PKGBUILD similarity index 100% rename from swayfx/PKGBUILD rename to aur/swayfx/PKGBUILD diff --git a/aur/swayfx/sway-portals.conf b/aur/swayfx/sway-portals.conf new file mode 100644 index 0000000..aa046f6 --- /dev/null +++ b/aur/swayfx/sway-portals.conf @@ -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 diff --git a/swayfx/sway.install b/aur/swayfx/sway.install similarity index 100% rename from swayfx/sway.install rename to aur/swayfx/sway.install