Move libSDL2main to -devel and refresh split CMake target patch

Resolves: rhbz#2038390

Signed-off-by: Neal Gompa <ngompa@centosproject.org>
This commit is contained in:
Neal Gompa 2022-01-07 14:19:19 -05:00
parent 33fa831b30
commit adb26e3c33
2 changed files with 32 additions and 7 deletions

View File

@ -1,6 +1,6 @@
From 7393bdae70b445334157410f61372937b922cdc6 Mon Sep 17 00:00:00 2001 From f68563f1889a3786b74167bdbb286925ff7008be Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com> From: Neal Gompa <ngompa13@gmail.com>
Date: Tue, 4 Jan 2022 09:35:41 -0500 Date: Fri, 7 Jan 2022 13:56:36 -0500
Subject: [PATCH] cmake: Split SDL2-static and SDL2main into their own target Subject: [PATCH] cmake: Split SDL2-static and SDL2main into their own target
exports exports
@ -8,8 +8,9 @@ This makes it so that the generated targets are not interdependent,
which allows Linux distributions to split libraries into the which allows Linux distributions to split libraries into the
appropriate subpackages as needed. appropriate subpackages as needed.
--- ---
CMakeLists.txt | 56 +++++++++++++++++++++++++++++++++++++++----------- CMakeLists.txt | 56 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 44 insertions(+), 12 deletions(-) SDL2Config.cmake | 6 ++++++
2 files changed, 50 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76cc3c516..be15edc74 100644 index 76cc3c516..be15edc74 100644
@ -106,6 +107,21 @@ index 76cc3c516..be15edc74 100644
install( install(
FILES FILES
${CMAKE_CURRENT_SOURCE_DIR}/SDL2Config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/SDL2Config.cmake
diff --git a/SDL2Config.cmake b/SDL2Config.cmake
index 7c31469f1..831eab6e8 100644
--- a/SDL2Config.cmake
+++ b/SDL2Config.cmake
@@ -1,4 +1,10 @@
include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
+ include("${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
+endif()
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
+ include("${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
+endif()
# on static-only builds create an alias
if(NOT TARGET SDL2::SDL2 AND TARGET SDL2::SDL2-static)
-- --
2.33.1 2.33.1

View File

@ -10,7 +10,7 @@
Name: SDL2 Name: SDL2
Version: 2.0.18 Version: 2.0.18
Release: 1%{?dist} Release: 2%{?dist}
Summary: Cross-platform multimedia library Summary: Cross-platform multimedia library
License: zlib and MIT License: zlib and MIT
URL: http://www.libsdl.org/ URL: http://www.libsdl.org/
@ -87,6 +87,8 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: mesa-libEGL-devel%{?_isa} Requires: mesa-libEGL-devel%{?_isa}
Requires: mesa-libGLES-devel%{?_isa} Requires: mesa-libGLES-devel%{?_isa}
Requires: libX11-devel%{?_isa} Requires: libX11-devel%{?_isa}
# Conflict with versions before libSDLmain moved here
Conflicts: %{name}-static < 2.0.18-2
%description devel %description devel
Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed
@ -98,6 +100,8 @@ developing SDL applications.
Summary: Static libraries for SDL2 Summary: Static libraries for SDL2
# Needed to keep CMake happy # Needed to keep CMake happy
Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release}
# Conflict with versions before libSDLmain moved to -devel
Conflicts: %{name}-devel < 2.0.18-2
%description static %description static
Static libraries for SDL2. Static libraries for SDL2.
@ -156,20 +160,25 @@ install -p -m 644 %{SOURCE2} %{buildroot}%{_includedir}/SDL2/SDL_revision.h
%doc README.md TODO.txt WhatsNew.txt %doc README.md TODO.txt WhatsNew.txt
%{_bindir}/*-config %{_bindir}/*-config
%{_libdir}/lib*.so %{_libdir}/lib*.so
%{_libdir}/libSDL2main.a
%{_libdir}/pkgconfig/sdl2.pc %{_libdir}/pkgconfig/sdl2.pc
%dir %{_libdir}/cmake/SDL2 %dir %{_libdir}/cmake/SDL2
%{_libdir}/cmake/SDL2/SDL2Config*.cmake %{_libdir}/cmake/SDL2/SDL2Config*.cmake
%{_libdir}/cmake/SDL2/SDL2Targets*.cmake %{_libdir}/cmake/SDL2/SDL2Targets*.cmake
%{_libdir}/cmake/SDL2/SDL2mainTargets*.cmake
%{_includedir}/SDL2 %{_includedir}/SDL2
%{_datadir}/aclocal/* %{_datadir}/aclocal/*
%files static %files static
%license LICENSE.txt %license LICENSE.txt
%{_libdir}/lib*.a %{_libdir}/libSDL2.a
%{_libdir}/cmake/SDL2/SDL2mainTargets*.cmake
%{_libdir}/cmake/SDL2/SDL2staticTargets*.cmake %{_libdir}/cmake/SDL2/SDL2staticTargets*.cmake
%changelog %changelog
* Fri Jan 07 2022 Neal Gompa <ngompa@centosproject.org> - 2.0.18-2
- Move libSDL2main to -devel and refresh split CMake target patch
Resolves: rhbz#2038390
* Tue Jan 04 2022 Neal Gompa <ngompa@centosproject.org> - 2.0.18-1 * Tue Jan 04 2022 Neal Gompa <ngompa@centosproject.org> - 2.0.18-1
- Update to 2.0.18 - Update to 2.0.18
Resolves: rhbz#2028076 Resolves: rhbz#2028076