From 42e186e8fd3b869638b2a6f1007ebf161d28f20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken=20A=2E=20Rederg=C3=A5rd?= <64542+kenr@users.noreply.github.com> Date: Fri, 18 Jan 2019 14:39:04 +0100 Subject: [PATCH 1/9] Initial version of nrf-ble-driver --- ports/nrf-ble-driver/CONTROL | 4 ++++ ports/nrf-ble-driver/portfile.cmake | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ports/nrf-ble-driver/CONTROL create mode 100644 ports/nrf-ble-driver/portfile.cmake 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..17464173ff53c4 --- /dev/null +++ b/ports/nrf-ble-driver/portfile.cmake @@ -0,0 +1,26 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO NordicSemiconductor/pc-ble-driver + REF v4.1.0 + SHA512 f8a995826caf4022f68b149d0f3619d1d656e3960a927eda29c634bf06cad8341c95a5b51ec7e50b28814f5332a4800faf88eb5b4e8ebec153f9cad05b3a703e + HEAD_REF master +) + +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) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file From b7c97bbf564d059b76d3b3be064bc325b9c275c0 Mon Sep 17 00:00:00 2001 From: grdowns Date: Tue, 23 Apr 2019 14:48:10 -0700 Subject: [PATCH 2/9] Add system dependencies message --- ports/nrf-ble-driver/portfile.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index 17464173ff53c4..235a3f1a921215 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -1,5 +1,11 @@ include(vcpkg_common_functions) +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" +) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO NordicSemiconductor/pc-ble-driver From eaf6a72f458109e8f9f28cc0d60d6a376d4d3419 Mon Sep 17 00:00:00 2001 From: Griffin Downs Date: Tue, 14 May 2019 14:29:31 -0700 Subject: [PATCH 3/9] Try to find git and add to path --- ports/nrf-ble-driver/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index 235a3f1a921215..d9a5747b8c15ce 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -14,6 +14,10 @@ vcpkg_from_github( HEAD_REF master ) +find_program(GIT NAMES git git.cmd) +get_filename_component(GIT_EXE_PATH "${GIT}" DIRECTORY) +vcpkg_add_to_path("${GIT_EXE_PATH}") + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA From 9a9f2f305b4ff4f612ebfd06ef8fce8870fc0ca2 Mon Sep 17 00:00:00 2001 From: Griffin Downs Date: Wed, 15 May 2019 11:32:27 -0700 Subject: [PATCH 4/9] Add status message to debug CI build --- ports/nrf-ble-driver/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index d9a5747b8c15ce..86f6ee1ec0f888 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_from_github( ) find_program(GIT NAMES git git.cmd) +message(STATUS "HEREHEREHEREHEREHERE GIT path is: ${GIT}") get_filename_component(GIT_EXE_PATH "${GIT}" DIRECTORY) vcpkg_add_to_path("${GIT_EXE_PATH}") From 4a796031af8f8ff15cae83145f7186d4194634f8 Mon Sep 17 00:00:00 2001 From: Griffin Downs Date: Wed, 15 May 2019 14:19:19 -0700 Subject: [PATCH 5/9] Remove status message; Add comments --- ports/nrf-ble-driver/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index 86f6ee1ec0f888..e1aba0e1b34919 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -14,8 +14,10 @@ vcpkg_from_github( HEAD_REF master ) +# 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) -message(STATUS "HEREHEREHEREHEREHERE GIT path is: ${GIT}") get_filename_component(GIT_EXE_PATH "${GIT}" DIRECTORY) vcpkg_add_to_path("${GIT_EXE_PATH}") From e67f1170e649add04d3a61af23c391eaa6730015 Mon Sep 17 00:00:00 2001 From: Griffin Downs Date: Wed, 15 May 2019 14:25:53 -0700 Subject: [PATCH 6/9] Append instead of prepend to PATH --- ports/nrf-ble-driver/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index e1aba0e1b34919..e5b784a4679580 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -18,8 +18,8 @@ vcpkg_from_github( # 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_PATH "${GIT}" DIRECTORY) -vcpkg_add_to_path("${GIT_EXE_PATH}") +get_filename_component(GIT_EXE_DIRPATH "${GIT}" DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${GIT_EXE_DIRPATH}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} From f33afca3f4fc0ae3e6c2e377ee06097005ffcf72 Mon Sep 17 00:00:00 2001 From: Griffin Downs Date: Wed, 15 May 2019 15:32:42 -0700 Subject: [PATCH 7/9] Enable x64-windows-static --- ports/nrf-ble-driver/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index e5b784a4679580..9732107c048754 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -36,4 +36,8 @@ 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 From bd9d3cd7ef6b29a227167c322aee63ead0d52f20 Mon Sep 17 00:00:00 2001 From: Griffin Downs Date: Tue, 21 May 2019 15:20:01 -0700 Subject: [PATCH 8/9] Only show system dependencies message on mac and linux --- ports/nrf-ble-driver/portfile.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ports/nrf-ble-driver/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index 9732107c048754..b2e355eca6ca2d 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -1,10 +1,12 @@ include(vcpkg_common_functions) -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" -) +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 From eb57c852fc74889859521c08f01f41c85f1c27af Mon Sep 17 00:00:00 2001 From: Griffin Downs Date: Tue, 21 May 2019 15:51:58 -0700 Subject: [PATCH 9/9] Add arm64-windows support --- ports/nrf-ble-driver/001-arm64-support.patch | 14 ++++++++++++++ ports/nrf-ble-driver/portfile.cmake | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 ports/nrf-ble-driver/001-arm64-support.patch 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/portfile.cmake b/ports/nrf-ble-driver/portfile.cmake index b2e355eca6ca2d..8a642b144bad3b 100644 --- a/ports/nrf-ble-driver/portfile.cmake +++ b/ports/nrf-ble-driver/portfile.cmake @@ -14,6 +14,8 @@ vcpkg_from_github( 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.