From 17470d5e9df757d9c51b507669bd200646ae4d27 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 4 Apr 2024 07:33:51 -0400 Subject: [PATCH] Update to uncrustify 0.78.1 (#37) * Update to uncrustify 0.78.1 * Fix the uncrustify version detection logic. And make sure we are at least 0.78. Signed-off-by: Chris Lalancette --- CMakeLists.txt | 6 +- ...implify-installation-for-ROS-2-needs.patch | 51 ++++++++++++++++ patches/0001-install-patch.diff | 59 ------------------- 3 files changed, 54 insertions(+), 62 deletions(-) create mode 100644 patches/0001-Simplify-installation-for-ROS-2-needs.patch delete mode 100644 patches/0001-install-patch.diff diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d0d4db..ddbe2ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,8 @@ function(check_uncrustify RESULT PROGRAM) set(${RESULT} FALSE PARENT_SCOPE) else() # Before 0.65 uncrustify used a different versioning scheme so the regex won't match - string(REGEX REPLACE "^Uncrustify-(.*)_f$" "\\1" version_prefix_match "${out}") - if(NOT version_prefix_match OR version_prefix_match VERSION_LESS 0.72) + string(REGEX REPLACE "^Uncrustify(_d|)-(.*)_f$" "\\2" version_prefix_match "${out}") + if(NOT version_prefix_match OR version_prefix_match VERSION_LESS 0.78) set(${RESULT} FALSE PARENT_SCOPE) endif() endif() @@ -31,7 +31,7 @@ endif() ament_vendor(uncrustify_vendor SATISFIED ${UNCRUSTIFY} VCS_URL https://github.com/uncrustify/uncrustify.git - VCS_VERSION uncrustify-0.72.0 + VCS_VERSION uncrustify-0.78.1 PATCHES patches CMAKE_ARGS -DNoGitVersionString=ON diff --git a/patches/0001-Simplify-installation-for-ROS-2-needs.patch b/patches/0001-Simplify-installation-for-ROS-2-needs.patch new file mode 100644 index 0000000..5046d2e --- /dev/null +++ b/patches/0001-Simplify-installation-for-ROS-2-needs.patch @@ -0,0 +1,51 @@ +From 5409b03b54deb1416d90ccfa150d059f05d7761a Mon Sep 17 00:00:00 2001 +From: Chris Lalancette +Date: Wed, 3 Apr 2024 09:29:24 -0400 +Subject: [PATCH] Simplify installation for ROS 2 needs. + +Signed-off-by: Chris Lalancette +--- + CMakeLists.txt | 22 +--------------------- + 1 file changed, 1 insertion(+), 21 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6a48dae0e..a9a3eecfe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -520,32 +520,12 @@ include(CPack) + # Install + # + if(MSVC) +- install(TARGETS uncrustify DESTINATION ".") +- install(FILES ${uncrustify_docs} +- DESTINATION "." +- ) +- install(FILES "${PROJECT_SOURCE_DIR}/documentation/htdocs/index.html" +- DESTINATION "doc" +- ) +- install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/" +- DESTINATION "cfg" +- FILES_MATCHING PATTERN "*.cfg" +- ) ++ install(TARGETS uncrustify RUNTIME DESTINATION bin) + else() + include(GNUInstallDirs) + install(TARGETS uncrustify + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/uncrustify.1" +- DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" +- ) +- install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/" +- DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples" +- FILES_MATCHING PATTERN "*.cfg" +- ) +- install(FILES ${uncrustify_docs} +- DESTINATION "${CMAKE_INSTALL_DOCDIR}" +- ) + endif() + + # +-- +2.44.0 + diff --git a/patches/0001-install-patch.diff b/patches/0001-install-patch.diff deleted file mode 100644 index 91535e7..0000000 --- a/patches/0001-install-patch.diff +++ /dev/null @@ -1,59 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index db0a6bfb..26ccf1a5 100644 ---- a/CMakeLists.txt 2021-12-10 16:10:01.557816597 -0500 -+++ b/CMakeLists.txt 2021-12-10 16:11:16.521464522 -0500 -@@ -500,32 +500,33 @@ - # Install - # - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") -- install(TARGETS uncrustify DESTINATION ".") -- install(FILES ${uncrustify_docs} -- DESTINATION "." -- ) -- install(FILES "${PROJECT_SOURCE_DIR}/documentation/htdocs/index.html" -- DESTINATION "doc" -- ) -- install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/" -- DESTINATION "cfg" -- FILES_MATCHING PATTERN "*.cfg" -- ) -+ install(TARGETS uncrustify RUNTIME DESTINATION bin) -+ # install(TARGETS uncrustify DESTINATION ".") -+ # install(FILES ${uncrustify_docs} -+ # DESTINATION "." -+ # ) -+ # install(FILES "${PROJECT_SOURCE_DIR}/documentation/htdocs/index.html" -+ # DESTINATION "doc" -+ # ) -+ # install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/" -+ # DESTINATION "cfg" -+ # FILES_MATCHING PATTERN "*.cfg" -+ # ) - else() - include(GNUInstallDirs) - install(TARGETS uncrustify - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - ) -- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/uncrustify.1" -- DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" -- ) -- install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/" -- DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples" -- FILES_MATCHING PATTERN "*.cfg" -- ) -- install(FILES ${uncrustify_docs} -- DESTINATION "${CMAKE_INSTALL_DOCDIR}" -- ) -+ # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/uncrustify.1" -+ # DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" -+ # ) -+ # install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/" -+ # DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples" -+ # FILES_MATCHING PATTERN "*.cfg" -+ # ) -+ # install(FILES ${uncrustify_docs} -+ # DESTINATION "${CMAKE_INSTALL_DOCDIR}" -+ # ) - endif() - - #