From 104dfc214cb0fdf928f17df6b6cdfc2ede148f13 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Mon, 17 May 2021 09:40:08 -0400 Subject: [PATCH] Switch to CMake to build SDL2 and always build JACK support Upstream increasingly prefers CMake for building SDL, so switch to that. Additionally, let's always build JACK support since PipeWire in RHEL 9 provides libjack. --- SDL2.spec | 65 +++++++++++++++++++++++-------------------------------- 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/SDL2.spec b/SDL2.spec index 7253bbe..319a588 100644 --- a/SDL2.spec +++ b/SDL2.spec @@ -1,12 +1,6 @@ -%if 0%{?rhel} >= 8 -%bcond_with jack -%else -%bcond_without jack -%endif - Name: SDL2 Version: 2.0.14 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Cross-platform multimedia library License: zlib and MIT @@ -18,8 +12,10 @@ Patch0: multilib.patch # ptrdiff_t is not the same as khronos defines on 32bit arches Patch1: SDL2-2.0.9-khrplatform.patch +BuildRequires: cmake BuildRequires: make BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: alsa-lib-devel BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGLU-devel @@ -38,9 +34,7 @@ BuildRequires: systemd-devel # PulseAudio BuildRequires: pkgconfig(libpulse-simple) # Jack -%if %{with jack} BuildRequires: pkgconfig(jack) -%endif # D-Bus BuildRequires: pkgconfig(dbus-1) # IBus @@ -83,49 +77,40 @@ Static libraries for SDL2. %prep %autosetup -p1 -# Compilation without ESD -sed -i -e 's/.*AM_PATH_ESD.*//' configure.ac sed -i -e 's/\r//g' TODO.txt README.txt WhatsNew.txt BUGS.txt COPYING.txt CREDITS.txt README-SDL.txt %build -%configure \ - --enable-sdl-dlopen \ - --enable-video-kmsdrm \ - --disable-arts \ - --disable-esd \ - --disable-nas \ - --enable-pulseaudio-shared \ -%if %{with jack} - --enable-jack-shared \ -%else - --disable-jack \ -%endif - --enable-alsa \ - --enable-video-wayland \ - --enable-video-vulkan \ - --enable-sse2=no \ - --enable-sse3=no \ - --disable-rpath \ +# Deal with new CMake policy around whitespace in LDFLAGS... +export LDFLAGS="%{shrink:%{build_ldflags}}" + +%cmake \ + -DSDL_DLOPEN=ON \ + -DVIDEO_KMSDRM=ON \ + -DARTS=OFF \ + -DESD=OFF \ + -DNAS=OFF \ + -DPULSEAUDIO_SHARED=ON \ + -DJACK_SHARED=ON \ + -DALSA=ON \ + -DVIDEO_WAYLAND=ON \ + -DVIDEO_VULKAN=ON \ + -DSSE3=OFF \ + -DRPATH=OFF \ + -DSDL_STATIC=ON \ %ifarch ppc64le - --disable-altivec \ + -DALTIVEC=OFF \ %endif -%make_build +%cmake_build %install -%make_install +%cmake_install # Rename SDL_config.h to SDL_config-.h to avoid file conflicts on # multilib systems and install SDL_config.h wrapper mv %{buildroot}%{_includedir}/SDL2/SDL_config.h %{buildroot}%{_includedir}/SDL2/SDL_config-%{_arch}.h install -p -m 644 %{SOURCE1} %{buildroot}%{_includedir}/SDL2/SDL_config.h -# remove libtool .la file -rm -vf %{buildroot}%{_libdir}/*.la -# remove static .a file -# rm -f %{buildroot}%{_libdir}/*.a - -%ldconfig_scriptlets %files %license COPYING.txt @@ -146,6 +131,10 @@ rm -vf %{buildroot}%{_libdir}/*.la %{_libdir}/lib*.a %changelog +* Mon May 17 2021 Neal Gompa - 2.0.14-4 +- Switch to CMake to build SDL2 +- Build JACK support unconditionally since PipeWire-JACK exists in RHEL 9 + * Mon Feb 22 2021 Hans de Goede - 2.0.14-3 - SDL2 no longer uses audiofile, drop the audiofile-devel BuildRequires