Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[treehopper] Fix dependence libusb #35480

Merged
merged 19 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ports/treehopper/fix-dependences-libusb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/C++/API/CMakeLists.txt b/C++/API/CMakeLists.txt
index 8537305..612cf7d 100644
--- a/C++/API/CMakeLists.txt
+++ b/C++/API/CMakeLists.txt
@@ -37,7 +37,9 @@ if(APPLE)
find_library(IOKIT IOKit)
target_link_libraries(treehopper pthread ${CORE_FOUNDATION} ${IOKIT})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR IMO this should also be patched, to decouple cached artifacts from local SDK paths. Untested:

Suggested change
target_link_libraries(treehopper pthread ${CORE_FOUNDATION} ${IOKIT})
target_link_libraries(treehopper pthread "-framework CoreFoundation" "-framework IOKit")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to change the behavior of upstream:

find_library(IOKIT IOKit)

elseif(UNIX)
- target_link_libraries(treehopper usb-1.0 pthread)
+ find_package(libusb CONFIG REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+ find_package(libusb CONFIG REQUIRED)
+ find_package(libusb REQUIRED)

There is no config, so don't hard-code it. (There is not even a find module. Just a vcpkg wrapper.)

+ target_include_directories(treehopper PRIVATE ${LIBUSB_INCLUDE_DIRS})
+ target_link_libraries(treehopper PRIVATE ${LIBUSB_LIBRARIES} pthread)
elseif(WIN32)
target_link_libraries(treehopper winusb setupapi)
endif(APPLE)
5 changes: 4 additions & 1 deletion ports/treehopper/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ vcpkg_from_github(
REPO treehopper-electronics/treehopper-sdk
REF 1.11.3
SHA512 65b748375b798787c8b59f9657151f340920c939c3f079105b9b78f4e3b775125598106c6dfa4feba111a64d30f007003a70110ac767802a7dd1127a25c9fb14
HEAD_REF master)
HEAD_REF master
PATCHES
fix-dependences-libusb.patch
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/C++/API/"
Expand Down
2 changes: 1 addition & 1 deletion ports/treehopper/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "treehopper",
"version": "1.11.3",
"port-version": 7,
"port-version": 8,
"description": "Treehopper connects the physical world to your computer, tablet, or smartphone.",
"homepage": "https://treehopper.io",
"dependencies": [
Expand Down
1 change: 0 additions & 1 deletion scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,6 @@ torch-th:x64-android=fail
torch-th:x64-uwp=fail
torch-th:x64-windows-static=fail
treehopper:x64-windows-static=fail
treehopper:x64-linux=fail
turbobase64:arm-neon-android=fail
tvision:arm-neon-android=fail
tvision:arm64-android=fail
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8558,7 +8558,7 @@
},
"treehopper": {
"baseline": "1.11.3",
"port-version": 7
"port-version": 8
},
"triangle": {
"baseline": "1.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/treehopper.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5bbc0e47c00223e9740637819cef05cfc2f3d162",
"version": "1.11.3",
"port-version": 8
},
{
"git-tree": "bfc0dea8339d81f05a040cd2ca7831c18c43f765",
"version": "1.11.3",
Expand Down
Loading