aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen A. RedergÄrd <64542+kenr@users.noreply.github.com>2019-05-22 01:48:11 +0200
committerGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-05-21 16:48:11 -0700
commit75bcb1c131c601d1ce4bb8a5ec761e058a0faeab (patch)
treecdf91d369a369b76a024ed6441a6ca314366aa9a
parenta985f5b99def54b0729dbcaea89d7082b1089713 (diff)
downloadvcpkg-75bcb1c131c601d1ce4bb8a5ec761e058a0faeab.tar.gz
vcpkg-75bcb1c131c601d1ce4bb8a5ec761e058a0faeab.zip
[nrf-ble-driver] Initial version of nrf-ble-driver (#5938)
* Initial version of nrf-ble-driver * Add system dependencies message * Try to find git and add to path * Add status message to debug CI build * Remove status message; Add comments * Append instead of prepend to PATH * Enable x64-windows-static * Only show system dependencies message on mac and linux * Add arm64-windows support
-rw-r--r--ports/nrf-ble-driver/001-arm64-support.patch14
-rw-r--r--ports/nrf-ble-driver/CONTROL4
-rw-r--r--ports/nrf-ble-driver/portfile.cmake47
3 files changed, 65 insertions, 0 deletions
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 000000000..03cec37b6
--- /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 000000000..0386cede5
--- /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 000000000..8a642b144
--- /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