From 4c2b54e0525963bf3c9f3ffc7072aabdc510eb97 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 13 Sep 2024 04:28:25 +0200 Subject: [PATCH] [libftdi1] Fix, cleanup, C++ binding, test port (#40862) --- ports/libftdi1/cmake-version.diff | 19 +++++ ports/libftdi1/disable-config-script.diff | 12 ++++ ports/libftdi1/libconfuse-fix.patch | 13 ---- ports/libftdi1/libdir.diff | 12 ++++ ports/libftdi1/libftdipp1.diff | 39 +++++++++++ ports/libftdi1/libusb-fix.patch | 13 ---- ports/libftdi1/libusb.diff | 16 +++++ ports/libftdi1/linkage.diff | 49 +++++++++++++ ports/libftdi1/portfile.cmake | 70 +++++++++++++------ ports/libftdi1/vcpkg.json | 21 ++++-- ports/libftdi1/win32.patch | 28 -------- ports/libusb/portfile.cmake | 6 ++ ports/libusb/vcpkg.json | 2 +- .../vcpkg-ci-libftdi1/portfile.cmake | 10 +++ .../vcpkg-ci-libftdi1/project/CMakeLists.txt | 13 ++++ .../project/cmake-usage/CMakeLists.txt | 6 ++ .../vcpkg-ci-libftdi1/project/main.cpp | 7 ++ .../test_ports/vcpkg-ci-libftdi1/vcpkg.json | 17 +++++ versions/baseline.json | 4 +- versions/l-/libftdi1.json | 5 ++ versions/l-/libusb.json | 5 ++ 21 files changed, 286 insertions(+), 81 deletions(-) create mode 100644 ports/libftdi1/cmake-version.diff create mode 100644 ports/libftdi1/disable-config-script.diff delete mode 100644 ports/libftdi1/libconfuse-fix.patch create mode 100644 ports/libftdi1/libdir.diff create mode 100644 ports/libftdi1/libftdipp1.diff delete mode 100644 ports/libftdi1/libusb-fix.patch create mode 100644 ports/libftdi1/libusb.diff create mode 100644 ports/libftdi1/linkage.diff delete mode 100644 ports/libftdi1/win32.patch create mode 100644 scripts/test_ports/vcpkg-ci-libftdi1/portfile.cmake create mode 100644 scripts/test_ports/vcpkg-ci-libftdi1/project/CMakeLists.txt create mode 100644 scripts/test_ports/vcpkg-ci-libftdi1/project/cmake-usage/CMakeLists.txt create mode 100644 scripts/test_ports/vcpkg-ci-libftdi1/project/main.cpp create mode 100644 scripts/test_ports/vcpkg-ci-libftdi1/vcpkg.json diff --git a/ports/libftdi1/cmake-version.diff b/ports/libftdi1/cmake-version.diff new file mode 100644 index 0000000000..6ab7a74bcb --- /dev/null +++ b/ports/libftdi1/cmake-version.diff @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5aecafc..4158267 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,5 @@ + # Project ++cmake_minimum_required(VERSION 3.5) + project(libftdi1 C) + set(MAJOR_VERSION 1) + set(MINOR_VERSION 5) +@@ -11,8 +12,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + if("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE RelWithDebInfo) + endif("${CMAKE_BUILD_TYPE}" STREQUAL "") +-set(CMAKE_COLOR_MAKEFILE ON) +-cmake_minimum_required(VERSION 2.6 FATAL_ERROR) + + add_definitions(-Wall) + diff --git a/ports/libftdi1/disable-config-script.diff b/ports/libftdi1/disable-config-script.diff new file mode 100644 index 0000000000..d573d92c96 --- /dev/null +++ b/ports/libftdi1/disable-config-script.diff @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4158267..61828d3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -170,6 +170,7 @@ install(FILES ${CMAKE_BINARY_DIR}/libftdi1.pc ${CMAKE_BINARY_DIR}/libftdipp1.pc + DESTINATION lib${LIB_SUFFIX}/pkgconfig) + + if (UNIX OR MINGW) ++elseif (0) + configure_file ( libftdi1-config.in ${CMAKE_CURRENT_BINARY_DIR}/libftdi1-config @ONLY ) + install ( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libftdi1-config + DESTINATION bin ) diff --git a/ports/libftdi1/libconfuse-fix.patch b/ports/libftdi1/libconfuse-fix.patch deleted file mode 100644 index b50bb0a3c0..0000000000 --- a/ports/libftdi1/libconfuse-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/FindConfuse.cmake b/cmake/FindConfuse.cmake -index f6af7d5..e24d72f 100755 ---- a/cmake/FindConfuse.cmake -+++ b/cmake/FindConfuse.cmake -@@ -46,7 +46,7 @@ find_path ( CONFUSE_INCLUDE_DIR - set ( CONFUSE_INCLUDE_DIRS ${CONFUSE_INCLUDE_DIR} ) - - find_library ( CONFUSE_LIBRARY -- NAMES confuse -+ NAMES libconfuse - ) - - set ( CONFUSE_LIBRARIES ${CONFUSE_LIBRARY} ) diff --git a/ports/libftdi1/libdir.diff b/ports/libftdi1/libdir.diff new file mode 100644 index 0000000000..eac596c836 --- /dev/null +++ b/ports/libftdi1/libdir.diff @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fa5b3bf..5963df0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -166,6 +166,7 @@ endif(${UNIX}) + if(${WIN32}) + set(libdir ${CMAKE_INSTALL_PREFIX}/bin) + endif(${WIN32}) ++set(libdir ${CMAKE_INSTALL_PREFIX}/lib) + + configure_file(${CMAKE_SOURCE_DIR}/libftdi1.pc.in ${CMAKE_BINARY_DIR}/libftdi1.pc @ONLY) + configure_file(${CMAKE_SOURCE_DIR}/libftdipp1.pc.in ${CMAKE_BINARY_DIR}/libftdipp1.pc @ONLY) diff --git a/ports/libftdi1/libftdipp1.diff b/ports/libftdi1/libftdipp1.diff new file mode 100644 index 0000000000..93aaadb3ea --- /dev/null +++ b/ports/libftdi1/libftdipp1.diff @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4158267..64ad5b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -135,7 +135,7 @@ endif () + + add_subdirectory(src) + if ( FTDIPP ) +- project(libftdipp1 C CXX) ++ enable_language(CXX) + add_subdirectory(ftdipp) + endif () + if ( PYTHON_BINDINGS ) +@@ -192,6 +192,7 @@ list ( APPEND LIBFTDI_STATIC_LIBRARIES ${LIBUSB_LIBRARIES} ) + if ( FTDIPP ) + set ( LIBFTDIPP_LIBRARY ftdipp1 ) + set ( LIBFTDIPP_LIBRARIES ${LIBFTDIPP_LIBRARY} ) ++ list ( APPEND LIBFTDI_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ) + list ( APPEND LIBFTDIPP_LIBRARIES ${LIBUSB_LIBRARIES} ) + endif () + set ( LIBFTDI_LIBRARY_DIRS ${libdir} ) +@@ -203,6 +204,7 @@ set ( LIBFTDI_ROOT_DIR ${prefix} ) + set ( LIBFTDI_VERSION_STRING ${VERSION_STRING} ) + set ( LIBFTDI_VERSION_MAJOR ${MAJOR_VERSION} ) + set ( LIBFTDI_VERSION_MINOR ${MINOR_VERSION} ) ++set ( LIBFTDIPP_LIBRARIES ${LIBFTDIPP_LIBRARY} ${LIBFTDI_LIBRARIES}) + + set ( LIBFTDI_USE_FILE ${CMAKE_INSTALL_PREFIX}/${LIBFTDI_CMAKE_CONFIG_DIR}/UseLibFTDI1.cmake ) + +diff --git a/libftdipp1.pc.in b/libftdipp1.pc.in +index 8158f38..b4fff0a 100644 +--- a/libftdipp1.pc.in ++++ b/libftdipp1.pc.in +@@ -8,4 +8,4 @@ Description: C++ wrapper for libftdi1 + Requires: libftdi1 + Version: @VERSION@ + Libs: -L${libdir} -lftdipp1 +-Cflags: -I${includedir} ++Cflags: -I${includedir} -I${prefix}/include diff --git a/ports/libftdi1/libusb-fix.patch b/ports/libftdi1/libusb-fix.patch deleted file mode 100644 index 98dae3dea0..0000000000 --- a/ports/libftdi1/libusb-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake -index b90e297..6cc97a0 100755 ---- a/cmake/FindUSB1.cmake -+++ b/cmake/FindUSB1.cmake -@@ -26,7 +26,7 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) - PATH_SUFFIXES libusb-1.0 - PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) - -- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 -+ FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 libusb-1.0 - PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) - - include(FindPackageHandleStandardArgs) diff --git a/ports/libftdi1/libusb.diff b/ports/libftdi1/libusb.diff new file mode 100644 index 0000000000..186a79db85 --- /dev/null +++ b/ports/libftdi1/libusb.diff @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b5c812c..7fb66f7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,7 +24,10 @@ if(${CMAKE_BUILD_TYPE} STREQUAL Debug) + endif(${CMAKE_BUILD_TYPE} STREQUAL Debug) + + # find libusb +-find_package ( USB1 REQUIRED ) ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(LIBUSB REQUIRED libusb-1.0) ++set(LIBUSB_INCLUDE_DIR "${LIBUSB_INCLUDE_DIRS}") ++set(LIBUSB_LIBRARIES "${LIBUSB_LINK_LIBRARIES}") + include_directories ( ${LIBUSB_INCLUDE_DIR} ) + + # Find Boost diff --git a/ports/libftdi1/linkage.diff b/ports/libftdi1/linkage.diff new file mode 100644 index 0000000000..5bc19ef525 --- /dev/null +++ b/ports/libftdi1/linkage.diff @@ -0,0 +1,49 @@ +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index fac5bcc..8a20a04 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -11,6 +11,11 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} + + include_directories(${Boost_INCLUDE_DIRS}) + ++if(WIN32) ++ set(BUILD_SHARED_LIBS OFF) ++ set(STATICLIBS ON) ++endif() ++if(BUILD_SHARED_LIBS) + # Shared library + add_library(ftdipp1 SHARED ${cpp_sources}) + +@@ -28,6 +33,7 @@ install ( TARGETS ftdipp1 + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) ++endif() + + # Static library + if ( STATICLIBS ) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 17b3617..087fba8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -19,8 +19,12 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h + + # Targets + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) ++if(WIN32) ++ set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/exports.def CACHE INTERNAL "List of c sources" ) ++endif() + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) + ++if(BUILD_SHARED_LIBS) + add_library(ftdi1 SHARED ${c_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases +@@ -37,6 +41,7 @@ install ( TARGETS ftdi1 + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) ++endif() + + if ( STATICLIBS ) + add_library(ftdi1-static STATIC ${c_sources}) diff --git a/ports/libftdi1/portfile.cmake b/ports/libftdi1/portfile.cmake index c518088059..fabdcd4109 100644 --- a/ports/libftdi1/portfile.cmake +++ b/ports/libftdi1/portfile.cmake @@ -6,44 +6,74 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive( SOURCE_PATH - ARCHIVE ${ARCHIVE} + ARCHIVE "${ARCHIVE}" SOURCE_BASE 1.5 PATCHES - libusb-fix.patch - libconfuse-fix.patch - win32.patch + cmake-version.diff + disable-config-script.diff + linkage.diff + libdir.diff + libftdipp1.diff + libusb.diff ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}/src") +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATICLIBS) + +vcpkg_check_features(OUT_FEATURE_OPTIONS options + FEATURES + cpp FTDIPP +) + +vcpkg_find_acquire_program(PKGCONFIG) + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + ${options} -DBUILD_TESTS=OFF + -DCMAKE_CXX_STANDARD=11 -DDOCUMENTATION=OFF -DEXAMPLES=OFF - -DPYTHON_BINDINGS=OFF - -DLINK_PYTHON_LIBRARY=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON - -DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON - -DCMAKE_DISABLE_FIND_PACKAGE_Libintl=ON - -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=ON - -DCMAKE_DISABLE_FIND_PACKAGE_PythonInterp=ON -DFTDI_EEPROM=OFF + -DLIB_SUFFIX= + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + -DPYTHON_BINDINGS=OFF + -DSTATICLIBS=${STATICLIBS} ) vcpkg_cmake_install() - -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libftdi1) - +vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +if(NOT VCPKG_BUILD_TYPE) + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/cmake/libftdi1/LibFTDI1Config.cmake" "${CURRENT_PACKAGES_DIR}/debug/lib/cmake/libftdi1/LibFTDI1Config-debug.cmake") +endif() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libftdi1) +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config.cmake" "/lib/cmake/${PORT}/" "/share/${PORT}/") +if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config-debug.cmake" "/debug/lib/cmake/${PORT}/" "/share/${PORT}/") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config-debug.cmake" "{_IMPORT_PREFIX}" "{VCPKG_IMPORT_PREFIX}") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config-debug.cmake" "{VCPKG_IMPORT_PREFIX}/debug/include/" "{VCPKG_IMPORT_PREFIX}/include/") + file(READ "${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config.cmake" release_config) + file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/LibFTDI1Config.cmake" " +if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES \"^[Dd][Ee][Bb][Uu][Gg]\$\") + include(\"\${CMAKE_CURRENT_LIST_DIR}/LibFTDI1Config-debug.cmake\") + return() +endif() +${release_config}" + ) endif() -vcpkg_copy_pdbs() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") +if(NOT "cpp" IN_LIST FEATURES) + file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libftdipp1.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libftdipp1.pc") +endif() -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +set(file_list "${SOURCE_PATH}/COPYING.LIB") +if("cpp" IN_LIST FEATURES) + set(file_list "${SOURCE_PATH}/LICENSE" "${SOURCE_PATH}/COPYING.LIB" "${SOURCE_PATH}/COPYING.GPL") +endif() + +vcpkg_install_copyright(FILE_LIST ${file_list}) diff --git a/ports/libftdi1/vcpkg.json b/ports/libftdi1/vcpkg.json index 982f2b5e96..89d77cf2bd 100644 --- a/ports/libftdi1/vcpkg.json +++ b/ports/libftdi1/vcpkg.json @@ -1,11 +1,15 @@ { "name": "libftdi1", "version": "1.5", - "port-version": 4, + "port-version": 5, "description": "FTDI USB driver with bitbang mode", + "homepage": "https://www.intra2net.com/en/developer/libftdi/", + "license": "LGPL-2.1-only AND MIT", "dependencies": [ - "libconfuse", - "libusb", + { + "name": "libusb", + "default-features": false + }, { "name": "vcpkg-cmake", "host": true @@ -14,5 +18,14 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "features": { + "cpp": { + "description": "C++ bindings", + "license": "GPL-2.0-only WITH eCos-exception-2.0", + "dependencies": [ + "boost-smart-ptr" + ] + } + } } diff --git a/ports/libftdi1/win32.patch b/ports/libftdi1/win32.patch deleted file mode 100644 index 7cea44d4fd..0000000000 --- a/ports/libftdi1/win32.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 17b3617..f9a8e59 100755 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -18,9 +18,14 @@ message(STATUS "Detected git snapshot version: ${SNAPSHOT_VERSION}") - configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h" @ONLY) - - # Targets -+if(WIN32) -+set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/exports.def CACHE INTERNAL "List of c sources" ) -+else() - set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) -+endif() - set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) - -+if(BUILD_SHARED_LIBS) - add_library(ftdi1 SHARED ${c_sources}) - - math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases -@@ -38,7 +43,7 @@ install ( TARGETS ftdi1 - ARCHIVE DESTINATION lib${LIB_SUFFIX} - ) - --if ( STATICLIBS ) -+else() - add_library(ftdi1-static STATIC ${c_sources}) - target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) - set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") diff --git a/ports/libusb/portfile.cmake b/ports/libusb/portfile.cmake index c87b7633bd..e00c7a0403 100644 --- a/ports/libusb/portfile.cmake +++ b/ports/libusb/portfile.cmake @@ -64,5 +64,11 @@ endif() vcpkg_fixup_pkgconfig() +# -Wl,-framework,... is poorly handled in CMake +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libusb-1.0.pc" " -Wl,-framework," " -framework " IGNORE_UNCHANGED) +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") diff --git a/ports/libusb/vcpkg.json b/ports/libusb/vcpkg.json index 0e16e0cccb..14424beee3 100644 --- a/ports/libusb/vcpkg.json +++ b/ports/libusb/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libusb", "version": "1.0.27", - "port-version": 1, + "port-version": 2, "description": "a cross-platform library to access USB devices", "homepage": "https://github.com/libusb/libusb", "license": "LGPL-2.1-or-later", diff --git a/scripts/test_ports/vcpkg-ci-libftdi1/portfile.cmake b/scripts/test_ports/vcpkg-ci-libftdi1/portfile.cmake new file mode 100644 index 0000000000..dd25706120 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libftdi1/portfile.cmake @@ -0,0 +1,10 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" +) +vcpkg_cmake_build() diff --git a/scripts/test_ports/vcpkg-ci-libftdi1/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-libftdi1/project/CMakeLists.txt new file mode 100644 index 0000000000..b067144754 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libftdi1/project/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.29) +project(libftdi1-test CXX) + +set(CMAKE_CXX_STANDARD 11) + +add_executable(main main.cpp) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(libftdipp1 IMPORTED_TARGET REQUIRED libftdipp1) +target_link_libraries(main PRIVATE PkgConfig::libftdipp1) + +# subdir to scope side effects +add_subdirectory(cmake-usage) diff --git a/scripts/test_ports/vcpkg-ci-libftdi1/project/cmake-usage/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-libftdi1/project/cmake-usage/CMakeLists.txt new file mode 100644 index 0000000000..2f1cca332e --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libftdi1/project/cmake-usage/CMakeLists.txt @@ -0,0 +1,6 @@ +# not modern +find_package(LIBFTDI1 NAMES LibFTDI1 REQUIRED) +include("${LIBFTDI_USE_FILE}") + +add_executable(cmake-usage ../main.cpp) +target_link_libraries(cmake-usage PRIVATE ${LIBFTDIPP_LIBRARIES}) diff --git a/scripts/test_ports/vcpkg-ci-libftdi1/project/main.cpp b/scripts/test_ports/vcpkg-ci-libftdi1/project/main.cpp new file mode 100644 index 0000000000..48c64a592a --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libftdi1/project/main.cpp @@ -0,0 +1,7 @@ +#include "ftdi.hpp" + +int main() +{ + auto *context = new Ftdi::Context(); + return 0; +} diff --git a/scripts/test_ports/vcpkg-ci-libftdi1/vcpkg.json b/scripts/test_ports/vcpkg-ci-libftdi1/vcpkg.json new file mode 100644 index 0000000000..dcb905ec86 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libftdi1/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "vcpkg-ci-libftdi1", + "version-string": "ci", + "description": "Validates libftdi1", + "dependencies": [ + { + "name": "libftdi1", + "features": [ + "cpp" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index d7ef6caa23..52a7ff1a69 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4514,7 +4514,7 @@ }, "libftdi1": { "baseline": "1.5", - "port-version": 4 + "port-version": 5 }, "libfuse": { "baseline": "3.16.2", @@ -5218,7 +5218,7 @@ }, "libusb": { "baseline": "1.0.27", - "port-version": 1 + "port-version": 2 }, "libusb-win32": { "baseline": "1.2.6.0", diff --git a/versions/l-/libftdi1.json b/versions/l-/libftdi1.json index 9794117a3f..30471ede4d 100644 --- a/versions/l-/libftdi1.json +++ b/versions/l-/libftdi1.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6142799716042c18d993c9624ca8675d32cf97df", + "version": "1.5", + "port-version": 5 + }, { "git-tree": "ef6feb3ad01d1d2483c5a369fd4e6bf3587ff52d", "version": "1.5", diff --git a/versions/l-/libusb.json b/versions/l-/libusb.json index 84429d77f6..6f22894009 100644 --- a/versions/l-/libusb.json +++ b/versions/l-/libusb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0f2e2537b1adc23e54eb130e497433f0c377d7b4", + "version": "1.0.27", + "port-version": 2 + }, { "git-tree": "da092fa023f47e3307d55a85bafb31a9c801b715", "version": "1.0.27",