Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
vcpkg_triplet: x64-windows
vcpkg_cache: C:\Users\runneradmin\AppData\Local\vcpkg\archives
check_disk_space: Get-PSDrive
#- os: macos-10.15
# vcpkg_path: /Users/runner/mixxx-vcpkg
# vcpkg_bootstrap: ./bootstrap-vcpkg.sh
# vcpkg_triplet: x64-osx
# vcpkg_cache: /Users/runner/.cache/vcpkg/archives
# check_disk_space: df -h
- os: macos-10.15
vcpkg_path: /Users/runner/mixxx-vcpkg
vcpkg_bootstrap: ./bootstrap-vcpkg.sh
vcpkg_triplet: x64-osx
vcpkg_cache: /Users/runner/.cache/vcpkg/archives
check_disk_space: df -h
env:
VCPKG_PACKAGES: >-
angle
Expand Down Expand Up @@ -114,6 +114,7 @@ jobs:
env:
VCPKG_OVERLAY_PORTS: overlay/ports
VCPKG_BINARY_SOURCES: ${{ env.VCPKG_BINARY_SOURCES }}
VCPKG_OSX_DEPLOYMENT_TARGET: 10.13 # minimum supported by Qt 5.15

- name: Upload GitHub Actions artifacts of failed build
if: failure()
Expand Down
48 changes: 48 additions & 0 deletions overlay/ports/hidapi/hidapi-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# - try to find HIDAPI library
# from http://www.signal11.us/oss/hidapi/
#
# Cache Variables: (probably not for direct use in your scripts)
# HIDAPI_INCLUDE_DIR
# HIDAPI_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# HIDAPI_FOUND
# HIDAPI_INCLUDE_DIRS
# HIDAPI_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# hacking FindHIDAPI.cmake as hidapi-config.cmake

find_library(HIDAPI_LIBRARY
NAMES hidapi hidapi-libusb)

find_path(HIDAPI_INCLUDE_DIR
NAMES hidapi.h
PATH_SUFFIXES
hidapi)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HIDAPI
DEFAULT_MSG
HIDAPI_LIBRARY
HIDAPI_INCLUDE_DIR)

if(HIDAPI_FOUND)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")

set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
endif()

mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)
59 changes: 59 additions & 0 deletions overlay/ports/hidapi/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libusb/hidapi
REF hidapi-0.10.1
SHA512 0479706c631775483378070ff7170542725678eabc202a5bd07436c951fd766e01743417999ac3fb2b5436c865f6ace2cfced1f210fa3a3e88c19ceb3bbe0534
HEAD_REF master
)

if(VCPKG_TARGET_IS_WINDOWS)
file(READ "${SOURCE_PATH}/windows/hidapi.vcxproj" _contents)
if(${VCPKG_CRT_LINKAGE} STREQUAL "dynamic")
string(REGEX REPLACE
"<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>"
"<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>"
_contents "${_contents}")
string(REGEX REPLACE
"<RuntimeLibrary>MultiThreaded</RuntimeLibrary>"
"<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>"
_contents "${_contents}")
else()
string(REGEX REPLACE
"<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>"
"<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>"
_contents "${_contents}")
string(REGEX REPLACE
"<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>"
"<RuntimeLibrary>MultiThreaded</RuntimeLibrary>"
_contents "${_contents}")
endif()

if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "dynamic")
string(REPLACE
"<ConfigurationType>StaticLibrary</ConfigurationType>"
"<ConfigurationType>DynamicLibrary</ConfigurationType>"
_contents "${_contents}")
else()
string(REPLACE
"<ConfigurationType>DynamicLibrary</ConfigurationType>"
"<ConfigurationType>StaticLibrary</ConfigurationType>"
_contents "${_contents}")
endif()
file(WRITE "${SOURCE_PATH}/windows/hidapi.vcxproj" "${_contents}")

vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH windows/hidapi.vcxproj
INCLUDES_SUBPATH hidapi ALLOW_ROOT_INCLUDES
LICENSE_SUBPATH LICENSE-bsd.txt # use BSD license
)
else()
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
)
vcpkg_install_make()
file(COPY "${SOURCE_PATH}/LICENSE-bsd.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/hidapi/copyright")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif()

file(COPY ${CMAKE_CURRENT_LIST_DIR}/hidapi-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
8 changes: 8 additions & 0 deletions overlay/ports/hidapi/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "hidapi",
"version-string": "0.10.1",
"port-version": 2,
"description": "A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac and Windows.",
"homepage": "https://github.com/libusb/hidapi",
"supports": "!uwp"
}