File noctalia-qs.spec of Package noctalia-qs

#
# spec file for package noctalia-qs
#
# Copyright (c) 2026 neyfua
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           noctalia-qs
Version:        0.0.9
Release:        1%{?dist}
Summary:        Flexible toolkit for making desktop shells with QtQuick, for Wayland and X11
License:        LGPL-3.0
URL:            https://github.com/noctalia-dev/noctalia-qs
Source0:        %{name}-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  ninja
BuildRequires:  gcc-c++
BuildRequires:  git
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6Qml)
BuildRequires:  cmake(Qt6ShaderTools)
BuildRequires:  cmake(Qt6WaylandClient)
BuildRequires:  qt6-base-private-devel
BuildRequires:  qt6-declarative-private-devel
BuildRequires:  qt6-waylandclient-private-devel
BuildRequires:  cli11-devel
BuildRequires:  wayland-protocols-devel
BuildRequires:  wayland-devel
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pam-devel
BuildRequires:  pipewire-devel
BuildRequires:  libdrm-devel
BuildRequires:  libgbm-devel
BuildRequires:  Mesa-libEGL-devel
BuildRequires:  Mesa-libGLESv3-devel
BuildRequires:  polkit-devel
BuildRequires:  jemalloc-devel
BuildRequires:  cpptrace-devel
BuildRequires:  libzstd-devel
BuildRequires:  chrpath

Requires:       qt6-wayland
Requires:       jemalloc
Requires:       cpptrace
Requires:       libzstd1

Recommends:     noctalia-shell

Conflicts:      quickshell
Conflicts:      quickshell-git

%description
noctalia-qs extends Quickshell with features and patches specific to the Noctalia shell ecosystem, including:

- ext-background-effect-v1 Wayland protocol support
- Noctalia-specific build defaults and configuration

The binary is named qs and is a drop-in replacement for quickshell when using Noctalia Shell.

%prep
%setup -q -n %{name}-%{version}

%build
if [ -f "src/wayland/CMakeLists.txt" ]; then
	if ! pkg-config --atleast-version=1.41 wayland-protocols 2>/dev/null; then
		WL_VERSION=$(pkg-config --modversion wayland-protocols 2>/dev/null || echo "unknown")
		sed -i 's/wayland-protocols>=1\.41/wayland-protocols>=1.38/g' src/wayland/CMakeLists.txt
		echo "Patched wayland-protocols requirement from 1.41 to 1.38 (system has $WL_VERSION)"
	else
		echo "wayland-protocols >= 1.41 available, no patch needed"
	fi
fi

export PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export CFLAGS="-I/usr/include/wayland"
export CXXFLAGS="-I/usr/include/wayland"
rm -rf build
mkdir build
cd build

COMMIT=$(grep commit %{_sourcedir}/%{name}.obsinfo | cut -d' ' -f2 | cut -c1-8)

cmake -GNinja \
	-DDISTRIBUTOR="openSUSE" \
	-DCMAKE_BUILD_TYPE=Release \
	-DGIT_REVISION="$COMMIT" \
	-DCMAKE_CXX_STANDARD=20 \
	-DCRASH_HANDLER=ON \
	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DCMAKE_SKIP_RPATH=ON \
	-DCMAKE_SKIP_INSTALL_RPATH=ON \
	-DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF \
	..

cmake --build .

cd ..

%install
cd build
DESTDIR=%{buildroot} cmake --install .
cd ..

chrpath -d %{buildroot}%{_bindir}/quickshell 2>/dev/null || true

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/dev.noctalia.noctalia-qs.desktop || true

%files
%license LICENSE
%doc README.md
%{_bindir}/quickshell
%{_bindir}/qs
%{_datadir}/applications/dev.noctalia.noctalia-qs.desktop
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/scalable/apps/dev.noctalia.noctalia-qs.svg

%changelog

openSUSE Build Service is sponsored by