Files
source-stack/debian13/libevent-lib-x86_64-linux-gnu-install.patch
T
GuofangandClaude Sonnet 5 52ea874506 Fetch debian13 sources via curl and unify libs under lib/x86_64-linux-gnu
Mirrors rocky9's curl-based fetching and consistent-libdir goals but
adapted to Debian's own conventions: replaces git clone with curl
tarball downloads (matching rocky9's URLs), drops sha256sum checks, and
installs every vendored library under /usr/local/lib/x86_64-linux-gnu
instead of rocky9's lib64.

lib64 was tried first but abandoned: on Debian, CMake's find_package()
Config-mode search, find_library(), and pkg-config's default search
path all detect /etc/debian_version and never look in lib64 (that's an
RHEL-only default), so cross-package lookups like spdlog finding fmt
or folly's FindLibEvent.cmake kept failing. lib/x86_64-linux-gnu is
Debian's native multiarch path and is found by all three mechanisms
with no extra CMAKE_PREFIX_PATH/PKG_CONFIG_PATH workarounds, verified
by building the full image end to end.

libevent-lib64-install.patch is renamed and retargeted at
lib/x86_64-linux-gnu since libevent hardcodes "lib" in its CMake
install rules with no override flag. CacheLib keeps building its
default interface/cachebench targets (no patch needed here, unlike
rocky9).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UV2yJRkL6CnChX3D2zhoXH
2026-09-17 16:48:53 +08:00

60 lines
2.3 KiB
Diff

diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake
--- a/cmake/AddEventLibrary.cmake 2026-09-17 14:40:01.091049579 +0800
+++ b/cmake/AddEventLibrary.cmake 2026-09-17 14:40:01.103049846 +0800
@@ -31,7 +31,7 @@
configure_file("lib${LIB_NAME}.pc.in" "lib${LIB_NAME}.pc" @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${LIB_NAME}.pc"
- DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig"
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/x86_64-linux-gnu/pkgconfig"
)
endmacro()
@@ -40,9 +40,9 @@
macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES)
if("${LIB_NAME}" STREQUAL "event")
install(TARGETS "${LIB_NAME}_${TYPE}"
- LIBRARY DESTINATION "lib" COMPONENT lib
- ARCHIVE DESTINATION "lib" COMPONENT lib
- RUNTIME DESTINATION "lib" COMPONENT lib
+ LIBRARY DESTINATION "lib/x86_64-linux-gnu" COMPONENT lib
+ ARCHIVE DESTINATION "lib/x86_64-linux-gnu" COMPONENT lib
+ RUNTIME DESTINATION "lib/x86_64-linux-gnu" COMPONENT lib
COMPONENT dev
)
else()
@@ -67,9 +67,9 @@
)
install(TARGETS "${LIB_NAME}_${TYPE}"
EXPORT LibeventTargets-${TYPE}
- LIBRARY DESTINATION "lib" COMPONENT lib
- ARCHIVE DESTINATION "lib" COMPONENT lib
- RUNTIME DESTINATION "lib" COMPONENT lib
+ LIBRARY DESTINATION "lib/x86_64-linux-gnu" COMPONENT lib
+ ARCHIVE DESTINATION "lib/x86_64-linux-gnu" COMPONENT lib
+ RUNTIME DESTINATION "lib/x86_64-linux-gnu" COMPONENT lib
COMPONENT dev
)
endif()
@@ -181,7 +181,7 @@
if (NOT WIN32)
install(FILES
"$<TARGET_FILE_DIR:${LIB_NAME}_shared>/${LIB_LINK_NAME}"
- DESTINATION "lib"
+ DESTINATION "lib/x86_64-linux-gnu"
COMPONENT lib)
endif()
endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2026-09-17 14:40:01.091049579 +0800
+++ b/CMakeLists.txt 2026-09-17 14:40:01.103049846 +0800
@@ -1453,7 +1453,7 @@
#
set(EVENT_INSTALL_CMAKE_DIR
- "${CMAKE_INSTALL_PREFIX}/lib/cmake/libevent")
+ "${CMAKE_INSTALL_PREFIX}/lib/x86_64-linux-gnu/cmake/libevent")
export(PACKAGE libevent)