[libusb] Switch to vcpkg-make (#45911)

This commit is contained in:
Kai Pastor
2025-06-11 00:28:52 +02:00
committed by GitHub
parent a80d331697
commit 3d4f489f32
6 changed files with 17 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
if(VCPKG_TARGET_IS_LINUX)
message("${PORT} currently requires the following tools and libraries from the system package manager:\n autoreconf\n libudev\n\nThese can be installed on Ubuntu systems via apt-get install autoconf libudev-dev")
if("udev" IN_LIST FEATURES)
message("${PORT} currently requires the following tools and libraries from the system package manager:\n libudev\n\nThese can be installed on Ubuntu systems via apt-get install libudev-dev")
endif()
vcpkg_from_github(
@@ -42,24 +42,21 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
else()
vcpkg_list(SET MAKE_OPTIONS)
vcpkg_list(SET LIBUSB_LINK_LIBRARIES)
if(VCPKG_TARGET_IS_EMSCRIPTEN)
vcpkg_list(APPEND MAKE_OPTIONS BUILD_TRIPLET --host=wasm32)
endif()
if("udev" IN_LIST FEATURES)
vcpkg_list(APPEND MAKE_OPTIONS "--enable-udev")
vcpkg_list(APPEND LIBUSB_LINK_LIBRARIES udev)
else()
vcpkg_list(APPEND MAKE_OPTIONS "--disable-udev")
endif()
vcpkg_configure_make(
vcpkg_make_configure(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
AUTORECONF
OPTIONS
${MAKE_OPTIONS}
"--enable-examples-build=no"
"--enable-tests-build=no"
)
vcpkg_install_make()
vcpkg_make_install()
endif()
vcpkg_fixup_pkgconfig()
@@ -70,5 +67,4 @@ if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libusb-1.0.pc" " -Wl,-framework," " -framework " IGNORE_UNCHANGED)
endif()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@@ -1,5 +0,0 @@
libusb can be imported via CMake FindPkgConfig module:
find_package(PkgConfig REQUIRED)
pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
target_link_libraries(main PRIVATE PkgConfig::libusb)

View File

@@ -1,11 +1,17 @@
{
"name": "libusb",
"version": "1.0.29",
"port-version": 1,
"description": "a cross-platform library to access USB devices",
"homepage": "https://github.com/libusb/libusb",
"license": "LGPL-2.1-or-later",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-make",
"host": true,
"platform": "!windows | mingw"
},
{
"name": "vcpkg-msbuild",
"host": true,

View File

@@ -248,8 +248,6 @@ libtins:arm-uwp=fail
libtins:x64-uwp=fail
libtomcrypt:arm-uwp=fail
libtomcrypt:arm64-windows=fail
libusb:arm-uwp=fail
libusb:x64-uwp=fail
libusb-win32:arm-uwp=fail
libusb-win32:x64-linux=fail
libusb-win32:x64-osx=fail

View File

@@ -5478,7 +5478,7 @@
},
"libusb": {
"baseline": "1.0.29",
"port-version": 0
"port-version": 1
},
"libusb-win32": {
"baseline": "1.2.6.0",

View File

@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9597176baa90f8f43c1b1b51d4e6822865716bfc",
"version": "1.0.29",
"port-version": 1
},
{
"git-tree": "ee65ce9b463af39d68d6935078ce2e1e1e7084bc",
"version": "1.0.29",