File quickshell.spec of Package quickshell

Name:           quickshell
Version:        0.2.1
Release:        1%{?dist}
Summary:        Flexible QtQuick desktop shell toolkit
License:        LGPL-3.0-only
Group:          System/GUI/WM
URL:            https://git.outfoxxed.me/outfoxxed/quickshell

Source0:        %{name}-%{version}.tar.gz

BuildRequires:  cmake ninja gcc-c++ git
BuildRequires:  qt6-base-devel qt6-declarative-devel qt6-declarative-private-devel qt6-wayland-devel qt6-waylandclient-private-devel qt6-linguist-devel qt6-tools-private-devel qt6-svg-devel qt6-shadertools-devel
BuildRequires:  cli11-devel wayland-protocols-devel wayland-devel pam-devel pipewire-devel libdrm-devel libgbm-devel Mesa-libEGL-devel Mesa-libGLESv3-devel polkit-devel jemalloc-devel chrpath
BuildRequires:  libxkbcommon-devel libwebp-devel libavif-devel dbus-1-devel libX11-devel libXcomposite-devel libXfixes-devel libXrandr-devel

%description
Quickshell is a flexible toolkit for creating desktop shells using QtQuick.

%prep
%autosetup -p1 -n quickshell

%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 -p build
cd build
cmake -GNinja \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCRASH_REPORTER=off \
    -DCMAKE_CXX_STANDARD=20 \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_RPATH="" \
    -DCMAKE_BUILD_RPATH="" \
    ..

cmake --build .
cd ..

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

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

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

%changelog
* Wed Dec 31 2025 timothybear1183 - 0.2.1-1
- Initial package based on DMS spec
openSUSE Build Service is sponsored by