diff --git a/.gitignore b/.gitignore index e69de29..3e64961 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/SDL3-3.2.0.tar.gz diff --git a/SDL3.spec b/SDL3.spec new file mode 100644 index 0000000..a7bc8fb --- /dev/null +++ b/SDL3.spec @@ -0,0 +1,206 @@ +# For the generated library symbol suffix +%if 0%{?__isa_bits} == 32 +%global libsymbolsuffix %{nil} +%else +%global libsymbolsuffix ()(%{__isa_bits}bit) +%endif + +# For declaring rich dependency on libdecor +%global libdecor_majver 0 + +%if 0%{?rhel} +# Disable static library on RHEL +%bcond_with static +%else +%bcond_without static +%endif + + +Name: SDL3 +Version: 3.2.0 +Release: 1%{?dist} +Summary: Cross-platform multimedia library +License: Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT) +URL: http://www.libsdl.org/ +Source0: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +Source1: SDL3_revision.h + +# Patches from upstream + +# Patches proposed upstream + + +BuildRequires: git-core +BuildRequires: cmake +BuildRequires: make +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: alsa-lib-devel +BuildRequires: mesa-libGL-devel +BuildRequires: mesa-libGLU-devel +BuildRequires: mesa-libEGL-devel +BuildRequires: mesa-libGLES-devel +BuildRequires: libXext-devel +BuildRequires: libX11-devel +BuildRequires: libXi-devel +BuildRequires: libXrandr-devel +BuildRequires: libXrender-devel +# While SDL3 supports this, Xwayland does not expose XScrnSaver. +# BuildRequires: libXScrnSaver-devel +BuildRequires: libXinerama-devel +BuildRequires: libXcursor-devel +BuildRequires: systemd-devel +# For building man pages +BuildRequires: perl-interpreter +BuildRequires: pkgconfig(libusb-1.0) +# PulseAudio +BuildRequires: pkgconfig(libpulse-simple) +# Jack +BuildRequires: pkgconfig(jack) +# PipeWire +BuildRequires: pkgconfig(libpipewire-0.3) +# D-Bus +BuildRequires: pkgconfig(dbus-1) +# IBus +BuildRequires: pkgconfig(ibus-1.0) +# Wayland +BuildRequires: pkgconfig(libdecor-%{libdecor_majver}) +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-egl) +BuildRequires: pkgconfig(wayland-cursor) +BuildRequires: pkgconfig(wayland-protocols) +BuildRequires: pkgconfig(wayland-scanner) +BuildRequires: pkgconfig(xkbcommon) +# Vulkan +BuildRequires: vulkan-devel +# KMS +BuildRequires: mesa-libgbm-devel +BuildRequires: libdrm-devel + +# Ensure libdecor is pulled in when libwayland-client is (rhbz#1992804) +Requires: (libdecor-%{libdecor_majver}.so.%{libdecor_majver}%{libsymbolsuffix} if libwayland-client) + +# Long ago forked hidraw customized for SDL +Provides: bundled(hidraw) + +%description +Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed +to provide fast access to the graphics frame buffer and audio device. + +%package devel +Summary: Files needed to develop Simple DirectMedia Layer applications +Requires: %{name}%{?_isa} = %{version}-%{release} +# Add deps required to compile SDL apps +## For SDL_opengl.h +Requires: pkgconfig(gl) +Requires: pkgconfig(glu) +## For SDL_syswm.h +Requires: pkgconfig(x11) +Requires: pkgconfig(xproto) +%if ! %{with static} +# Remove any leftover -static subpackages +Obsoletes: %{name}-static < %{version}-%{release} +%endif + +%description devel +Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed +to provide fast access to the graphics frame buffer and audio device. This +package provides the libraries, include files, and other resources needed for +developing SDL applications. + +%if %{with static} +%package static +Summary: Static libraries for SDL3 +# Needed to keep CMake happy +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description static +Static libraries for SDL3. +%endif + +%package test +Summary: Testing libraries for SDL3 +# Needed to keep CMake happy +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description test +Testing libraries for SDL3. + + +%prep +%autosetup -S git_am +sed -e 's/\r//g' -i README.md WhatsNew.txt BUGS.txt LICENSE.txt CREDITS.md + + +%build +# Deal with new CMake policy around whitespace in LDFLAGS... +export LDFLAGS="%{shrink:%{build_ldflags}}" + +%cmake \ + -DSDL_INSTALL_DOCS=ON \ + -DSDL_DLOPEN=ON \ + -DSDL_VIDEO_KMSDRM=ON \ + -DSDL_ARTS=OFF \ + -DSDL_ESD=OFF \ + -DSDL_NAS=OFF \ + -DSDL_PULSEAUDIO_SHARED=ON \ + -DSDL_JACK_SHARED=ON \ + -DSDL_PIPEWIRE_SHARED=ON \ + -DSDL_ALSA=ON \ + -DSDL_VIDEO_WAYLAND=ON \ + -DSDL_LIBDECOR_SHARED=ON \ + -DSDL_VIDEO_VULKAN=ON \ + -DSDL_SSE3=OFF \ + -DSDL_RPATH=OFF \ + %{?with_static:-DSDL_STATIC=ON} \ + %{?with_static:-DSDL_STATIC_PIC=ON} \ +%ifarch ppc64le + -DSDL_ALTIVEC=OFF \ +%endif + +%cmake_build + + +%install +%cmake_install + +# Rename SDL_revision.h to SDL_revision-.h to avoid file conflicts on +# multilib systems and install SDL_revision.h wrapper +# TODO: Figure out how in the hell the SDL_REVISION changes between architectures on the same SRPM. +mv %{buildroot}%{_includedir}/SDL3/SDL_revision.h %{buildroot}%{_includedir}/SDL3/SDL_revision-%{_arch}.h +install -p -m 644 %{SOURCE1} %{buildroot}%{_includedir}/SDL3/SDL_revision.h + + +%files +%license LICENSE.txt +%doc BUGS.txt CREDITS.md README.md +%{_libdir}/libSDL3.so.0{,.*} + +%files devel +%doc README.md WhatsNew.txt +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/sdl3.pc +%dir %{_libdir}/cmake/SDL3 +%{_libdir}/cmake/SDL3/SDL3Config*.cmake +%{_libdir}/cmake/SDL3/SDL3headersTargets*.cmake +%{_libdir}/cmake/SDL3/SDL3sharedTargets*.cmake +%{_includedir}/SDL3 +%{_mandir}/man3/SDL*.3* + +%if %{with static} +%files static +%license LICENSE.txt +%{_libdir}/libSDL3.a +%{_libdir}/cmake/SDL3/SDL3staticTargets*.cmake +%endif + +%files test +%license LICENSE.txt +%{_libdir}/libSDL3_test.a +%{_libdir}/cmake/SDL3/SDL3testTargets*.cmake + + +%changelog +* Fri Feb 07 2025 Wim Taymans - 3.2.0-1 + Initial commit on c10s + Resolves: RHEL-77078 diff --git a/SDL3_revision.h b/SDL3_revision.h new file mode 100644 index 0000000..c7997dc --- /dev/null +++ b/SDL3_revision.h @@ -0,0 +1,86 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + * This SDL_revision.h is a wrapper include file for the original SDL_revision.h, + * which has been renamed to SDL_revision-.h. There are conflicts for the + * original SDL_revision.h on multilib systems, which result from REVISION + * inconsistency between architecture builds, though, I'm not sure why. + * Computers are weird. + * + * Copyright (C) 2021 Tom Callaway + * Copyright (C) 2024 Neal Gompa + */ + +/** +* \file SDL_revision.h +* +* Header file containing the SDL revision. +*/ + +#ifdef SDL_revision_wrapper_h +#error "SDL_revision_wrapper_h should not be defined!" +#endif +#define SDL_revision_wrapper_h + +#if defined(__i386__) +#include "SDL_revision-i386.h" +#elif defined(__ia64__) +#include "SDL_revision-ia64.h" +#elif defined(__powerpc64__) +# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#include "SDL_revision-ppc64.h" +# else +#include "SDL_revision-ppc64le.h" +# endif +#elif defined(__powerpc__) +#include "SDL_revision-ppc.h" +#elif defined(__s390x__) +#include "SDL_revision-s390x.h" +#elif defined(__s390__) +#include "SDL_revision-s390.h" +#elif defined(__x86_64__) +#include "SDL_revision-x86_64.h" +#elif defined(__arm__) +#include "SDL_revision-arm.h" +#elif defined(__alpha__) +#include "SDL_revision-alpha.h" +#elif defined(__sparc__) && defined (__arch64__) +#include "SDL_revision-sparc64.h" +#elif defined(__sparc__) +#include "SDL_revision-sparc.h" +#elif defined(__aarch64__) +#include "SDL_revision-aarch64.h" +#elif defined(__mips64) && defined(__MIPSEL__) +#include "SDL_revision-mips64el.h" +#elif defined(__mips64) +#include "SDL_revision-mips64.h" +#elif defined(__mips) && defined(__MIPSEL__) +#include "SDL_revision-mipsel.h" +#elif defined(__mips) +#include "SDL_revision-mips.h" +#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 +#include "SDL_revision-riscv64.h" +#else +#error "The SDL3-devel package is not usable with the architecture." +#endif + +#undef SDL_revision_wrapper_h diff --git a/sources b/sources new file mode 100644 index 0000000..a60c13a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (SDL3-3.2.0.tar.gz) = b7722883e83cc609b0696f3b9459724912b53fbe6132ea63ad0b302f0821ff79e9497a8d7ad522854c88d6a6607fc5edec88a8f8c3d6f748f9e313b4e84b9b32