aboutsummaryrefslogtreecommitdiff
path: root/ports/libusb
diff options
context:
space:
mode:
Diffstat (limited to 'ports/libusb')
-rw-r--r--ports/libusb/CONTROL3
-rw-r--r--ports/libusb/portfile.cmake78
2 files changed, 10 insertions, 71 deletions
diff --git a/ports/libusb/CONTROL b/ports/libusb/CONTROL
index 8e3516132..863b2d08b 100644
--- a/ports/libusb/CONTROL
+++ b/ports/libusb/CONTROL
@@ -1,4 +1,5 @@
Source: libusb
-Version: 1.0.23
+Version: 1.0.23-1
Homepage: https://github.com/libusb/libusb
Description: a cross-platform library to access USB devices
+Supports: !uwp
diff --git a/ports/libusb/portfile.cmake b/ports/libusb/portfile.cmake
index 1beb053aa..00bdbae79 100644
--- a/ports/libusb/portfile.cmake
+++ b/ports/libusb/portfile.cmake
@@ -1,8 +1,6 @@
-if (VCPKG_CMAKE_SYSTEM_NAME)
- message(FATAL_ERROR "Error: the port is unsupported on your platform. Please open an issue on github.com/Microsoft/vcpkg to request a fix")
-endif()
+vcpkg_fail_port_install(ON_TARGET "uwp")
-if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
+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 autoreconf libudev-dev")
endif()
@@ -46,73 +44,13 @@ if(VCPKG_TARGET_IS_WINDOWS)
PROJECT_SUBPATH msvc/libusb_${LIBUSB_PROJECT_TYPE}_${MSVS_VERSION}.vcxproj
LICENSE_SUBPATH COPYING
)
+ file(INSTALL ${SOURCE_PATH}/libusb/libusb.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0)
else()
- set(BASH /bin/bash)
-
- if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release")
- file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
- file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
- # Copy sources
- message(STATUS "Copying source files...")
- file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*)
- foreach(SOURCE_FILE ${PORT_SOURCE_FILES})
- file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
- endforeach()
- message(STATUS "Copying source files... done")
- # Configure release
- message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
- execute_process(
- COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\""
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
- execute_process(
- COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}\""
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
- message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
- endif()
-
- if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug")
- file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
- file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
- # Copy sources
- message(STATUS "Copying source files...")
- file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*)
- foreach(SOURCE_FILE ${PORT_SOURCE_FILES})
- file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
- endforeach()
- message(STATUS "Copying source files... done")
- # Configure debug
- message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
- execute_process(
- COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\""
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
- execute_process(
- COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}/debug\""
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
- message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
- endif()
-
- if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
- # Build release
- message(STATUS "Package ${TARGET_TRIPLET}-rel")
- execute_process(
- COMMAND "${BASH} --noprofile --norc -c \"make install\""
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
- message(STATUS "Package ${TARGET_TRIPLET}-rel done")
- endif()
-
- if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
- # Build debug
- message(STATUS "Package ${TARGET_TRIPLET}-dbg")
- execute_process(
- COMMAND "${BASH} --noprofile --norc -c \"make install\""
- WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
- message(STATUS "Package ${TARGET_TRIPLET}-dbg done")
- endif()
+ vcpkg_configure_make(
+ SOURCE_PATH ${SOURCE_PATH}
+ AUTOCONFIG
+ )
+ vcpkg_install_make()
endif()
-file(INSTALL
- ${SOURCE_PATH}/libusb/libusb.h
- DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0
-)
-
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)