diff --git a/ports/nrf-ble-driver/001-arm64-support.patch b/ports/nrf-ble-driver/001-arm64-support.patch new file mode 100644 index 00000000000000..03cec37b62d778 --- /dev/null +++ b/ports/nrf-ble-driver/001-arm64-support.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 99daa24..9a18ee5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -259,6 +259,9 @@ endforeach(SD_API_VER) + # Additional special linkage libraries + foreach(SD_API_VER ${SD_API_VERS}) + if(WIN32) ++ # arm64-windows support ++ target_link_libraries(${NRF_BLE_DRIVER_${SD_API_VER}_STATIC_LIB} PRIVATE "advapi32") ++ target_link_libraries(${NRF_BLE_DRIVER_${SD_API_VER}_SHARED_LIB} PRIVATE "advapi32") + elseif(APPLE) + target_link_libraries(${NRF_BLE_DRIVER_${SD_API_VER}_STATIC_LIB} PRIVATE "-framework CoreFoundation" "-framework IOKit") + target_link_libraries(${NRF_BLE_DRIVER_${SD_API_VER}_SHARED_LIB} PRIVATE "-framework CoreFoundation" "-framework IOKit") diff --git a/ports/nrf-ble-driver/CONTROL b/ports/nrf-ble-driver/CONTROL new file mode 100644 index 00000000000000..0386cede51aaf4 --- /dev/null +++ b/ports/nrf-ble-driver/CONTROL @@ -0,0 +1,4 @@ +Source: nrf-ble-driver +Version: 4.1.0 +Description: BLE driver is a library for Bluetooth Low Energy communication using Nordic Semiconductor development kits. +Build-Depends: asio, catch2 \ No newline at end of file diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake new file mode 100644 index 00000000000000..8a642b144bad3b --- /dev/null +++ b/ports/nrf-ble-driver/portfile.cmake @@ -0,0 +1,47 @@ +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + message( + "nrf-ble-driver currently requires the following libraries from the system package manager: + libudev-dev + These can be installed on Ubuntu systems via sudo apt install libudev-dev" + ) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO NordicSemiconductor/pc-ble-driver + REF v4.1.0 + SHA512 f8a995826caf4022f68b149d0f3619d1d656e3960a927eda29c634bf06cad8341c95a5b51ec7e50b28814f5332a4800faf88eb5b4e8ebec153f9cad05b3a703e + HEAD_REF master + PATCHES + 001-arm64-support.patch +) + +# Ensure that git is found within CMakeLists.txt by appending vcpkg's git executable dirpath to $PATH. +# Git should always be available as it is downloaded during the bootstrap phase. +# Append instead of prepend to $PATH to honor the user's git executable as a general rule. +find_program(GIT NAMES git git.cmd) +get_filename_component(GIT_EXE_DIRPATH "${GIT}" DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${GIT_EXE_DIRPATH}") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DDISABLE_EXAMPLES= -DDISABLE_TESTS= -DNRF_BLE_DRIVER_VERSION=4.1.0 -DCONNECTIVITY_VERSION=4.1.0 +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) +file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file