Skip to content

Commit

Permalink
packaging: initial copr support
Browse files Browse the repository at this point in the history
Update makefile and adds a .spec file for Copr.

Signed-off-by: ldelossa <louis.delos@gmail.com>
  • Loading branch information
ldelossa committed May 28, 2024
1 parent 812f0f7 commit 30798bd
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 12 deletions.
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
SCHEMADIR ?= $(PREFIX)/share/glib-2.0/schemas
USERUNITDIR ?= $(PREFIX)/lib/systemd/user

CC := gcc
DEPS := libadwaita-1 \
upower-glib \
Expand All @@ -19,9 +24,7 @@ SOURCES := $(shell find src/ -type f -name *.c)
OBJS := $(patsubst %.c, %.o, $(SOURCES))
OBJS += lib/cmd_tree/cmd_tree.o

all: wlr-protocols gschema gresources way-shell lib/cmd_tree/cmd_tree.o way-sh/way-sh

install: all gschema
all: wlr-protocols gresources way-shell way-sh/way-sh

way-shell: $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
Expand All @@ -36,11 +39,6 @@ gresources:
glib-compile-resources --generate-source --target src/gresources.c gresources.xml
glib-compile-resources --generate-header --target src/gresources.h gresources.xml

.PHONY:
gschema: ./data/org.ldelossa.way-shell.gschema.xml
sudo cp data/org.ldelossa.way-shell.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

.PHONY:
wlr-protocols:
wayland-scanner client-header < ./data/wlr-protocols/unstable/wlr-foreign-toplevel-management-unstable-v1.xml > ./src/services/wayland_service/wlr-foreign-toplevel-management-unstable-v1.h
Expand Down Expand Up @@ -90,11 +88,16 @@ dbus-codegen:
--output-directory ./src/services/media_player_service \
./data/dbus-interfaces/org.mpris.MediaPlayer2.xml

.PHONY:
install-gschema:
glib-compile-schemas $(DESTDIR)$(SCHEMADIR)

.PHONY:
install:
sudo rm -rf /usr/local/bin/{way-shell,way-sh}
sudo cp ./way-shell /usr/local/bin
sudo cp ./way-sh/way-sh /usr/local/bin
install -D ./way-shell $(DESTDIR)$(BINDIR)/way-shell
install -D ./way-sh/way-sh $(DESTDIR)$(BINDIR)/way-sh
install -D data/org.ldelossa.way-shell.gschema.xml $(DESTDIR)$(SCHEMADIR)/org.ldelossa.way-shell.gschema.xml
install -D contrib/systemd/way-shell.service $(DESTDIR)$(USERUNITDIR)/way-shell.service

clean:
find . -name "*.o" -type f -exec rm -f {} \;
Expand Down
2 changes: 1 addition & 1 deletion contrib/systemd/way-shell.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Type=Exec
# This directive tells systemd to only kill the main process when Way-Shell is
# restarted or crashes, avoiding the killing of any launched apps.
KillMode=process
ExecStart=/usr/local/bin/way-shell
ExecStart=/usr/bin/way-shell

[Install]
WantedBy=sway-session.target
81 changes: 81 additions & 0 deletions way-shell.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
%define _userunitdir /usr/lib/systemd/user

Name: way-shell
Version: 0.0.1
Release: 1%{?dist}
Summary: A Gnome-like desktop shell for Wayland compositors.
License: MIT

URL: https://github.com/ldelossa/way-shell
Source0: https://github.com/ldelossa/way-shell/archive/refs/heads/copr-repo.tar.gz

BuildRequires: gcc
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: meson
BuildRequires: cmake
BuildRequires: gtk-doc
BuildRequires: wayland-devel
BuildRequires: glib2-devel

BuildRequires: pkgconfig(libadwaita-1)
BuildRequires: pkgconfig(upower-glib)
BuildRequires: pkgconfig(wireplumber-0.5)
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(libnm)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libpulse-simple)
BuildRequires: pkgconfig(libpulse-mainloop-glib)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(gtk4-layer-shell-0)

Requires: NetworkManager
Requires: wireplumber
Requires: upower
Requires: power-profiles-daemon
Requires: systemd

%description
A Gnome inspired desktop shell for Wayland compositors/window managers written
in C and Gtk4.

Way-Shell expects a Gnome-like environment to be available.
This means DBus must be running and the following services must be available:

- Logind
- NetworkManager
- WirePlumber/Pipewire
- PowerProfiles Daemon
- UPower

If you're using Fedora these services should be available by default.

Currently Way-Shell only supports Sway but this will change as the project
matures.

%prep
%setup -n way-shell-copr-repo

%build
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}

%post
glib-compile-schemas %{_datadir}/glib-2.0/schemas

%postun
glib-compile-schemas %{_datadir}/glib-2.0/schemas

%files
%{_bindir}/way-shell
%{_bindir}/way-sh
%{_datadir}/glib-2.0/schemas/org.ldelossa.way-shell.gschema.xml
%{_userunitdir}/way-shell.service

%changelog
* Mon May 27 2024 Louis DeLosSantos <louis.delos.deve@gmail.com>
- Initial packaging

0 comments on commit 30798bd

Please sign in to comment.