early-access version 2853
This commit is contained in:
13
externals/vcpkg/ports/libftdi/dont_use_lib64.patch
vendored
Executable file
13
externals/vcpkg/ports/libftdi/dont_use_lib64.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b68de29..2eda29e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -44,7 +44,7 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
SET(LIB_SUFFIX "")
|
||||
SET(PACK_ARCH "")
|
||||
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
- SET(LIB_SUFFIX 64)
|
||||
+ SET(LIB_SUFFIX "")
|
||||
SET(PACK_ARCH .x86_64)
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
|
||||
56
externals/vcpkg/ports/libftdi/exports.def
vendored
Executable file
56
externals/vcpkg/ports/libftdi/exports.def
vendored
Executable file
@@ -0,0 +1,56 @@
|
||||
EXPORTS
|
||||
ftdi_deinit
|
||||
ftdi_disable_bitbang
|
||||
ftdi_eeprom_build
|
||||
ftdi_eeprom_decode
|
||||
ftdi_eeprom_free
|
||||
ftdi_eeprom_initdefaults
|
||||
ftdi_eeprom_setsize
|
||||
ftdi_enable_bitbang
|
||||
ftdi_erase_eeprom
|
||||
ftdi_free
|
||||
ftdi_get_error_string
|
||||
ftdi_get_latency_timer
|
||||
ftdi_init
|
||||
ftdi_list_free
|
||||
ftdi_list_free2
|
||||
ftdi_new
|
||||
ftdi_poll_modem_status
|
||||
ftdi_read_chipid
|
||||
ftdi_read_data
|
||||
ftdi_read_data_get_chunksize
|
||||
ftdi_read_data_set_chunksize
|
||||
ftdi_read_eeprom
|
||||
ftdi_read_eeprom_getsize
|
||||
ftdi_read_eeprom_location
|
||||
ftdi_read_pins
|
||||
ftdi_set_baudrate
|
||||
ftdi_set_bitmode
|
||||
ftdi_set_error_char
|
||||
ftdi_set_event_char
|
||||
ftdi_set_interface
|
||||
ftdi_set_latency_timer
|
||||
ftdi_set_line_property
|
||||
ftdi_set_line_property2
|
||||
ftdi_set_usbdev
|
||||
ftdi_setdtr
|
||||
ftdi_setdtr_rts
|
||||
ftdi_setflowctrl
|
||||
ftdi_setrts
|
||||
ftdi_usb_close
|
||||
ftdi_usb_find_all
|
||||
ftdi_usb_get_strings
|
||||
ftdi_usb_open
|
||||
ftdi_usb_open_desc
|
||||
ftdi_usb_open_desc_index
|
||||
ftdi_usb_open_dev
|
||||
ftdi_usb_open_string
|
||||
ftdi_usb_purge_buffers
|
||||
ftdi_usb_purge_rx_buffer
|
||||
ftdi_usb_purge_tx_buffer
|
||||
ftdi_usb_reset
|
||||
ftdi_write_data
|
||||
ftdi_write_data_get_chunksize
|
||||
ftdi_write_data_set_chunksize
|
||||
ftdi_write_eeprom
|
||||
ftdi_write_eeprom_location
|
||||
43
externals/vcpkg/ports/libftdi/libusb-win32.patch
vendored
Executable file
43
externals/vcpkg/ports/libftdi/libusb-win32.patch
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
diff --git a/FindUSB.cmake b/FindUSB.cmake
|
||||
index 566cdd8..0710345 100644
|
||||
--- a/FindUSB.cmake
|
||||
+++ b/FindUSB.cmake
|
||||
@@ -24,10 +24,10 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
|
||||
pkg_check_modules(PC_LIBUSB libusb)
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
- FIND_PATH(LIBUSB_INCLUDE_DIR usb.h
|
||||
+ FIND_PATH(LIBUSB_INCLUDE_DIR lusb0_usb.h
|
||||
PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
|
||||
|
||||
- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb
|
||||
+ FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb0 libusb0
|
||||
PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
diff --git a/src/ftdi.c b/src/ftdi.c
|
||||
index 980622d..8f6ab67 100644
|
||||
--- a/src/ftdi.c
|
||||
+++ b/src/ftdi.c
|
||||
@@ -28,7 +28,7 @@
|
||||
/** \addtogroup libftdi */
|
||||
/* @{ */
|
||||
|
||||
-#include <usb.h>
|
||||
+#include <lusb0_usb.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
diff --git a/src/ftdi.h b/src/ftdi.h
|
||||
index 6bb7a3e..d4472c2 100644
|
||||
--- a/src/ftdi.h
|
||||
+++ b/src/ftdi.h
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef __libftdi_h__
|
||||
#define __libftdi_h__
|
||||
|
||||
-#include <usb.h>
|
||||
+#include <lusb0_usb.h>
|
||||
|
||||
#define FTDI_DEFAULT_EEPROM_SIZE 128
|
||||
|
||||
50
externals/vcpkg/ports/libftdi/portfile.cmake
vendored
Executable file
50
externals/vcpkg/ports/libftdi/portfile.cmake
vendored
Executable file
@@ -0,0 +1,50 @@
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://www.intra2net.com/en/developer/libftdi/download/libftdi-0.20.tar.gz"
|
||||
FILENAME "libftdi-0.20.tar.gz"
|
||||
SHA512 540e5eb201a65936c3dbabff70c251deba1615874b11ff27c5ca16c39d71c150cf61758a68b541135a444fe32ab403b0fba0daf55c587647aaf9b3f400f1dee7
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
REF 0.20
|
||||
PATCHES
|
||||
libusb-win32.patch
|
||||
shared-static.patch
|
||||
dont_use_lib64.patch
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}/src")
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DDOCUMENTATION=OFF
|
||||
-DEXAMPLES=OFF
|
||||
-DPYTHON_BINDINGS=OFF
|
||||
-DFTDIPP=OFF
|
||||
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON
|
||||
|
||||
"-DLIBUSB_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include"
|
||||
|
||||
-DLIB_INSTALL_DIR=lib
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_fixup_cmake_targets()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(COPY "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libftdi")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/share/libftdi/LICENSE" "${CURRENT_PACKAGES_DIR}/share/libftdi/copyright")
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
# Delete pkgconfig files for ftdipp since we did -DFTDIPP=OFF above
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/ftdipp.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/ftdipp.pc")
|
||||
66
externals/vcpkg/ports/libftdi/shared-static.patch
vendored
Executable file
66
externals/vcpkg/ports/libftdi/shared-static.patch
vendored
Executable file
@@ -0,0 +1,66 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 071ae90..f91f6f7 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -4,7 +4,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# Targets
|
||||
-set(c_sources ftdi.c)
|
||||
+set(c_sources ftdi.c exports.def)
|
||||
set(c_headers ftdi.h)
|
||||
|
||||
add_library(ftdi SHARED ${c_sources})
|
||||
@@ -14,7 +14,7 @@ set_target_properties(ftdi PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.
|
||||
|
||||
# Static library
|
||||
add_library(ftdi-static STATIC ${c_sources})
|
||||
-set_target_properties(ftdi-static PROPERTIES OUTPUT_NAME "ftdi")
|
||||
+set_target_properties(ftdi-static PROPERTIES OUTPUT_NAME "ftdi-static")
|
||||
|
||||
# Prevent clobbering each other during the build
|
||||
set_target_properties(ftdi PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||
@@ -24,7 +24,7 @@ set_target_properties(ftdi-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||
target_link_libraries(ftdi ${LIBUSB_LIBRARIES})
|
||||
|
||||
# Install
|
||||
-if(${UNIX})
|
||||
+if(UNIX AND 0)
|
||||
|
||||
install( TARGETS ftdi
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||
@@ -41,23 +41,29 @@ if(${UNIX})
|
||||
COMPONENT headers
|
||||
)
|
||||
|
||||
-endif(${UNIX})
|
||||
+endif()
|
||||
|
||||
-if(${WIN32})
|
||||
+if(WIN32 OR 1)
|
||||
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
install( TARGETS ftdi
|
||||
- DESTINATION bin
|
||||
+ EXPORT ftdi
|
||||
COMPONENT sharedlibs
|
||||
)
|
||||
|
||||
+ target_include_directories(ftdi PUBLIC $<INSTALL_INTERFACE:include>)
|
||||
+ else()
|
||||
install( TARGETS ftdi-static
|
||||
- DESTINATION bin
|
||||
+ EXPORT ftdi
|
||||
COMPONENT staticlibs
|
||||
)
|
||||
+ target_include_directories(ftdi-static PUBLIC $<INSTALL_INTERFACE:include>)
|
||||
+ endif()
|
||||
+ install(EXPORT ftdi FILE libftdi-config.cmake NAMESPACE libftdi:: DESTINATION share/libftdi)
|
||||
|
||||
install( FILES ${c_headers}
|
||||
DESTINATION include
|
||||
COMPONENT headers
|
||||
)
|
||||
|
||||
-endif(${WIN32})
|
||||
+endif()
|
||||
9
externals/vcpkg/ports/libftdi/vcpkg.json
vendored
Executable file
9
externals/vcpkg/ports/libftdi/vcpkg.json
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "libftdi",
|
||||
"version-string": "0.20",
|
||||
"port-version": 3,
|
||||
"description": "FTDI USB driver with bitbang mode (v0.20)",
|
||||
"dependencies": [
|
||||
"libusb-win32"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user