From 51a1c8271262fb1d89affe0c61f3c7c3f112bcd0 Mon Sep 17 00:00:00 2001
From: Neal Gompa <[EMAIL REDACTED]>
Date: Sun, 6 Apr 2025 17:09:40 -0400
Subject: [PATCH] Revert "Rename sdl2-compat.pc to sdl2.pc (#446)"
This is unnecessary, given that everyone uses pkgconf(1), which
fully supports the "Provides:" stanza and expresses it in dependencies.
The issue mentioned in the commit being reverted is a matter of
education.
This reverts commit 0bc8d4434fb911973762230bbcf4529f39fb8912.
---
CMakeLists.txt | 4 ++--
cmake/test/test_pkgconfig.sh | 6 +++---
sdl2.pc.in => sdl2-compat.pc.in | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
rename sdl2.pc.in => sdl2-compat.pc.in (81%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e284a148..312d4e97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -599,8 +599,8 @@ if(SDL2COMPAT_INSTALL)
set(ENABLE_SHARED_TRUE "")
set(ENABLE_SHARED_FALSE "#")
- configure_file(sdl2.pc.in sdl2.pc @ONLY)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sdl2.pc"
+ configure_file(sdl2-compat.pc.in sdl2-compat.pc @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sdl2-compat.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
diff --git a/cmake/test/test_pkgconfig.sh b/cmake/test/test_pkgconfig.sh
index e75c1cb0..3abf96b7 100755
--- a/cmake/test/test_pkgconfig.sh
+++ b/cmake/test/test_pkgconfig.sh
@@ -30,10 +30,10 @@ fi
# Get the canonical path of the folder containing this script
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
-SDL_CFLAGS="$( pkg-config sdl2 --cflags )"
-SDL_LDFLAGS="$( pkg-config sdl2 --libs )"
+SDL_CFLAGS="$( pkg-config sdl2-compat --cflags )"
+SDL_LDFLAGS="$( pkg-config sdl2-compat --libs )"
if [ "x$test_static" = "xyes" ]; then
- SDL_STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )"
+ SDL_STATIC_LDFLAGS="$( pkg-config sdl2-compat --libs --static )"
fi
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS"
diff --git a/sdl2.pc.in b/sdl2-compat.pc.in
similarity index 81%
rename from sdl2.pc.in
rename to sdl2-compat.pc.in
index 34817077..d337137c 100644
--- a/sdl2.pc.in
+++ b/sdl2-compat.pc.in
@@ -8,7 +8,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: sdl2_compat
Description: An SDL2 compatibility layer that uses SDL3 behind the scenes.
Version: @PROJECT_VERSION@
-Provides: sdl2 = @PROJECT_VERSION@, sdl2-compat = @PROJECT_VERSION@, sdl2_compat = @PROJECT_VERSION@
+Provides: sdl2 = @PROJECT_VERSION@
Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
@ENABLE_STATIC_TRUE@Libs.private: @SDL_STATIC_LIBS@
Cflags: -I${includedir} -I${includedir}/SDL2 @SDL_CFLAGS@