From 59fa2d653f0960664fcb97988486717aed4b1969 Mon Sep 17 00:00:00 2001 From: jim wang <122244446+jimwang118@users.noreply.github.com> Date: Thu, 27 Jul 2023 01:49:03 +0800 Subject: [PATCH] [log4cpp] Change to official upstream source (#31736) --- ports/log4cpp-log4cpp/fix_link_msvcrt.patch | 31 ++++++++ ports/log4cpp-log4cpp/portfile.cmake | 79 +++++++++++++++++++++ ports/log4cpp-log4cpp/vcpkg.json | 13 ++++ ports/log4cpp/Fix-StaticSupport.patch | 26 ------- ports/log4cpp/fix-export-targets.patch | 18 ----- ports/log4cpp/fix-includepath.patch | 31 -------- ports/log4cpp/fix-install-targets.patch | 13 ---- ports/log4cpp/log4cpp-config.in.cmake | 7 -- ports/log4cpp/portfile.cmake | 35 --------- ports/log4cpp/vcpkg.json | 18 ----- versions/baseline.json | 6 +- versions/l-/log4cpp-log4cpp.json | 9 +++ 12 files changed, 135 insertions(+), 151 deletions(-) create mode 100644 ports/log4cpp-log4cpp/fix_link_msvcrt.patch create mode 100644 ports/log4cpp-log4cpp/portfile.cmake create mode 100644 ports/log4cpp-log4cpp/vcpkg.json delete mode 100644 ports/log4cpp/Fix-StaticSupport.patch delete mode 100644 ports/log4cpp/fix-export-targets.patch delete mode 100644 ports/log4cpp/fix-includepath.patch delete mode 100644 ports/log4cpp/fix-install-targets.patch delete mode 100644 ports/log4cpp/log4cpp-config.in.cmake delete mode 100644 ports/log4cpp/portfile.cmake delete mode 100644 ports/log4cpp/vcpkg.json create mode 100644 versions/l-/log4cpp-log4cpp.json diff --git a/ports/log4cpp-log4cpp/fix_link_msvcrt.patch b/ports/log4cpp-log4cpp/fix_link_msvcrt.patch new file mode 100644 index 0000000000..7e08edc008 --- /dev/null +++ b/ports/log4cpp-log4cpp/fix_link_msvcrt.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 140910b..08cde3b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -81,8 +81,12 @@ ADD_LIBRARY ( ${LOG4CPP_LIBRARY_NAME} + ) + + IF (WIN32) +- TARGET_LINK_LIBRARIES (${LOG4CPP_LIBRARY_NAME} kernel32 user32 ws2_32 advapi32 ) +- SET_TARGET_PROPERTIES(${LOG4CPP_LIBRARY_NAME} PROPERTIES LINK_FLAGS /NODEFAULTLIB:msvcrt ) ++ TARGET_LINK_LIBRARIES (${LOG4CPP_LIBRARY_NAME} kernel32 user32 ws2_32 advapi32) ++ IF ( CMAKE_BUILD_TYPE MATCHES "Debug" ) ++ SET_TARGET_PROPERTIES(${LOG4CPP_LIBRARY_NAME} PROPERTIES LINK_FLAGS /NODEFAULTLIB:MSVCRT) ++ ELSE(CMAKE_BUILD_TYPE MATCHES "Debug" ) ++ SET_TARGET_PROPERTIES(${LOG4CPP_LIBRARY_NAME} PROPERTIES LINK_FLAGS /NODEFAULTLIB:MSVCRTD) ++ ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug" ) + ENDIF (WIN32) + + INSTALL ( +@@ -92,9 +96,11 @@ INSTALL ( + PATTERN ".svn" EXCLUDE + PATTERN "*.am" EXCLUDE + PATTERN "*.in" EXCLUDE ++ PATTERN ".cvsignore" EXCLUDE + ) + + INSTALL ( + TARGETS ${LOG4CPP_LIBRARY_NAME} + ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin + ) diff --git a/ports/log4cpp-log4cpp/portfile.cmake b/ports/log4cpp-log4cpp/portfile.cmake new file mode 100644 index 0000000000..bab255afe0 --- /dev/null +++ b/ports/log4cpp-log4cpp/portfile.cmake @@ -0,0 +1,79 @@ +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO log4cpp/log4cpp-1.1.x%20%28new%29 + REF log4cpp-1.1 + FILENAME "log4cpp-1.1.4.tar.gz" + SHA512 0cdbd46ccd048d70bea3c35d22080dc5dd21fc3b9c415fe464847e60775954f57e9c8344506f0f94f16e90e8bdaa9cc6d84d3aa65191501e52ee8dfc639f0398 + PATCHES + fix_link_msvcrt.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_cmake_install() + vcpkg_copy_pdbs() + + set(VCPKG_POLICY_DLLS_WITHOUT_EXPORTS enabled) + set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib" "${CURRENT_PACKAGES_DIR}/lib") + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") + endif() +elseif(VCPKG_TARGET_IS_LINUX) + #message(STATUS "Configuring ${TARGET_TRIPLET}") + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(SHARED_STATIC --enable-static --disable-shared) + else() + set(SHARED_STATIC --disable-static --enable-shared) + endif() + + set(OPTIONS ${SHARED_STATIC}) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + set(CFLAGS "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG} -fPIC -O0 -g -I${SOURCE_PATH}/include") + set(LDFLAGS "${VCPKG_LINKER_FLAGS}") + #create makefile + vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME configure-${TARGET_TRIPLET}-dbg) + + message(STATUS "Building ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND make -j install "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME install-${TARGET_TRIPLET}-dbg + ) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + + #build release log4cpp + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + set(CFLAGS "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE} -fPIC -O3 -I${SOURCE_PATH}/include") + set(LDFLAGS "${VCPKG_LINKER_FLAGS}") + vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME configure-${TARGET_TRIPLET}-rel + ) + message(STATUS "Building ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND make -j install "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME install-${TARGET_TRIPLET}-rel + ) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + endif() + vcpkg_fixup_pkgconfig() +endif() + +# Handle copyright +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/log4cpp-log4cpp/vcpkg.json b/ports/log4cpp-log4cpp/vcpkg.json new file mode 100644 index 0000000000..d6c1188857 --- /dev/null +++ b/ports/log4cpp-log4cpp/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "log4cpp-log4cpp", + "version": "1.1.4", + "description": "A library of C++ classes for flexible logging to files (rolling), syslog, IDSA and other destinations. It is modeled after the Log for Java library (http://www.log4j.org), staying as close to their API as is reasonable.", + "homepage": "https://sourceforge.net/projects/log4cpp/", + "supports": "(linux | windows) & !uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/ports/log4cpp/Fix-StaticSupport.patch b/ports/log4cpp/Fix-StaticSupport.patch deleted file mode 100644 index 8053b4ce50..0000000000 --- a/ports/log4cpp/Fix-StaticSupport.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 529c18e..beace9e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -21,7 +21,11 @@ SET(LOG4CPP_LIBS) - - IF (WIN32) - SET (CMAKE_DEBUG_POSTFIX "d") -- LIST(APPEND LOG4CPP_CFLAGS -D_CRT_SECURE_NO_WARNINGS -DLOG4CPP_HAS_DLL -DLOG4CPP_BUILD_DLL ) -+ IF (BUILD_SHARED_LIBS) -+ LIST(APPEND LOG4CPP_CFLAGS -D_CRT_SECURE_NO_WARNINGS -DLOG4CPP_HAS_DLL -DLOG4CPP_BUILD_DLL ) -+ ELSE () -+ LIST(APPEND LOG4CPP_CFLAGS -D_CRT_SECURE_NO_WARNINGS ) -+ ENDIF () - ELSE (WIN32) - IF (APPLE) - # LIST(APPEND LOG4CPP_CFLAGS -DLOG4CPP_HAVE_SSTREAM) -@@ -32,7 +36,7 @@ ENDIF (WIN32) - - SET ( LOG4CPP_LIBRARY_NAME "orocos-log4cpp" ) - --ADD_LIBRARY ( ${LOG4CPP_LIBRARY_NAME} SHARED -+ADD_LIBRARY ( ${LOG4CPP_LIBRARY_NAME} - src/Appender.cpp - src/AppenderSkeleton.cpp - src/AppendersFactory.cpp diff --git a/ports/log4cpp/fix-export-targets.patch b/ports/log4cpp/fix-export-targets.patch deleted file mode 100644 index 30b5320cde..0000000000 --- a/ports/log4cpp/fix-export-targets.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 19767a0..59dbf6c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -161,11 +161,13 @@ INSTALL ( - ) - - INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} -+ EXPORT log4cpp-targets - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin) - - INSTALL(FILES package.xml DESTINATION share/log4cpp) -+INSTALL(EXPORT log4cpp-targets NAMESPACE log4cpp:: DESTINATION share/log4cpp) - - ########################################################### - # DOCUMENTATION diff --git a/ports/log4cpp/fix-includepath.patch b/ports/log4cpp/fix-includepath.patch deleted file mode 100644 index 2fdac90fe8..0000000000 --- a/ports/log4cpp/fix-includepath.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index beace9e..c8264ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -136,7 +136,7 @@ SET(prefix "${CMAKE_INSTALL_PREFIX}") - SET(exec_prefix "\${prefix}") - SET(log4cpp_cflags "") - SET(log4cpp_libs "${LOG4CPP_LIBS}") --SET(includedir "\${prefix}/include/orocos") -+SET(includedir "\${prefix}/include") - SET(libdir "\${prefix}/lib") - CONFIGURE_FILE(log4cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos-log4cpp.pc @ONLY) - -@@ -147,7 +147,7 @@ INSTALL( - - INSTALL ( - DIRECTORY include/log4cpp -- DESTINATION include/orocos -+ DESTINATION include - PATTERN "config.h.in" EXCLUDE - PATTERN ".svn" EXCLUDE - PATTERN "*.am" EXCLUDE -@@ -157,7 +157,7 @@ INSTALL ( - - INSTALL ( - FILES ${CMAKE_CURRENT_BINARY_DIR}/include/log4cpp/config.h -- DESTINATION include/orocos/log4cpp -+ DESTINATION include/log4cpp - ) - - INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} diff --git a/ports/log4cpp/fix-install-targets.patch b/ports/log4cpp/fix-install-targets.patch deleted file mode 100644 index 49cdedf1d9..0000000000 --- a/ports/log4cpp/fix-install-targets.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8db2287..529c18e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -159,7 +159,7 @@ INSTALL ( - INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -- RUNTIME DESTINATION lib) -+ RUNTIME DESTINATION bin) - - INSTALL(FILES package.xml DESTINATION share/log4cpp) - diff --git a/ports/log4cpp/log4cpp-config.in.cmake b/ports/log4cpp/log4cpp-config.in.cmake deleted file mode 100644 index cdecd4b70b..0000000000 --- a/ports/log4cpp/log4cpp-config.in.cmake +++ /dev/null @@ -1,7 +0,0 @@ - -if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32) - include(CMakeFindDependencyMacro) - find_dependency(Threads) -endif() - -include(${CMAKE_CURRENT_LIST_DIR}/log4cpp-targets.cmake) diff --git a/ports/log4cpp/portfile.cmake b/ports/log4cpp/portfile.cmake deleted file mode 100644 index dd203758a7..0000000000 --- a/ports/log4cpp/portfile.cmake +++ /dev/null @@ -1,35 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO orocos-toolchain/log4cpp - REF v2.9.1 - SHA512 5bd222c820a15c5d96587ac9fe864c3e2dc0fbce8389692be8dd41553ac0308002ad8d6f4ef3ef10af1d796f8ded410788d1a5d22f15505fac639da3f73e3518 - HEAD_REF master - PATCHES - fix-install-targets.patch - Fix-StaticSupport.patch - fix-includepath.patch - fix-export-targets.patch -) - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" -) - -vcpkg_cmake_install() - -vcpkg_fixup_pkgconfig() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -vcpkg_cmake_config_fixup(CONFIG_PATH share/${PORT}) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") - -vcpkg_copy_pdbs() - -configure_file( - "${CMAKE_CURRENT_LIST_DIR}/log4cpp-config.in.cmake" - "${CURRENT_PACKAGES_DIR}/share/${PORT}/log4cpp-config.cmake" - @ONLY -) - -# Handle copyright -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/log4cpp/vcpkg.json b/ports/log4cpp/vcpkg.json deleted file mode 100644 index 52ed6df72d..0000000000 --- a/ports/log4cpp/vcpkg.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "log4cpp", - "version": "2.9.1", - "port-version": 8, - "description": "Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled after the Log4j Java library, staying as close to their API as is reasonable.", - "homepage": "https://github.com/orocos-toolchain/log4cpp", - "supports": "!uwp", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/versions/baseline.json b/versions/baseline.json index aa28d6d8b5..1e3701760f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5020,9 +5020,9 @@ "baseline": "2.0.7", "port-version": 1 }, - "log4cpp": { - "baseline": "2.9.1", - "port-version": 8 + "log4cpp-log4cpp": { + "baseline": "1.1.4", + "port-version": 0 }, "log4cxx": { "baseline": "1.0.0", diff --git a/versions/l-/log4cpp-log4cpp.json b/versions/l-/log4cpp-log4cpp.json new file mode 100644 index 0000000000..3b25e0790a --- /dev/null +++ b/versions/l-/log4cpp-log4cpp.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "3ac5e6e898eeac3db01d2f9c70bc4df663e035f2", + "version": "1.1.4", + "port-version": 0 + } + ] +}