godot/godot.spec

177 lines
5.5 KiB
RPMSpec
Raw Permalink Normal View History

%global optflags %(echo %{optflags} | sed -e 's/-ffat-lto-objects//g' -e 's/-fvar-tracking-assignments//g')
2018-05-29 19:08:47 +10:00
%bcond_without server
2017-04-15 15:50:53 +02:00
%define status stable
%define uversion %{version}-%{status}
%define dversion 3.3-2ce76ff
2018-05-29 19:08:47 +10:00
2018-05-29 17:46:26 +10:00
%ifarch %{ix86}
2017-04-15 15:50:53 +02:00
%define arch 32
%else
%define arch 64
%endif
2018-05-29 17:46:26 +10:00
Summary: Multi-platform 2D and 3D game engine with a feature rich editor
Name: godot
Version: 3.3.2
2018-05-29 19:08:47 +10:00
Release: 1
2018-05-29 17:46:26 +10:00
License: MIT
Group: Games/Other
Url: https://godotengine.org
Source0: https://github.com/godotengine/godot/archive/%{uversion}/%{name}-%{uversion}.tar.gz
Source1: https://github.com/godotengine/godot-demo-projects/archive/%{dversion}/godot-demo-projects-%{dversion}.tar.gz
2018-05-29 19:08:47 +10:00
# Upstream fix for https://github.com/godotengine/godot/issues/17245
Patch0: 0001-SCons-Fix-linking-system-pcre2-on-server-platform.patch
# Upstream fix
Patch1: 0001-Dist-Fix-Linux-desktop-file-launch-argument.patch
2018-05-29 17:46:26 +10:00
BuildRequires: scons
BuildRequires: clang
BuildRequires: llvm
2018-05-29 17:46:26 +10:00
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(glew)
BuildRequires: pkgconfig(libpng)
2018-05-29 19:08:47 +10:00
BuildRequires: pkgconfig(libpcre2-32)
2018-05-29 17:46:26 +10:00
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(opus)
BuildRequires: pkgconfig(opusfile)
BuildRequires: pkgconfig(theora)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vorbisfile)
2018-05-29 19:08:47 +10:00
BuildRequires: pkgconfig(vpx)
2018-05-29 17:46:26 +10:00
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(zlib)
BuildRequires: %{_lib}atomic-static-devel
BuildRequires: stdc++-gcc10-devel
2018-05-29 17:46:26 +10:00
Suggests: %{name}-demos
2017-04-15 15:50:53 +02:00
%description
Godot is an advanced, feature packed, multi-platform 2D and 3D game engine.
It provides a huge set of common tools, so you can just focus on making
your game without reinventing the wheel.
Godot is completely free and open source under the very permissive MIT
license. No strings attached, no royalties, nothing. Your game is yours,
down to the last line of engine code.
%files
2018-05-29 19:08:47 +10:00
%doc LICENSE.txt README.md
%{_appdatadir}/godot.appdata.xml
2017-04-15 15:50:53 +02:00
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
2018-05-29 19:08:47 +10:00
%{_mandir}/man6/godot.6*
2017-04-15 15:50:53 +02:00
%{_iconsdir}/hicolor/scalable/apps/%{name}.svg
#----------------------------------------------------------------------
2018-05-29 17:46:26 +10:00
%package demos
Summary: Demo projects to learn how to use Godot Engine
Group: Games/Other
BuildArch: noarch
2017-04-15 15:50:53 +02:00
2018-05-29 17:46:26 +10:00
%description demos
2017-04-15 15:50:53 +02:00
This package contains the official demo projects to help new users to learn
the features of the game engine.
2018-05-29 17:46:26 +10:00
%files demos
2018-05-29 19:08:47 +10:00
%doc godot-demo-projects-%{dversion}/*.md
2017-04-15 15:50:53 +02:00
%{_datadir}/%{name}/demos/
#----------------------------------------------------------------------
%if %{with server}
2018-05-29 17:46:26 +10:00
%package server
Summary: Godot headless binary for servers
Group: Games/Other
2017-04-15 15:50:53 +02:00
2018-05-29 17:46:26 +10:00
%description server
2017-04-15 15:50:53 +02:00
This package contains the headless binary for the Godot game engine,
particularly suited for running dedicated servers.
2018-05-29 17:46:26 +10:00
%files server
2017-04-15 15:50:53 +02:00
%doc *.md
%{_bindir}/%{name}-server
%endif
#----------------------------------------------------------------------
2018-05-29 17:46:26 +10:00
%package runner
Summary: Shared binary to play games developed with the Godot engine
Group: Games/Other
2017-04-15 15:50:53 +02:00
2018-05-29 17:46:26 +10:00
%description runner
2017-04-15 15:50:53 +02:00
This package contains a godot-runner binary for the Linux X11 platform,
which can be used to run any game developed with the Godot engine simply
by pointing to the location of the game's data package.
2018-05-29 17:46:26 +10:00
%files runner
2018-05-29 19:08:47 +10:00
%doc LICENSE.txt README.md
2017-04-15 15:50:53 +02:00
%{_bindir}/%{name}-runner
#----------------------------------------------------------------------
%prep
%setup -qn %{name}-%{uversion} -a 1
#patch0 -p1
#patch1 -p1
2018-05-29 19:08:47 +10:00
# Windows-specific
rm -rf thirdparty/rtaudio
2017-04-15 15:50:53 +02:00
%build
# Needs to be in %%build so that system_libs stays in scope
2018-05-29 19:08:47 +10:00
# We don't unbundle enet and minizip as they have necessary custom changes
# We don't unbundle bullet yet as it needs a version newer than 2.87 (current stable)
# We don't unbundle zstd yet as it's using experimental APIs available only with static linking
to_unbundle="freetype libogg libpng libtheora libvorbis libvpx libwebp openssl opus pcre2 zlib"
2017-04-15 15:50:53 +02:00
system_libs=""
2018-05-29 19:08:47 +10:00
for lib in $to_unbundle; do
2017-04-15 15:50:53 +02:00
system_libs+="builtin_"$lib"=no "
rm -rf thirdparty/$lib
done
%define _scons %scons CCFLAGS="%{optflags} -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}" LINKFLAGS="%{ldflags} -lstdc++-gcc10" CC=clang CXX=clang++ $system_libs
2017-04-15 15:50:53 +02:00
2017-05-03 00:33:30 +03:00
export BUILD_REVISION="RosaLinuxRo"
2017-04-15 15:50:53 +02:00
# Build graphical editor (tools)
%_scons p=x11 tools=yes target=release_debug
# Build game runner (without tools)
%_scons p=x11 tools=no target=release
%if %{with server}
# Build headless version of the editor
%_scons p=server tools=yes target=release_debug
%endif
%install
install -d %{buildroot}%{_bindir}
install -m0755 bin/%{name}.x11.opt.tools.%{arch} %{buildroot}%{_bindir}/%{name}
install -m0755 bin/%{name}.x11.opt.%{arch} %{buildroot}%{_bindir}/%{name}-runner
%if %{with server}
install -m0755 bin/%{name}_server.server.opt.tools.%{arch} %{buildroot}%{_bindir}/%{name}-server
%endif
install -d %{buildroot}%{_datadir}/%{name}
2018-05-29 19:08:47 +10:00
cp -a godot-demo-projects-%{dversion} %{buildroot}%{_datadir}/%{name}/demos
2017-04-15 15:50:53 +02:00
install -D -m644 icon.svg \
%{buildroot}%{_iconsdir}/hicolor/scalable/apps/%{name}.svg
2018-05-29 19:08:47 +10:00
install -D -m644 misc/dist/linux/%{name}.desktop \
%{buildroot}%{_datadir}/applications/%{name}.desktop
install -D -m644 misc/dist/linux/%{name}.appdata.xml \
%{buildroot}%{_appdatadir}/%{name}.appdata.xml
install -D -m644 misc/dist/linux/%{name}.6 \
%{buildroot}%{_mandir}/man6/%{name}.6
2017-04-15 15:50:53 +02:00