From fc5134c3a24a3622d0bc056d6bdd4c9a7c51a327 Mon Sep 17 00:00:00 2001 From: Sean Yen Date: Tue, 14 Jan 2020 12:28:06 -0800 Subject: [PATCH] [soem] Add new port (#9572) * initial SOEM port. * don't use the vendored winpcap. * removed the unused flag. * addressed feedback. * addressed feedback. --- ports/soem/CONTROL | 5 +++++ ports/soem/portfile.cmake | 29 +++++++++++++++++++++++++++++ ports/soem/winpcap.patch | 23 +++++++++++++++++++++++ scripts/ci.baseline.txt | 2 ++ 4 files changed, 59 insertions(+) create mode 100644 ports/soem/CONTROL create mode 100644 ports/soem/portfile.cmake create mode 100644 ports/soem/winpcap.patch diff --git a/ports/soem/CONTROL b/ports/soem/CONTROL new file mode 100644 index 0000000000..f3194a53bc --- /dev/null +++ b/ports/soem/CONTROL @@ -0,0 +1,5 @@ +Source: soem +Version: 1.4.0 +Homepage: https://github.com/OpenEtherCATsociety/SOEM +Description: Simple Open Source EtherCAT Master +Build-Depends: winpcap (windows) diff --git a/ports/soem/portfile.cmake b/ports/soem/portfile.cmake new file mode 100644 index 0000000000..3eccfeb3a1 --- /dev/null +++ b/ports/soem/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO OpenEtherCATsociety/SOEM + REF abbf0d42e38d6cfbaa4c1e9e8e07ace651c386fd #v1.4.0 + SHA512 2967775c6746bb63becea5eb12f136c184bbf874e1e5e8753374bfc212ec9cefbf1159350e79627b978af3562d261b61c50f38936a425c4d9c70598a1d136817 + HEAD_REF master + PATCHES + winpcap.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin + ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/soem/winpcap.patch b/ports/soem/winpcap.patch new file mode 100644 index 0000000000..215226e6f5 --- /dev/null +++ b/ports/soem/winpcap.patch @@ -0,0 +1,23 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -13,15 +13,13 @@ + + if(WIN32) + set(OS "win32") +- include_directories(oshw/win32/wpcap/Include) +- if(CMAKE_SIZEOF_VOID_P EQUAL 8) +- link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib/x64) +- elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) +- link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib) +- endif() ++ find_path(winpcap_INCLUDE_DIRS NAMES pcap.h) ++ find_library(winpcap_LIBRARY NAMES wpcap) ++ find_library(packet_LIBRARY NAMES packet) ++ include_directories(${winpcap_INCLUDE_DIRS}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_NO_WARNINGS") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") +- set(OS_LIBS wpcap.lib Packet.lib Ws2_32.lib Winmm.lib) ++ set(OS_LIBS ${winpcap_LIBRARY} ${packet_LIBRARY} Ws2_32.lib Winmm.lib) + elseif(UNIX AND NOT APPLE) + set(OS "linux") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 7ad3e9c87d..bc83397a03 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1562,6 +1562,8 @@ smpeg2:x64-linux=fail smpeg2:x64-uwp=fail soci:arm-uwp=fail soci:x64-uwp=fail +soem:x64-uwp=fail +soem:arm-uwp=fail soil:arm-uwp=fail soil:x64-uwp=fail soil2:arm-uwp=fail