# Copyright (c) 2025 Asher Buk # SPDX-License-Identifier: MIT # https://copr.fedorainfracloud.org/coprs/ashbuk/Hyprland-Fedora/ # ============================================================================= # Version definitions (single source of truth) # ============================================================================= %global portal_version 1.3.11 %global hyprland_min_ver 0.53.1 %global hyprwayland_scanner_ver 0.4.5 %global hyprutils_ver 0.11.0 %global hyprlang_ver 0.6.7 %global hyprland_protocols_ver 0.7.0 Name: xdg-desktop-portal-hyprland Version: %{portal_version} Release: 4%{?dist} Summary: XDG Desktop Portal backend for Hyprland License: BSD-3-Clause URL: https://github.com/hyprwm/xdg-desktop-portal-hyprland # Main source Source0: https://github.com/hyprwm/xdg-desktop-portal-hyprland/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # Vendored Hyprland libs (same versions as hyprland package) # These are needed at build time and will be linked via RUNPATH Source10: https://github.com/hyprwm/hyprwayland-scanner/archive/refs/tags/v%{hyprwayland_scanner_ver}.tar.gz#/hyprwayland-scanner-%{hyprwayland_scanner_ver}.tar.gz Source11: https://github.com/hyprwm/hyprutils/archive/refs/tags/v%{hyprutils_ver}.tar.gz#/hyprutils-%{hyprutils_ver}.tar.gz Source12: https://github.com/hyprwm/hyprlang/archive/refs/tags/v%{hyprlang_ver}.tar.gz#/hyprlang-%{hyprlang_ver}.tar.gz Source13: https://github.com/hyprwm/hyprland-protocols/archive/refs/tags/v%{hyprland_protocols_ver}.tar.gz#/hyprland-protocols-%{hyprland_protocols_ver}.tar.gz # Build dependencies BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: meson BuildRequires: ninja-build BuildRequires: pkgconf-pkg-config BuildRequires: pugixml-devel BuildRequires: pixman-devel # Portal dependencies BuildRequires: pipewire-devel >= 1.1.82 BuildRequires: sdbus-cpp-devel >= 2.0.0 BuildRequires: libdrm-devel BuildRequires: mesa-libgbm-devel BuildRequires: wayland-devel BuildRequires: wayland-protocols-devel # Qt6 for hyprland-share-picker BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qtwayland-devel # Runtime deps Requires: hyprland >= %{hyprland_min_ver} Requires: xdg-desktop-portal Requires: pipewire >= 1.1.82 %description xdg-desktop-portal-hyprland is a portal backend for Hyprland that provides screen sharing, file dialogs, and other desktop integration features. This package uses the same vendored Hyprland libraries as the main hyprland package, located in /usr/libexec/hyprland/vendor/. %prep %autosetup -n %{name}-%{version} # Unpack vendored deps tar -xzf %{SOURCE10} tar -xzf %{SOURCE11} tar -xzf %{SOURCE12} tar -xzf %{SOURCE13} %build VENDOR_PREFIX="$(pwd)/vendor" export PATH="$VENDOR_PREFIX/bin:$PATH" export PKG_CONFIG_PATH="$VENDOR_PREFIX/lib64/pkgconfig:$VENDOR_PREFIX/lib/pkgconfig:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig" export CMAKE_PREFIX_PATH="$VENDOR_PREFIX" # GCC 15 in Fedora 43 errors on zero-length arrays (generated by hyprwayland-scanner) GCC15_CXXFLAGS="%{optflags} -fpermissive" # 1) hyprwayland-scanner (build tool) pushd hyprwayland-scanner-%{hyprwayland_scanner_ver} cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$VENDOR_PREFIX" \ -DCMAKE_INSTALL_LIBDIR=lib64 cmake --build build --parallel %{_smp_build_ncpus} cmake --install build popd # 2) hyprutils pushd hyprutils-%{hyprutils_ver} cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$VENDOR_PREFIX" \ -DCMAKE_PREFIX_PATH="$VENDOR_PREFIX" -DCMAKE_INSTALL_LIBDIR=lib64 cmake --build build --parallel %{_smp_build_ncpus} cmake --install build popd # 3) hyprlang pushd hyprlang-%{hyprlang_ver} cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$VENDOR_PREFIX" \ -DCMAKE_PREFIX_PATH="$VENDOR_PREFIX" -DCMAKE_INSTALL_LIBDIR=lib64 cmake --build build --parallel %{_smp_build_ncpus} cmake --install build popd # 4) hyprland-protocols pushd hyprland-protocols-%{hyprland_protocols_ver} meson setup build --prefix="$VENDOR_PREFIX" ninja -C build ninja -C build install popd # 5) xdg-desktop-portal-hyprland # RUNPATH points to hyprland's vendor libs (installed by hyprland package) VENDOR_RPATH='%{_libexecdir}/hyprland/vendor/lib64:%{_libexecdir}/hyprland/vendor/lib' cmake -B build \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_PREFIX_PATH="$VENDOR_PREFIX" \ -Dhyprwayland-scanner_DIR="$VENDOR_PREFIX/lib64/cmake/hyprwayland-scanner" \ -DCMAKE_CXX_FLAGS="$GCC15_CXXFLAGS" \ -DCMAKE_INSTALL_RPATH="$VENDOR_RPATH" \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON cmake --build build --parallel %{_smp_build_ncpus} %install DESTDIR=%{buildroot} cmake --install build # Verify RPATH is set correctly echo "Verifying RPATH on installed binaries:" for bin in %{buildroot}%{_libexecdir}/xdg-desktop-portal-hyprland %{buildroot}%{_bindir}/hyprland-share-picker; do [ -x "$bin" ] || continue echo " $(basename $bin): $(readelf -d "$bin" 2>/dev/null | grep -E 'RPATH|RUNPATH' || echo 'no RPATH set')" done %files %license LICENSE %doc README.md # Portal daemon %{_libexecdir}/xdg-desktop-portal-hyprland # Share picker %{_bindir}/hyprland-share-picker # Portal config %{_datadir}/xdg-desktop-portal/portals/hyprland.portal # D-Bus service %{_datadir}/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service # Systemd user service (if installed) %{_userunitdir}/xdg-desktop-portal-hyprland.service %changelog * Sat Jan 03 2026 Asher Buk - 1.3.11-4 - Require hyprland >= 0.53.1 (patch release with bugfixes) * Sat Jan 03 2026 Asher Buk - 1.3.11-3 - Refactor: use %%global macros for all dependency versions * Wed Dec 31 2025 Asher Buk - 1.3.11-2 - Rebuild for Hyprland 0.53.0 compatibility - Update hyprland-protocols 0.6.4 -> 0.7.0 - Require hyprland >= 0.53.0 * Thu Dec 25 2025 Asher Buk - 1.3.11-1 - Initial package for Fedora 43 COPR - Built with RUNPATH pointing to hyprland vendor libs - Clean build without LD_LIBRARY_PATH hacks