diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/lcm | |
Diffstat (limited to 'vcpkg/ports/lcm')
| -rw-r--r-- | vcpkg/ports/lcm/avoid-fake-stdint-h.patch | 24 | ||||
| -rw-r--r-- | vcpkg/ports/lcm/disable-docs.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/lcm/fix-build-error.patch | 32 | ||||
| -rw-r--r-- | vcpkg/ports/lcm/glib.link.patch | 30 | ||||
| -rw-r--r-- | vcpkg/ports/lcm/only-install-one-flavor.patch | 19 | ||||
| -rw-r--r-- | vcpkg/ports/lcm/portfile.cmake | 51 | ||||
| -rw-r--r-- | vcpkg/ports/lcm/vcpkg.json | 23 |
7 files changed, 191 insertions, 0 deletions
diff --git a/vcpkg/ports/lcm/avoid-fake-stdint-h.patch b/vcpkg/ports/lcm/avoid-fake-stdint-h.patch new file mode 100644 index 0000000..7290c6a --- /dev/null +++ b/vcpkg/ports/lcm/avoid-fake-stdint-h.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 90833e3..2b7cff8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,7 +17,6 @@ include(lcm-cmake/version.cmake) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + if (WIN32) + add_definitions(-DWIN32 -D_CRT_SECURE_NO_WARNINGS) +- include_directories(${lcm_SOURCE_DIR}/WinSpecific/include) + include_directories(${lcm_SOURCE_DIR}/WinSpecific/getopt) + include_directories(${lcm_SOURCE_DIR}) + add_subdirectory(WinSpecific) +diff --git a/lcm-python/setup.py b/lcm-python/setup.py +index e015d20..2528d9f 100644 +--- a/lcm-python/setup.py ++++ b/lcm-python/setup.py +@@ -47,7 +47,6 @@ if os.name == 'nt': + sys.exit('GLIB_PATH environment variable not set.') + + include_dirs += [ \ +- os.path.join("..", "WinSpecific\include"), + os.path.join("..", "WinSpecific"), + os.path.join(glibPath, "include", "glib-2.0"), + os.path.join(glibPath, "lib", "glib-2.0", "include") ] diff --git a/vcpkg/ports/lcm/disable-docs.patch b/vcpkg/ports/lcm/disable-docs.patch new file mode 100644 index 0000000..c69b903 --- /dev/null +++ b/vcpkg/ports/lcm/disable-docs.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d3a4c2..90833e3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,7 +39,6 @@ if(LCM_ENABLE_EXAMPLES) + endif() + + # Documentation (Main, C/C++, .NET) +-add_subdirectory(docs) + + # Java + lcm_option( diff --git a/vcpkg/ports/lcm/fix-build-error.patch b/vcpkg/ports/lcm/fix-build-error.patch new file mode 100644 index 0000000..ffca33d --- /dev/null +++ b/vcpkg/ports/lcm/fix-build-error.patch @@ -0,0 +1,32 @@ +diff --git a/lcm/windows/WinPorting.cpp b/lcm/windows/WinPorting.cpp +index e22acd6..b9c7e69 100644 +--- a/lcm/windows/WinPorting.cpp ++++ b/lcm/windows/WinPorting.cpp +@@ -1,8 +1,8 @@ + + #define _WIN32_WINNT 0x0501 +-#include <Mswsock.h> + #include <stdio.h> + #include <winsock2.h> ++#include <Mswsock.h> + + #include "WinPorting.h" + +diff --git a/lcmgen/emit_go.c b/lcmgen/emit_go.c +index c520044..b5be56a 100644 +--- a/lcmgen/emit_go.c ++++ b/lcmgen/emit_go.c +@@ -6,8 +6,13 @@ + #include <stdio.h> + #include <stdlib.h> + #include <string.h> ++#ifdef WIN32 ++#include <io.h> ++#else + #include <unistd.h> ++#endif + #ifdef WIN32 ++#define F_OK 0 + #define __STDC_FORMAT_MACROS // Enable integer types + #endif + diff --git a/vcpkg/ports/lcm/glib.link.patch b/vcpkg/ports/lcm/glib.link.patch new file mode 100644 index 0000000..4808fe7 --- /dev/null +++ b/vcpkg/ports/lcm/glib.link.patch @@ -0,0 +1,30 @@ +diff --git a/cmake/FindGLib2.cmake b/cmake/FindGLib2.cmake +index 2f1a8be45..db823b953 100644 +--- a/cmake/FindGLib2.cmake ++++ b/cmake/FindGLib2.cmake +@@ -14,7 +14,7 @@ function(_glib2_find_include VAR HEADER) + + find_path(GLIB2_${VAR}_INCLUDE_DIR ${HEADER} + PATHS ${_paths} +- PATH_SUFFIXES glib-2.0 glib-2.0/include ++ PATH_SUFFIXES glib-2.0 glib-2.0/include lib/glib-2.0/include + ) + mark_as_advanced(GLIB2_${VAR}_INCLUDE_DIR) + endfunction() +@@ -108,6 +108,16 @@ foreach(_glib2_component ${GLib2_FIND_COMPONENTS}) + + endforeach() + ++find_library(PCRE_LIBRARY pcre2-8) ++set_property(TARGET GLib2::glib APPEND PROPERTY ++ INTERFACE_LINK_LIBRARIES ${PCRE_LIBRARY} ++) ++set(THREADS_PREFER_PTHREAD_FLAG ON) ++find_package(Threads) ++set_property(TARGET GLib2::glib APPEND PROPERTY ++ INTERFACE_LINK_LIBRARIES Threads::Threads ++) ++ + list(APPEND GLib2_FIND_COMPONENTS glib) + set(GLib2_FIND_REQUIRED_glib TRUE) + diff --git a/vcpkg/ports/lcm/only-install-one-flavor.patch b/vcpkg/ports/lcm/only-install-one-flavor.patch new file mode 100644 index 0000000..d22b83c --- /dev/null +++ b/vcpkg/ports/lcm/only-install-one-flavor.patch @@ -0,0 +1,19 @@ +diff --git a/lcm/CMakeLists.txt b/lcm/CMakeLists.txt
+index a706a85..639ec12 100644
+--- a/lcm/CMakeLists.txt
++++ b/lcm/CMakeLists.txt
+@@ -76,8 +76,12 @@ endif()
+ target_include_directories(lcm-coretypes INTERFACE
+ $<BUILD_INTERFACE:${lcm_SOURCE_DIR}>
+ )
+-
+-install(TARGETS lcm-coretypes lcm-static lcm
++if(BUILD_SHARED_LIBS)
++ set(INSTALL_TARGETS lcm)
++else()
++ set(INSTALL_TARGETS lcm-static)
++endif()
++install(TARGETS lcm-coretypes ${INSTALL_TARGETS}
+ EXPORT lcmTargets
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
diff --git a/vcpkg/ports/lcm/portfile.cmake b/vcpkg/ports/lcm/portfile.cmake new file mode 100644 index 0000000..be6a4ce --- /dev/null +++ b/vcpkg/ports/lcm/portfile.cmake @@ -0,0 +1,51 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO lcm-proj/lcm + REF v1.4.0 + SHA512 ca036aa2c31911e0bfaeab9665188c97726201267314693a1c333c4efe13ea598b39a55a19bc1d48e65462ac9d1716adfda5af86c645d59c3247192631247cc6 + HEAD_REF master + PATCHES + only-install-one-flavor.patch + fix-build-error.patch + glib.link.patch + disable-docs.patch + avoid-fake-stdint-h.patch # https://github.com/lcm-proj/lcm/pull/563 +) + +# Remove fake stdint.h that conficts with the real one in VS2022 17.13 targeting arm64 +file(REMOVE "${SOURCE_PATH}/WinSpecific/include/inttypes.h" "${SOURCE_PATH}/WinSpecific/include/stdint.h") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DLCM_ENABLE_JAVA=OFF + -DLCM_ENABLE_LUA=OFF + -DLCM_ENABLE_PYTHON=OFF + -DLCM_ENABLE_GO=OFF + -DLCM_ENABLE_TESTS=OFF + -DLCM_ENABLE_EXAMPLES=OFF + -DLCM_INSTALL_M4MACROS=OFF + -DLCM_INSTALL_PKGCONFIG=OFF +) + +vcpkg_cmake_install() +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_cmake_config_fixup(CONFIG_PATH cmake) +else() + vcpkg_cmake_config_fixup(CONFIG_PATH lib/lcm/cmake) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/lcm" "${CURRENT_PACKAGES_DIR}/lib/lcm") +endif() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man") + +vcpkg_copy_tools(TOOL_NAMES lcm-gen lcm-logger lcm-logplayer AUTO_CLEAN) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/lcm/vcpkg.json b/vcpkg/ports/lcm/vcpkg.json new file mode 100644 index 0000000..7538e5c --- /dev/null +++ b/vcpkg/ports/lcm/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "lcm", + "version": "1.4.0", + "port-version": 7, + "description": [ + "Lightweight Communications and Marshalling (LCM)", + "LCM is a set of libraries and tools for message passing and data marshalling, targeted at real-time systems where high-bandwidth and low latency are critical. It provides a publish/subscribe message passing model and automatic marshalling/unmarshalling code generation with bindings for applications in a variety of programming languages." + ], + "homepage": "https://github.com/lcm-proj/lcm", + "license": "LGPL-2.1-or-later", + "supports": "!osx & !xbox", + "dependencies": [ + "glib", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |