From 73136c1e07747205d96c57ce3cb9065e0cc09db5 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Fri, 4 Nov 2022 21:39:11 +0100 Subject: [PATCH 1/3] Added initial spec file --- .gitignore | 1 + build-scripts/swayfx.rpkg.spec | 86 ++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 build-scripts/swayfx.rpkg.spec diff --git a/.gitignore b/.gitignore index 51d2019d..b89fd637 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ bin/ test/ build/ build-*/ +!build-scripts .lvimrc config-debug wayland-*-protocol.* diff --git a/build-scripts/swayfx.rpkg.spec b/build-scripts/swayfx.rpkg.spec new file mode 100644 index 00000000..9cfbfcb8 --- /dev/null +++ b/build-scripts/swayfx.rpkg.spec @@ -0,0 +1,86 @@ +# vim: syntax=spec +Name: {{{ git_dir_name }}} +Version: 0.1 +Release: 1%{?dist} +Summary: SwayFX: Sway, but with eye candy! +License: MIT +URL: https://github.com/WillPower3309/swayfx +VCS: {{{ git_dir_vcs }}} +Source: {{{ git_dir_pack }}} + +BuildRequires: gcc-c++ +BuildRequires: gnupg2 +BuildRequires: meson >= 0.60.0 +BuildRequires: pkgconfig(cairo) +BuildRequires: pkgconfig(gdk-pixbuf-2.0) +BuildRequires: pkgconfig(json-c) >= 0.13 +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(libevdev) +BuildRequires: pkgconfig(libinput) >= 1.6.0 +BuildRequires: pkgconfig(libpcre) +BuildRequires: pkgconfig(libsystemd) >= 239 +BuildRequires: pkgconfig(libudev) +BuildRequires: pkgconfig(pango) +BuildRequires: pkgconfig(pangocairo) +BuildRequires: pkgconfig(scdoc) +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-cursor) +BuildRequires: pkgconfig(wayland-egl) +BuildRequires: pkgconfig(wayland-server) >= 1.20.0 +BuildRequires: pkgconfig(wayland-protocols) >= 1.24 +BuildRequires: (pkgconfig(wlroots) >= 0.15.0 with pkgconfig(wlroots) < 0.16) +BuildRequires: pkgconfig(xcb) +BuildRequires: pkgconfig(xkbcommon) +# Dmenu is the default launcher in sway +Recommends: dmenu +# In addition, xargs is recommended for use in such a launcher arrangement +Recommends: findutils +# Install configs and scripts for better integration with systemd user session +Recommends: sway-systemd + +Requires: swaybg +Recommends: swayidle +Recommends: swaylock +# By default the Fedora background is used +Recommends: desktop-backgrounds-compat + +# Lack of graphical drivers may hurt the common use case +Recommends: mesa-dri-drivers +# Minimal installation doesn't include Qt Wayland backend +Recommends: (qt5-qtwayland if qt5-qtbase-gui) +Recommends: (qt6-qtwayland if qt6-qtbase-gui) + +# dmenu (as well as rxvt any many others) requires XWayland on Sway +Requires: xorg-x11-server-Xwayland +# Sway binds the terminal shortcut to one specific terminal. In our case foot +Recommends: foot +# grim is the recommended way to take screenshots on sway 1.0+ +Recommends: grim +%{?systemd_requires} + +%description +SwayFX: Sway, but with eye candy! + +%prep +{{{ git_dir_setup_macro }}} + +%build +%meson \ + -Dsd-bus-provider=libsystemd \ + -Dwerror=false + +%meson_build + +%install +%meson_install + +%files +%license LICENSE +%doc README.md +%{_bindir}/sway-git +%{_bindir}/swaybar-git +%{_datadir}/wayland-sessions/sway-git.desktop + +# Changelog will be empty until you make first annotated Git tag. +%changelog +{{{ git_dir_changelog }}} From 6ed680a135953b2c0d0e75b518c58a9f65184fcf Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:05:39 +0100 Subject: [PATCH 2/3] Added more packaged file locations to %files --- build-scripts/swayfx.rpkg.spec | 66 ++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/build-scripts/swayfx.rpkg.spec b/build-scripts/swayfx.rpkg.spec index 9cfbfcb8..18b233a7 100644 --- a/build-scripts/swayfx.rpkg.spec +++ b/build-scripts/swayfx.rpkg.spec @@ -61,6 +61,29 @@ Recommends: grim %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 + + +%package -n grimshot +Summary: Helper for screenshots within sway +Requires: grim +Requires: jq +Requires: slurp +Requires: /usr/bin/wl-copy +Recommends: /usr/bin/notify-send + +%description -n grimshot +Grimshot is an easy to use screenshot tool for sway. It relies on grim, +slurp and jq to do the heavy lifting, and mostly provides an easy to use +interface. + %prep {{{ git_dir_setup_macro }}} @@ -73,13 +96,50 @@ SwayFX: Sway, but with eye candy! %install %meson_install +# Set Fedora background as default background +sed -i "s|^output \* bg .*|output * bg /usr/share/backgrounds/default.png fill|" %{buildroot}%{_sysconfdir}/sway/config +# Create directory for extra config snippets +install -d -m755 -pv %{buildroot}%{_sysconfdir}/sway/config.d + +# install python scripts from contrib +install -D -m644 -pv -t %{buildroot}%{_datadir}/sway/contrib contrib/*.py + +# install contrib/grimshot tool +scdoc %{buildroot}%{_mandir}/man1/grimshot.1 +install -D -m755 -pv contrib/grimshot %{buildroot}%{_bindir}/grimshot %files %license LICENSE %doc README.md -%{_bindir}/sway-git -%{_bindir}/swaybar-git -%{_datadir}/wayland-sessions/sway-git.desktop +%dir %{_sysconfdir}/sway +%dir %{_sysconfdir}/sway/config.d +%config(noreplace) %{_sysconfdir}/sway/config +%{_mandir}/man1/sway* +%{_mandir}/man5/* +%{_mandir}/man7/* +%{_bindir}/sway +%{_bindir}/swaybar +%{_bindir}/swaymsg +%{_bindir}/swaynag +%{_datadir}/sway +%{_datadir}/wayland-sessions/sway.desktop +%dir %{_datadir}/zsh +%dir %{_datadir}/zsh/site-functions +%{_datadir}/zsh/site-functions/_sway* +%dir %{_datadir}/bash-completion +%dir %{_datadir}/bash-completion/completions +%{_datadir}/bash-completion/completions/sway* +%dir %{_datadir}/fish +%dir %{_datadir}/fish/vendor_completions.d +%{_datadir}/fish/vendor_completions.d/sway* + +%files wallpapers +%license assets/LICENSE +%{_datadir}/backgrounds/sway + +%files -n grimshot +%{_bindir}/grimshot +%{_mandir}/man1/grimshot.1* # Changelog will be empty until you make first annotated Git tag. %changelog From cb9978b5aefa353e1f188f6d59f6a11b23ff1719 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:12:08 +0100 Subject: [PATCH 3/3] Added GitHub build and copr actions --- .github/workflows/fedora-build.yml | 51 ++++++++++++++++++++++++++++++ .github/workflows/fedora-copr.yml | 43 +++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 .github/workflows/fedora-build.yml create mode 100644 .github/workflows/fedora-copr.yml diff --git a/.github/workflows/fedora-build.yml b/.github/workflows/fedora-build.yml new file mode 100644 index 00000000..3ce383ba --- /dev/null +++ b/.github/workflows/fedora-build.yml @@ -0,0 +1,51 @@ +name: Check build for Fedora. + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + package: + container: fedora:37 + runs-on: ubuntu-latest + + steps: + - name: Install tooling for source RPM build + run: | + dnf -y install @development-tools @rpm-development-tools + dnf -y install rpkg git + dnf -y install 'dnf-command(builddep)' + + # It is necessary to checkout into sub-directory, because of some weird ownership problems cause by using containers + - name: Check out sources + uses: actions/checkout@v3 + with: + fetch-depth: 0 + path: swayfx + + - name: Copy spec into root dir + run: | + cd swayfx + cp ./build-scripts/swayfx.rpkg.spec ./ + + - name: Generate spec + run: | + cd swayfx + mkdir specs + rpkg spec --source --outdir specs + + - name: Install build dependencies + run: | + cd swayfx + dnf -y builddep ./specs/swayfx.rpkg.spec + + - name: Local build + run: | + cd swayfx + mkdir -p out + rpkg local --out `pwd`/out diff --git a/.github/workflows/fedora-copr.yml b/.github/workflows/fedora-copr.yml new file mode 100644 index 00000000..c84f699e --- /dev/null +++ b/.github/workflows/fedora-copr.yml @@ -0,0 +1,43 @@ +name: Package for Fedora Copr repo + +on: + release: + types: [published] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + package: + 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_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }} + run: | + mkdir -p "$HOME/.config" + echo "$API_TOKEN_CONTENT" > "$HOME/.config/copr" + + - name: Install tooling for source RPM build + run: | + dnf -y install copr-cli rpkg git + + # It is necessary to checkout into sub-directory, because of some weird ownership problems cause by using containers + - name: Check out sources + uses: actions/checkout@v3 + with: + fetch-depth: 0 + path: swayfx + + - name: Copy spec into root dir + run: | + cd swayfx + cp ./build-scripts/swayfx.rpkg.spec ./ + + - name: Submit the build to copr + run: | + cd swayfx + rpkg -v copr-build -w ${{ secrets.COPR_REPO_NAME }}