aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/treehopper
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/treehopper
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/treehopper')
-rw-r--r--vcpkg/ports/treehopper/add-cstdint.diff10
-rw-r--r--vcpkg/ports/treehopper/fix-dependences.patch42
-rw-r--r--vcpkg/ports/treehopper/portfile.cmake35
-rw-r--r--vcpkg/ports/treehopper/vcpkg.json22
4 files changed, 109 insertions, 0 deletions
diff --git a/vcpkg/ports/treehopper/add-cstdint.diff b/vcpkg/ports/treehopper/add-cstdint.diff
new file mode 100644
index 0000000..fad7beb
--- /dev/null
+++ b/vcpkg/ports/treehopper/add-cstdint.diff
@@ -0,0 +1,10 @@
+diff --git a/C++/API/inc/UsbConnection.h b/C++/API/inc/UsbConnection.h
+index f07533c..614d2f9 100644
+--- a/C++/API/inc/UsbConnection.h
++++ b/C++/API/inc/UsbConnection.h
+@@ -1,4 +1,5 @@
+ #pragma once
++#include <cstdint>
+ #include <string>
+ #include "Treehopper.h"
+
diff --git a/vcpkg/ports/treehopper/fix-dependences.patch b/vcpkg/ports/treehopper/fix-dependences.patch
new file mode 100644
index 0000000..80207d2
--- /dev/null
+++ b/vcpkg/ports/treehopper/fix-dependences.patch
@@ -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)
++ find_package(Threads REQUIRED)
++ target_link_libraries(treehopper PRIVATE PkgConfig::libusb ${CMAKE_THREAD_LIBS_INIT})
+ 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 {
diff --git a/vcpkg/ports/treehopper/portfile.cmake b/vcpkg/ports/treehopper/portfile.cmake
new file mode 100644
index 0000000..1d267fc
--- /dev/null
+++ b/vcpkg/ports/treehopper/portfile.cmake
@@ -0,0 +1,35 @@
+vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO treehopper-electronics/treehopper-sdk
+ REF "${VERSION}"
+ SHA512 65b748375b798787c8b59f9657151f340920c939c3f079105b9b78f4e3b775125598106c6dfa4feba111a64d30f007003a70110ac767802a7dd1127a25c9fb14
+ HEAD_REF master
+ PATCHES
+ fix-dependences.patch
+ add-cstdint.diff
+)
+
+if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID)
+ vcpkg_find_acquire_program(PKGCONFIG)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/C++/API/"
+ OPTIONS
+ "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
+ -DTHREADS_PREFER_PTHREAD_FLAG=ON
+ MAYBE_UNUSED_VARIABLES
+ PKG_CONFIG_EXECUTABLE
+ THREADS_PREFER_PTHREAD_FLAG
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+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/")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/treehopper/vcpkg.json b/vcpkg/ports/treehopper/vcpkg.json
new file mode 100644
index 0000000..56b9b2f
--- /dev/null
+++ b/vcpkg/ports/treehopper/vcpkg.json
@@ -0,0 +1,22 @@
+{
+ "name": "treehopper",
+ "version": "1.11.3",
+ "port-version": 11,
+ "description": "Treehopper connects the physical world to your computer, tablet, or smartphone.",
+ "homepage": "https://treehopper.io",
+ "supports": "!uwp & !(static & staticcrt)",
+ "dependencies": [
+ {
+ "name": "libusb",
+ "platform": "android | linux"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}