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.

Resolves: rhbz#1989083
This commit is contained in:
Neal Gompa 2021-05-17 09:40:08 -04:00 committed by Wim Taymans
parent ec71ad38cb
commit c087e4e7e8

View File

@ -1,12 +1,6 @@
%if 0%{?rhel} >= 8
%bcond_with jack
%else
%bcond_without jack
%endif
Name: SDL2 Name: SDL2
Version: 2.0.14 Version: 2.0.14
Release: 5%{?dist} Release: 6%{?dist}
Summary: Cross-platform multimedia library Summary: Cross-platform multimedia library
License: zlib and MIT License: zlib and MIT
@ -18,8 +12,10 @@ Patch0: multilib.patch
# ptrdiff_t is not the same as khronos defines on 32bit arches # ptrdiff_t is not the same as khronos defines on 32bit arches
Patch1: SDL2-2.0.9-khrplatform.patch Patch1: SDL2-2.0.9-khrplatform.patch
BuildRequires: cmake
BuildRequires: make BuildRequires: make
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: alsa-lib-devel BuildRequires: alsa-lib-devel
BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLU-devel BuildRequires: mesa-libGLU-devel
@ -38,9 +34,7 @@ BuildRequires: systemd-devel
# PulseAudio # PulseAudio
BuildRequires: pkgconfig(libpulse-simple) BuildRequires: pkgconfig(libpulse-simple)
# Jack # Jack
%if %{with jack}
BuildRequires: pkgconfig(jack) BuildRequires: pkgconfig(jack)
%endif
# D-Bus # D-Bus
BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(dbus-1)
# IBus # IBus
@ -83,49 +77,40 @@ Static libraries for SDL2.
%prep %prep
%autosetup -p1 %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 sed -i -e 's/\r//g' TODO.txt README.txt WhatsNew.txt BUGS.txt COPYING.txt CREDITS.txt README-SDL.txt
%build %build
%configure \ # Deal with new CMake policy around whitespace in LDFLAGS...
--enable-sdl-dlopen \ export LDFLAGS="%{shrink:%{build_ldflags}}"
--enable-video-kmsdrm \
--disable-arts \ %cmake \
--disable-esd \ -DSDL_DLOPEN=ON \
--disable-nas \ -DVIDEO_KMSDRM=ON \
--enable-pulseaudio-shared \ -DARTS=OFF \
%if %{with jack} -DESD=OFF \
--enable-jack-shared \ -DNAS=OFF \
%else -DPULSEAUDIO_SHARED=ON \
--disable-jack \ -DJACK_SHARED=ON \
%endif -DALSA=ON \
--enable-alsa \ -DVIDEO_WAYLAND=ON \
--enable-video-wayland \ -DVIDEO_VULKAN=ON \
--enable-video-vulkan \ -DSSE3=OFF \
--enable-sse2=no \ -DRPATH=OFF \
--enable-sse3=no \ -DSDL_STATIC=ON \
--disable-rpath \
%ifarch ppc64le %ifarch ppc64le
--disable-altivec \ -DALTIVEC=OFF \
%endif %endif
%make_build %cmake_build
%install %install
%make_install %cmake_install
# Rename SDL_config.h to SDL_config-<arch>.h to avoid file conflicts on # Rename SDL_config.h to SDL_config-<arch>.h to avoid file conflicts on
# multilib systems and install SDL_config.h wrapper # multilib systems and install SDL_config.h wrapper
mv %{buildroot}%{_includedir}/SDL2/SDL_config.h %{buildroot}%{_includedir}/SDL2/SDL_config-%{_arch}.h 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 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 %files
%license COPYING.txt %license COPYING.txt
@ -146,6 +131,10 @@ rm -vf %{buildroot}%{_libdir}/*.la
%{_libdir}/lib*.a %{_libdir}/lib*.a
%changelog %changelog
* Thu Aug 26 2021 Neal Gompa <ngompa13@gmail.com> - 2.0.14-6
- Switch to CMake to build SDL2
- Build JACK support unconditionally since PipeWire-JACK exists in RHEL 9
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.14-5 * Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.14-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688 Related: rhbz#1991688