[apr] bump to 1.7.5 and did some imporvements, availible from this version of the library. (#40742)

This commit is contained in:
Timofei Zhakov 2024-09-03 20:51:48 +02:00 committed by GitHub
parent 136c521571
commit f7a181aa36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 40 additions and 70 deletions

View File

@ -1,62 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4632c3..0b86d12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -259,27 +259,35 @@ SET(install_targets)
SET(install_bin_pdb)
# libapr-1 is shared, apr-1 is static
+IF(BUILD_SHARED_LIBS)
ADD_LIBRARY(libapr-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc)
SET(install_targets ${install_targets} libapr-1)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-1.pdb)
TARGET_LINK_LIBRARIES(libapr-1 ${APR_SYSTEM_LIBS})
SET_TARGET_PROPERTIES(libapr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;WINNT")
ADD_DEPENDENCIES(libapr-1 test_char_header)
-
+TARGET_INCLUDE_DIRECTORIES(libapr-1 INTERFACE $<INSTALL_INTERFACE:include>)
+ELSE()
ADD_LIBRARY(apr-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
SET(install_targets ${install_targets} apr-1)
TARGET_LINK_LIBRARIES(apr-1 ${APR_SYSTEM_LIBS})
SET_TARGET_PROPERTIES(apr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;WINNT")
ADD_DEPENDENCIES(apr-1 test_char_header)
+TARGET_INCLUDE_DIRECTORIES(apr-1 INTERFACE $<INSTALL_INTERFACE:include>)
+ENDIF()
# libaprapp-1 and aprapp-1 are static
+IF(BUILD_SHARED_LIBS)
ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
SET(install_targets ${install_targets} libaprapp-1)
SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT")
-
+TARGET_INCLUDE_DIRECTORIES(libaprapp-1 INTERFACE $<INSTALL_INTERFACE:include>)
+ELSE()
ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
SET(install_targets ${install_targets} aprapp-1)
SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT")
+TARGET_INCLUDE_DIRECTORIES(aprapp-1 INTERFACE $<INSTALL_INTERFACE:include>)
+ENDIF()
IF(APR_BUILD_TESTAPR)
ENABLE_TESTING()
@@ -385,12 +393,18 @@ ENDIF (APR_BUILD_TESTAPR)
# Installation
-INSTALL(TARGETS ${install_targets}
+INSTALL(TARGETS ${install_targets} EXPORT unofficial-apr-config
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
+INSTALL(EXPORT unofficial-apr-config
+ NAMESPACE unofficial::apr::
+ DESTINATION share/unofficial-apr
+ FILE unofficial-apr-config.cmake
+)
+
IF(INSTALL_PDB)
INSTALL(FILES ${install_bin_pdb}
DESTINATION bin

View File

@ -1,16 +1,15 @@
set(VERSION 1.7.4)
set(VERSION 1.7.5)
vcpkg_download_distfile(ARCHIVE
URLS "https://archive.apache.org/dist/apr/apr-${VERSION}.tar.bz2"
FILENAME "apr-${VERSION}.tar.bz2"
SHA512 2342c997765ea2ca96eac158e5fd260232dba68fc41b90a79a7ba9b25c539fc217981867362090e0ebebe632289257c342275e3c5baedb698c474ef8f49a9dcd
SHA512 d8a7553642da0c81261ac3992536efd9d43ecb9154934ef1a10ae808d6a3ce8198b40433091d3a6d04f61e67c59426fb5276193a37e810ae4bc74a8a10fb651b
)
vcpkg_extract_source_archive(SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES
fix-configcmake.patch
unglue.patch
)
@ -20,9 +19,15 @@ if (VCPKG_TARGET_IS_WINDOWS)
private-headers APR_INSTALL_PRIVATE_H
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" APR_BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" APR_BUILD_SHARED)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DAPR_BUILD_STATIC=${APR_BUILD_STATIC}
-DAPR_BUILD_SHARED=${APR_BUILD_SHARED}
-DAPR_BUILD_TESTAPR=OFF
-DINSTALL_PDB=OFF
-DMIN_WINDOWS_VER=Windows7
-DAPR_HAVE_IPV6=ON
@ -30,7 +35,11 @@ if (VCPKG_TARGET_IS_WINDOWS)
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-apr CONFIG_PATH share/unofficial-apr)
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/apr")
file(
INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-apr-config.cmake"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-apr"
)
# There is no way to suppress installation of the headers in debug builds.
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

View File

@ -0,0 +1,19 @@
message(WARNING "find_package(unofficial-apr) is deprecated.\nUse find_package(apr) instead")
include(CMakeFindDependencyMacro)
find_dependency(apr CONFIG)
if(TARGET apr::apr-1 AND NOT TARGET unofficial::apr::apr-1)
add_library(unofficial::apr::apr-1 INTERFACE IMPORTED)
target_link_libraries(unofficial::apr::apr-1 INTERFACE apr::apr-1)
elseif(TARGET apr::libapr-1 AND NOT TARGET unofficial::apr::libapr-1)
add_library(unofficial::apr::libapr-1 INTERFACE IMPORTED)
target_link_libraries(unofficial::apr::libapr-1 INTERFACE apr::libapr-1)
endif()
if(TARGET apr::aprapp-1 AND NOT TARGET unofficial::apr::aprapp-1)
add_library(unofficial::apr::aprapp-1 INTERFACE IMPORTED)
target_link_libraries(unofficial::apr::aprapp-1 INTERFACE apr::aprapp-1)
elseif(TARGET apr::libaprapp-1 AND NOT TARGET unofficial::apr::libaprapp-1)
add_library(unofficial::apr::libaprapp-1 INTERFACE IMPORTED)
target_link_libraries(unofficial::apr::libaprapp-1 INTERFACE apr::libaprapp-1)
endif()

View File

@ -1,7 +1,6 @@
{
"name": "apr",
"version": "1.7.4",
"port-version": 1,
"version": "1.7.5",
"description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.",
"homepage": "https://apr.apache.org/",
"license": "Apache-2.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "da67695a8735bcfaed89792be1ea44176d9202a3",
"version": "1.7.5",
"port-version": 0
},
{
"git-tree": "9e28cc50d8877ee9c7a70e3fac694e562b4833da",
"version": "1.7.4",

View File

@ -165,8 +165,8 @@
"port-version": 0
},
"apr": {
"baseline": "1.7.4",
"port-version": 1
"baseline": "1.7.5",
"port-version": 0
},
"apr-util": {
"baseline": "1.6.3",