forge
Explore
Log in

Don't you dare go Hollow

Add an rpkg spec template

Browse files at this commit

e98d1ec5a7d2de0b5ba901e56a3e810e37fdcdecIvan MolodetskikhParent: 3ace976
niri.spec.rpkgadded+146 -0
@@ -0,0 +1,146 @@
1+%bcond_without check
2+
3+%global cargo_install_lib 0
4+
5+# We want panic backtraces to work without installing the debuginfo package,
6+# so we leave the debuginfo in the main binary.
7+%global debug_package %{nil}
8+%global __strip /bin/true
9+
10+# To reduce the file size, do some convincing of rust-srpm-macros
11+# to leave alone the chosen debug settings from Cargo.toml.
12+%global rustflags_debuginfo please-remove-me
13+%global build_rustflags %{shrink:
14+ -Copt-level=%rustflags_opt_level
15+ -Ccodegen-units=%rustflags_codegen_units
16+ -Cstrip=none
17+ %{expr:0%{?_include_frame_pointers} && ("%{_arch}" != "ppc64le" && "%{_arch}" != "s390x" && "%{_arch}" != "i386") ? "-Cforce-frame-pointers=yes" : ""}
18+ -Clink-arg=-Wl,-z,relro
19+ -Clink-arg=-Wl,-z,now
20+ %[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""]
21+ --cap-lints=warn
22+}
23+
24+# Convince rust-srpm-macros to use Cargo.lock with the Smithay commit.
25+%global __cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps --locked
26+
27+%global version {{{ git_dir_version }}}
28+
29+Name: niri
30+Version: %{version}
31+Release: 1%{?dist}
32+Summary: Scrollable-tiling Wayland compositor
33+
34+SourceLicense: GPL-3.0-or-later
35+
36+# (MIT OR Apache-2.0) AND BSD-3-Clause
37+# 0BSD OR MIT OR Apache-2.0
38+# Apache-2.0
39+# Apache-2.0 OR BSL-1.0
40+# Apache-2.0 OR MIT
41+# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
42+# BSD-2-Clause
43+# BSD-2-Clause OR Apache-2.0 OR MIT
44+# BSD-3-Clause
45+# BSD-3-Clause OR MIT OR Apache-2.0
46+# GPL-3.0-or-later
47+# ISC
48+# MIT
49+# MIT OR Apache-2.0
50+# MIT OR Apache-2.0 OR Zlib
51+# MIT OR Zlib OR Apache-2.0
52+# MPL-2.0
53+# Unlicense OR MIT
54+# Zlib OR Apache-2.0 OR MIT
55+License: ((MIT OR Apache-2.0) AND BSD-3-Clause) AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (BSD-3-Clause) AND (BSD-3-Clause OR MIT OR Apache-2.0) AND (GPL-3.0-or-later) AND (ISC) AND (MIT) AND (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Zlib OR Apache-2.0) AND (MPL-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT)
56+# LICENSE.dependencies contains a full license breakdown
57+
58+URL: https://github.com/YaLTeR/niri
59+VCS: {{{ git_dir_vcs }}}
60+Source: {{{ git_dir_pack }}}
61+
62+BuildRequires: cargo-rpm-macros >= 26
63+BuildRequires: pkgconfig(udev)
64+BuildRequires: pkgconfig(gbm)
65+BuildRequires: pkgconfig(xkbcommon)
66+BuildRequires: wayland-devel
67+BuildRequires: pkgconfig(libinput)
68+BuildRequires: pkgconfig(dbus-1)
69+BuildRequires: pkgconfig(systemd)
70+BuildRequires: pkgconfig(libseat)
71+BuildRequires: pipewire-devel
72+BuildRequires: pango-devel
73+BuildRequires: cairo-gobject-devel
74+# Needed for pipewire-rs
75+BuildRequires: clang
76+
77+Requires: mesa-dri-drivers
78+
79+# Portal implementations used by niri
80+Recommends: xdg-desktop-portal-gtk
81+Recommends: xdg-desktop-portal-gnome
82+Recommends: gnome-keyring
83+
84+# Suggested utilities, bound in the default config
85+Recommends: alacritty
86+Recommends: fuzzel
87+Recommends: swaylock
88+# Suggested utilities
89+Recommends: swaybg
90+Recommends: mako
91+Recommends: swayidle
92+
93+%description
94+A scrollable-tiling Wayland compositor.
95+
96+Windows are arranged in columns on an infinite strip going to the right.
97+Opening a new window never causes existing windows to resize.
98+
99+%prep
100+{{{ git_dir_setup_macro }}}
101+
102+# Make the version log message look nicer: since we're building not from niri's git repository,
103+# the git version macro will show its fallback string.
104+sed -i 's/"unknown commit"/"%{version}"/' src/utils/mod.rs
105+
106+%cargo_prep -N
107+
108+# We're doing an online build.
109+sed -i 's/^offline = true$//' .cargo/config.toml
110+
111+# Final step in leaving alone our debug settings.
112+sed -i 's/.*please-remove-me$//' .cargo/config.toml
113+
114+%build
115+%cargo_build
116+
117+%install
118+%cargo_install
119+
120+install -Dm755 -t %{buildroot}%{_bindir} ./resources/niri-session
121+install -Dm644 -t %{buildroot}%{_datadir}/wayland-sessions ./resources/niri.desktop
122+install -Dm644 -t %{buildroot}%{_datadir}/xdg-desktop-portal ./resources/niri-portals.conf
123+install -Dm644 -t %{buildroot}%{_userunitdir} ./resources/niri.service
124+install -Dm644 -t %{buildroot}%{_userunitdir} ./resources/niri-shutdown.target
125+
126+%if %{with check}
127+%check
128+%cargo_test -- --workspace --exclude niri-visual-tests
129+%endif
130+
131+%files
132+%license LICENSE
133+%doc README.md
134+%doc resources/default-config.kdl
135+%doc wiki
136+%{_bindir}/niri
137+%{_bindir}/niri-session
138+%{_datadir}/wayland-sessions/niri.desktop
139+%dir %{_datadir}/xdg-desktop-portal
140+%{_datadir}/xdg-desktop-portal/niri-portals.conf
141+%{_userunitdir}/niri.service
142+%{_userunitdir}/niri-shutdown.target
143+
144+%changelog
145+{{{ git_dir_changelog }}}
146+