Merge pull request #29 from WillPower3309/fedora-spec

Official Copr repo
This commit is contained in:
Erik Reider 2022-11-06 00:29:07 +01:00 committed by GitHub
commit 79dfbb9f44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 241 additions and 0 deletions

51
.github/workflows/fedora-build.yml vendored Normal file
View file

@ -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

43
.github/workflows/fedora-copr.yml vendored Normal file
View file

@ -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 }}

1
.gitignore vendored
View file

@ -7,6 +7,7 @@ bin/
test/ test/
build/ build/
build-*/ build-*/
!build-scripts
.lvimrc .lvimrc
config-debug config-debug
wayland-*-protocol.* wayland-*-protocol.*

View file

@ -0,0 +1,146 @@
# 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!
# 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 }}}
%build
%meson \
-Dsd-bus-provider=libsystemd \
-Dwerror=false
%meson_build
%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 <contrib/grimshot.1.scd >%{buildroot}%{_mandir}/man1/grimshot.1
install -D -m755 -pv contrib/grimshot %{buildroot}%{_bindir}/grimshot
%files
%license LICENSE
%doc README.md
%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
{{{ git_dir_changelog }}}