diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f84e4c82d4e93d..34de78f555180c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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() diff --git a/overlay/ports/hidapi/hidapi-config.cmake b/overlay/ports/hidapi/hidapi-config.cmake new file mode 100644 index 00000000000000..126685a89d7cea --- /dev/null +++ b/overlay/ports/hidapi/hidapi-config.cmake @@ -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 +# 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) diff --git a/overlay/ports/hidapi/portfile.cmake b/overlay/ports/hidapi/portfile.cmake new file mode 100644 index 00000000000000..3b90a936e2af1e --- /dev/null +++ b/overlay/ports/hidapi/portfile.cmake @@ -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 + "MultiThreadedDebug" + "MultiThreadedDebugDLL" + _contents "${_contents}") + string(REGEX REPLACE + "MultiThreaded" + "MultiThreadedDLL" + _contents "${_contents}") + else() + string(REGEX REPLACE + "MultiThreadedDebugDLL" + "MultiThreadedDebug" + _contents "${_contents}") + string(REGEX REPLACE + "MultiThreadedDLL" + "MultiThreaded" + _contents "${_contents}") + endif() + + if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "dynamic") + string(REPLACE + "StaticLibrary" + "DynamicLibrary" + _contents "${_contents}") + else() + string(REPLACE + "DynamicLibrary" + "StaticLibrary" + _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}) diff --git a/overlay/ports/hidapi/vcpkg.json b/overlay/ports/hidapi/vcpkg.json new file mode 100644 index 00000000000000..f018917ffe4f8c --- /dev/null +++ b/overlay/ports/hidapi/vcpkg.json @@ -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" +}