%global godot_version 4.6.1
%global godot_status stable
%global godot_zip_name Godot_v%{godot_version}-%{godot_status}_mono_linux_x86_64
%global godot_bin_name Godot_v%{godot_version}-%{godot_status}_mono_linux.x86_64
Name: godot-dotnet
Version: %{godot_version}
Release: 1%{?dist}
Summary: Godot Engine with .NET/C# support
License: MIT
URL: https://godotengine.org
Source0: https://github.com/godotengine/godot/releases/download/%{godot_version}-%{godot_status}/%{godot_zip_name}.zip
Source1: godot-dotnet.desktop
Source2: godot-dotnet.metainfo.xml
# We are repackaging upstream prebuilt binaries
# Disable debug package generation and binary stripping
%global debug_package %{nil}
%global __strip /bin/true
%global __brp_strip %{nil}
%global __brp_strip_comment_note %{nil}
%global __brp_strip_static_archive %{nil}
%global __brp_elfperms %{nil}
# Disable automatic dependency scanning — the bundled .NET assemblies
# would generate impossible-to-satisfy requires
AutoReq: no
AutoProv: no
BuildRequires: unzip
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
# Runtime dependencies for the Godot editor
Requires: dotnet-sdk-9.0
Requires: libX11
Requires: libXcursor
Requires: libXinerama
Requires: libXrandr
Requires: libXi
Requires: libGL
Requires: alsa-lib
Requires: pulseaudio-libs
Requires: vulkan-loader
# Conflict with the standard (non-.NET) Godot if packaged elsewhere
Conflicts: godot
ExclusiveArch: x86_64
%description
Godot Engine is a feature-packed, cross-platform game engine to create 2D and
3D games from a unified interface. This package includes the .NET build which
provides C# scripting support via the .NET runtime.
Godot is completely free and open source under the MIT license.
%prep
%setup -q -n %{godot_zip_name}
%build
# Nothing to build — upstream provides precompiled binaries
%install
# Install the Godot binary and GodotSharp data directory
install -d %{buildroot}/opt/godot-dotnet
install -m 0755 %{godot_bin_name} %{buildroot}/opt/godot-dotnet/godot-dotnet
cp -a GodotSharp %{buildroot}/opt/godot-dotnet/
# Create a symlink in /usr/bin
install -d %{buildroot}%{_bindir}
ln -s /opt/godot-dotnet/godot-dotnet %{buildroot}%{_bindir}/godot-dotnet
# Install the desktop entry
install -d %{buildroot}%{_datadir}/applications
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/godot-dotnet.desktop
# Install the icon (extract from the binary using a placeholder SVG for now)
install -d %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
cat > %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/godot-dotnet.svg << 'SVGEOF'
SVGEOF
# Install AppStream metainfo
install -d %{buildroot}%{_metainfodir}
install -m 0644 %{SOURCE2} %{buildroot}%{_metainfodir}/godot-dotnet.metainfo.xml
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/godot-dotnet.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/godot-dotnet.metainfo.xml
%files
%dir /opt/godot-dotnet
/opt/godot-dotnet/godot-dotnet
/opt/godot-dotnet/GodotSharp
%{_bindir}/godot-dotnet
%{_datadir}/applications/godot-dotnet.desktop
%{_datadir}/icons/hicolor/scalable/apps/godot-dotnet.svg
%{_metainfodir}/godot-dotnet.metainfo.xml
%changelog
* Fri Feb 27 2026 Sarah Dellysse - 4.6.1-1
- Initial package of Godot Engine .NET build 4.6.1-stable