File wesnoth-cmake-fix-find-readline.patch of Package wesnoth
diff -Nur wesnoth-1.17.12-orig/cmake/FindReadline.cmake wesnoth-1.17.12/cmake/FindReadline.cmake
--- wesnoth-1.17.12-orig/cmake/FindReadline.cmake 1970-01-01 01:00:00.000000000 +0100
+++ wesnoth-1.17.12/cmake/FindReadline.cmake 2023-02-03 17:22:14.082627810 +0100
@@ -0,0 +1,47 @@
+# - Try to find readline include dirs and libraries
+#
+# Usage of this module as follows:
+#
+# find_package(Readline)
+#
+# Variables used by this module, they can change the default behaviour and need
+# to be set before calling find_package:
+#
+# Readline_ROOT_DIR Set this variable to the root installation of
+# readline if the module has problems finding the
+# proper installation path.
+#
+# Variables defined by this module:
+#
+# READLINE_FOUND System has readline, include and lib dirs found
+# Readline_INCLUDE_DIR The readline include directories.
+# Readline_LIBRARY The readline library.
+
+find_path(Readline_ROOT_DIR
+ NAMES include/readline/readline.h
+ )
+
+find_path(Readline_INCLUDE_DIR
+ NAMES readline/readline.h
+ HINTS ${Readline_ROOT_DIR}/include
+ )
+
+find_library(Readline_LIBRARY
+ NAMES readline
+ HINTS ${Readline_ROOT_DIR}/lib
+ )
+
+if (Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY)
+ set(READLINE_FOUND TRUE)
+else (Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY)
+ FIND_LIBRARY(Readline_LIBRARY NAMES readline)
+ include(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY)
+ MARK_AS_ADVANCED(Readline_INCLUDE_DIR Readline_LIBRARY)
+endif (Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY)
+
+mark_as_advanced(
+ Readline_ROOT_DIR
+ Readline_INCLUDE_DIR
+ Readline_LIBRARY
+)
diff -Nur wesnoth-1.17.12-orig/CMakeLists.txt wesnoth-1.17.12/CMakeLists.txt
--- wesnoth-1.17.12-orig/CMakeLists.txt 2023-01-15 01:27:55.000000000 +0100
+++ wesnoth-1.17.12/CMakeLists.txt 2023-02-03 17:23:18.942981085 +0100
@@ -491,6 +491,7 @@
find_package(VorbisFile REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Fontconfig REQUIRED)
+ find_package(Readline REQUIRED)
find_package(SDL2 2.0.10 REQUIRED)
if(NOT MSVC)
# for everything else, use pkgconfig
@@ -506,7 +507,6 @@
pkg_check_modules(CAIRO REQUIRED cairo>=1.10)
pkg_check_modules(PANGOCAIRO REQUIRED pangocairo>=1.44.0)
pkg_check_modules(PANGO REQUIRED pango>=1.44.0)
- pkg_check_modules(LIBREADLINE readline)
endif()
if(ENABLE_TESTS)