From 56eecd0a3db461255f94bb4196f6481c5f9bf633 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Thu, 27 Mar 2025 23:58:18 +0000 Subject: [PATCH] libevent: allow build with cmake-4.0.0 --- ...libevent-0001-build-with-cmake-4.0.0.patch | 59 +++++++++++++++++++ ...libevent-0002-build-with-cmake-4.0.0.patch | 58 ++++++++++++++++++ ...libevent-0003-build-with-cmake-4.0.0.patch | 23 ++++++++ ...libevent-0004-build-with-cmake-4.0.0.patch | 27 +++++++++ 4 files changed, 167 insertions(+) create mode 100644 packages/devel/libevent/patches/libevent-0001-build-with-cmake-4.0.0.patch create mode 100644 packages/devel/libevent/patches/libevent-0002-build-with-cmake-4.0.0.patch create mode 100644 packages/devel/libevent/patches/libevent-0003-build-with-cmake-4.0.0.patch create mode 100644 packages/devel/libevent/patches/libevent-0004-build-with-cmake-4.0.0.patch diff --git a/packages/devel/libevent/patches/libevent-0001-build-with-cmake-4.0.0.patch b/packages/devel/libevent/patches/libevent-0001-build-with-cmake-4.0.0.patch new file mode 100644 index 0000000000..f05079e043 --- /dev/null +++ b/packages/devel/libevent/patches/libevent-0001-build-with-cmake-4.0.0.patch @@ -0,0 +1,59 @@ +From bd2de4836b6b48d64da0cf010727209ad259a4f4 Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin +Date: Wed, 26 Jun 2019 00:59:41 +0300 +Subject: [PATCH] Require cmake >= 3.1.2 (for correct openssl 1.0.2 detection) + +@ygj6 reported: + "My platform is MacOS 10.13.5, This problem only happens on Mac. + + As written in the file CMakeLists.txt, the minimum required version of cmake is 3.1: + cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + So I built this project with cmake-3.1.0, but I got the following errors: + + CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:293 (list): + list GET given empty list + Call Stack (most recent call first): + CMakeLists.txt:824 (find_package) + + CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:294 (list): + list GET given empty list + Call Stack (most recent call first): + CMakeLists.txt:824 (find_package) + + CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:296 (list): + list GET given empty list + Call Stack (most recent call first): + CMakeLists.txt:824 (find_package) + + CMake Error at /usr/local/cmake-3.1.0/share/cmake/Modules/FindOpenSSL.cmake:298 (list): + list GET given empty list + Call Stack (most recent call first): + CMakeLists.txt:824 (find_package) + + I googled this error and got this answer: + https://bugs.archlinux.org/task/43688 + + It is a bug in FindOpenSSL.cmake on cmake-3.1.0 and fixed on cmake-3.1.2 . + Of course, It was successful when rebuilding with cmake-3.1.2 . + So I suggest setting the minimum version required for cmake to 3.1.2 or higher. + " + +Closes: #845 +Refs: https://github.com/Kitware/CMake/commit/de4ccee75a89519f95fcbcca75abc46577bfefea +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2089f832a..5aca8a9247 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ + # start libevent.sln + # + +-cmake_minimum_required(VERSION 3.1 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.1.2 FATAL_ERROR) + + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) diff --git a/packages/devel/libevent/patches/libevent-0002-build-with-cmake-4.0.0.patch b/packages/devel/libevent/patches/libevent-0002-build-with-cmake-4.0.0.patch new file mode 100644 index 0000000000..4d6d713abe --- /dev/null +++ b/packages/devel/libevent/patches/libevent-0002-build-with-cmake-4.0.0.patch @@ -0,0 +1,58 @@ +From acfac7ae4a3edbbb7ce4ceee7208b4245a6e203e Mon Sep 17 00:00:00 2001 +From: Ingo Bauersachs +Date: Thu, 1 Dec 2022 18:39:52 +0100 +Subject: [PATCH] Make dependency paths relocatable + +The generated configurations for both CMake and pkg-config included +absolute paths to dependencies (OpenSSL, MbedTLS). This is contrary +to the general CMake advise to create relocatable packages [1]. + +Additionally, when building both mbedtls and libevent via CMake's +FetchContent in the same project, loading the project would fail with + + INTERFACE_INCLUDE_DIRECTORIES property contains path: + "/home/user/project/cmake-build/_deps/mbedtls-build/include" + which is prefixed in the source directory. + +The required changes include: +- Adding the outer includes only to the BUILD_INTERFACE solves the + makes the CMake paths relocatable and thus solves the FetchContent + problem. +- Updates to libevent_*.pc.in fixes the relocatable issues for + pkg-config and properly declares currently missing dependencies. +- Using components for linking to OpenSSL (requiring CMake 3.4) + and MbedTLS. The new MbedTLS target names now match the component + names of the MbedTLS' CMake project. +- Use the Threads CMake library reference instead of a direct + reference to support both built-in pthread and -lpthread. + +v2 (azat): get back CMAKE_REQUIRED_LIBRARIES + +[1] https://cmake.org/cmake/help/v3.25/manual/cmake-packages.7.html#creating-relocatable-packages +--- + CMakeLists.txt | 28 +++++++++++----------------- + cmake/AddEventLibrary.cmake | 31 ++++++++++--------------------- + cmake/FindMbedTLS.cmake | 20 +++++++++++--------- + cmake/LibeventConfig.cmake.in | 21 ++++++++++++++++++--- + libevent_core.pc.in | 5 +---- + libevent_extra.pc.in | 6 ++---- + libevent_mbedtls.pc.in | 8 +++----- + libevent_openssl.pc.in | 9 ++++----- + libevent_pthreads.pc.in | 8 +++----- + test-export/CMakeLists.txt | 3 ++- + test-export/test-export.py | 18 ++++++++++++++++-- + 11 files changed, 81 insertions(+), 76 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7199ab820d..c0c1c2fa97 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ + # start libevent.sln + # + +-cmake_minimum_required(VERSION 3.1.2 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.4 FATAL_ERROR) + + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) diff --git a/packages/devel/libevent/patches/libevent-0003-build-with-cmake-4.0.0.patch b/packages/devel/libevent/patches/libevent-0003-build-with-cmake-4.0.0.patch new file mode 100644 index 0000000000..6e94631ecc --- /dev/null +++ b/packages/devel/libevent/patches/libevent-0003-build-with-cmake-4.0.0.patch @@ -0,0 +1,23 @@ +From a9426941555ec52b25c3641ebb8af72d7d91ebf8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?C=C5=93ur?= +Date: Sun, 28 Apr 2024 13:16:54 +0800 +Subject: [PATCH] Fix CMake Deprecation Warning + +--- + CMakeLists.txt | 2 +- + test-export/CMakeLists.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2ba64403ca..1869fccd2d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ + # start libevent.sln + # + +-cmake_minimum_required(VERSION 3.4 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + + if (POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default. diff --git a/packages/devel/libevent/patches/libevent-0004-build-with-cmake-4.0.0.patch b/packages/devel/libevent/patches/libevent-0004-build-with-cmake-4.0.0.patch new file mode 100644 index 0000000000..4fce606e16 --- /dev/null +++ b/packages/devel/libevent/patches/libevent-0004-build-with-cmake-4.0.0.patch @@ -0,0 +1,27 @@ +From 2d7a3b9b6a7c7ef0d651d866b4ab11fb1ea24664 Mon Sep 17 00:00:00 2001 +From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> +Date: Sat, 16 Nov 2024 21:26:55 +0000 +Subject: [PATCH] cmake: Update minimum required version + +Compatibility with versions of CMake older than 3.10 is now deprecated +and will be removed from a future version. + +See: https://cmake.org/cmake/help/v3.31/release/3.31.html +--- + CMakeLists.txt | 2 +- + test-export/CMakeLists.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25578930b4..04e6933bee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ + # start libevent.sln + # + +-cmake_minimum_required(VERSION 3.5 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.10 FATAL_ERROR) + + if (POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default.