mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 05:03:03 +08:00
[treehopper] Fix dependency handling of libusb (#35480)
This commit is contained in:
parent
ec05fe4a59
commit
f30434939d
42
ports/treehopper/fix-dependences.patch
Normal file
42
ports/treehopper/fix-dependences.patch
Normal file
@ -0,0 +1,42 @@
|
||||
diff --git a/C++/API/CMakeLists.txt b/C++/API/CMakeLists.txt
|
||||
index 8537305..db3d29b 100644
|
||||
--- a/C++/API/CMakeLists.txt
|
||||
+++ b/C++/API/CMakeLists.txt
|
||||
@@ -37,7 +37,10 @@ if(APPLE)
|
||||
find_library(IOKIT IOKit)
|
||||
target_link_libraries(treehopper pthread ${CORE_FOUNDATION} ${IOKIT})
|
||||
elseif(UNIX)
|
||||
- target_link_libraries(treehopper usb-1.0 pthread)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
|
||||
+
|
||||
+ target_link_libraries(treehopper PRIVATE PkgConfig::libusb pthread)
|
||||
elseif(WIN32)
|
||||
target_link_libraries(treehopper winusb setupapi)
|
||||
endif(APPLE)
|
||||
diff --git a/C++/API/inc/ConnectionService.h b/C++/API/inc/ConnectionService.h
|
||||
index 66d338e..12a0192 100644
|
||||
--- a/C++/API/inc/ConnectionService.h
|
||||
+++ b/C++/API/inc/ConnectionService.h
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
-#include "libusb-1.0/libusb.h"
|
||||
+#include "libusb.h"
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
diff --git a/C++/API/inc/LibUsbConnection.h b/C++/API/inc/LibUsbConnection.h
|
||||
index b6d5198..e9cd29e 100644
|
||||
--- a/C++/API/inc/LibUsbConnection.h
|
||||
+++ b/C++/API/inc/LibUsbConnection.h
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "Treehopper.h"
|
||||
|
||||
-#include <libusb-1.0/libusb.h>
|
||||
+#include <libusb.h>
|
||||
#include "UsbConnection.h"
|
||||
|
||||
namespace Treehopper {
|
@ -3,9 +3,12 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO treehopper-electronics/treehopper-sdk
|
||||
REF 1.11.3
|
||||
REF "${VERSION}"
|
||||
SHA512 65b748375b798787c8b59f9657151f340920c939c3f079105b9b78f4e3b775125598106c6dfa4feba111a64d30f007003a70110ac767802a7dd1127a25c9fb14
|
||||
HEAD_REF master)
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-dependences.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}/C++/API/"
|
||||
@ -18,6 +21,4 @@ vcpkg_cmake_config_fixup()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/C++/API/inc/" DESTINATION "${CURRENT_PACKAGES_DIR}/include/Treehopper/")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
@ -1,12 +1,15 @@
|
||||
{
|
||||
"name": "treehopper",
|
||||
"version": "1.11.3",
|
||||
"port-version": 8,
|
||||
"port-version": 9,
|
||||
"description": "Treehopper connects the physical world to your computer, tablet, or smartphone.",
|
||||
"homepage": "https://treehopper.io",
|
||||
"supports": "!staticcrt",
|
||||
"supports": "!staticcrt & !uwp",
|
||||
"dependencies": [
|
||||
"libusb",
|
||||
{
|
||||
"name": "libusb",
|
||||
"platform": "linux"
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
|
@ -1162,7 +1162,6 @@ torch-th:arm64-uwp=fail
|
||||
torch-th:x64-android=fail
|
||||
torch-th:x64-uwp=fail
|
||||
torch-th:x64-windows-static=fail
|
||||
treehopper:x64-linux=fail
|
||||
turbobase64:arm-neon-android=fail
|
||||
tvision:arm-neon-android=fail
|
||||
tvision:arm64-android=fail
|
||||
|
@ -8602,7 +8602,7 @@
|
||||
},
|
||||
"treehopper": {
|
||||
"baseline": "1.11.3",
|
||||
"port-version": 8
|
||||
"port-version": 9
|
||||
},
|
||||
"triangle": {
|
||||
"baseline": "1.6",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "145e9145dba553063f0483909603c6369c5a4e63",
|
||||
"version": "1.11.3",
|
||||
"port-version": 9
|
||||
},
|
||||
{
|
||||
"git-tree": "94c478388c393d8b174b2fd9c4ad0f77805583dc",
|
||||
"version": "1.11.3",
|
||||
|
Loading…
Reference in New Issue
Block a user