From 3d04b3819bac21e51d3087e6f098c53b554f3fde Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 15 May 2023 23:09:58 +0200 Subject: [PATCH] [vcpkg baseline][infoware][pciids] Update infoware and add new port pciids (#31388) * [infoware] Update * Fix cross builds * Update 'supports' * [pciids] New helper port * Remove obsolete comment --- ports/infoware/cross-build.diff | 31 +++++++++++++++++++++++ ports/infoware/portfile.cmake | 35 +++++++++++++++---------- ports/infoware/vcpkg.json | 38 ++++++++++++++++++++++------ ports/pciids/acquire_pciids.cmake | 9 +++++++ ports/pciids/portfile.cmake | 15 +++++++++++ ports/pciids/vcpkg-port-config.cmake | 1 + ports/pciids/vcpkg.json | 8 ++++++ versions/baseline.json | 8 ++++-- versions/i-/infoware.json | 5 ++++ versions/p-/pciids.json | 9 +++++++ 10 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 ports/infoware/cross-build.diff create mode 100644 ports/pciids/acquire_pciids.cmake create mode 100644 ports/pciids/portfile.cmake create mode 100644 ports/pciids/vcpkg-port-config.cmake create mode 100644 ports/pciids/vcpkg.json create mode 100644 versions/p-/pciids.json diff --git a/ports/infoware/cross-build.diff b/ports/infoware/cross-build.diff new file mode 100644 index 00000000000000..bfff45b6c46e6f --- /dev/null +++ b/ports/infoware/cross-build.diff @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 580df83..ac89904 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -93,6 +93,8 @@ if(INFOWARE_PCI_IDS_PATH) + message(WARNING "The specified pci.ids file INFOWARE_PCI_IDS_PATH=${INFOWARE_PCI_IDS_PATH} doesn't seem to exist.") + endif() + set(infoware_pci_ids_file "${INFOWARE_PCI_IDS_PATH}") ++elseif(HOST_PCI_DATA) ++ # git unused + elseif(NOT Git_FOUND) + message(SEND_ERROR "Couldn't find a usable git executable in the environment, and the CMake variable INFOWARE_PCI_IDS_PATH is empty.\n${infoware_pci_ids_error}") + else() +@@ -122,11 +124,17 @@ set_target_properties(infoware_pci_generator PROPERTIES CXX_STANDARD 14 + set(INFOWARE_PCI_DATA_HPP pci_data.hpp) + set(INFOWARE_PCI_DATA_GEN "infoware_generated/${INFOWARE_PCI_DATA_HPP}") + ++if(HOST_PCI_DATA) ++ set_target_properties(infoware_pci_generator PROPERTIES EXCLUDE_FROM_ALL 1) ++ configure_file("${HOST_PCI_DATA}" "${CMAKE_CURRENT_BINARY_DIR}/${INFOWARE_PCI_DATA_GEN}" COPYONLY) ++else() ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${INFOWARE_PCI_DATA_GEN}" DESTINATION "share/infoware") + add_custom_command(OUTPUT ${INFOWARE_PCI_DATA_GEN} + COMMAND ${CMAKE_COMMAND} -E make_directory infoware_generated/ + COMMAND $ "${infoware_pci_ids_file}" > "infoware_generated/pci_data.hpp" + DEPENDS "${infoware_pci_ids_file}" + COMMENT "Generating ${INFOWARE_PCI_DATA_HPP}") ++endif() + + add_custom_target(infoware_generate_pcis DEPENDS "${INFOWARE_PCI_DATA_GEN}") + add_dependencies(infoware infoware_generate_pcis) diff --git a/ports/infoware/portfile.cmake b/ports/infoware/portfile.cmake index 2e0d4bdaba3d98..7b36bd1074ad49 100644 --- a/ports/infoware/portfile.cmake +++ b/ports/infoware/portfile.cmake @@ -1,36 +1,43 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ThePhD/infoware - REF 50cb0982aceb32c8eb57aa6bc5011aced2c379df - SHA512 fe8182998a9e9dbed3dc3985a1161da11b340562628a71da8840aa4d4c56382ddc3ddef3d094e5d9c7c06481a2076dcff7fdb561bd169dd9d1849da4b4c6a064 + REF d64a0c948593c0555115f60c79225c0b9ae09510 + SHA512 3794cb78a1422bfc065037abbae81259e6061ba7b12ebd7b88581118e8eeebaf92d80cf7793b0f9f1da6754baf52835a6891663593dd0b0a38009a9cb141082b HEAD_REF master + PATCHES + cross-build.diff ) vcpkg_check_features( OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES - x11 INFOWARE_USE_X11 - d3d INFOWARE_USE_D3D - opencl INFOWARE_USE_OPENCL - opengl INFOWARE_USE_OPENGL + d3d INFOWARE_USE_D3D + opencl INFOWARE_USE_OPENCL + opengl INFOWARE_USE_OPENGL + x11 INFOWARE_USE_X11 ) -# git must be injected, because vcpkg isolates the build -# from the environment entirely to have reproducible builds -vcpkg_find_acquire_program(GIT) +if(VCPKG_CROSSCOMPILING) + list(APPEND FEATURE_OPTIONS "-DHOST_PCI_DATA=${CURRENT_HOST_INSTALLED_DIR}/share/${PORT}/pci_data.hpp") +else() + acquire_pciids(pciids_path) + list(APPEND FEATURE_OPTIONS "-DINFOWARE_PCI_IDS_PATH=${pciids_path}") +endif() vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} -DINFOWARE_EXAMPLES=OFF -DINFOWARE_TESTS=OFF - -DGIT_EXECUTABLE=${GIT} - -DGIT_FOUND=true + -DCMAKE_DISABLE_FIND_PACKAGE_Git=1 ) vcpkg_cmake_install() vcpkg_cmake_config_fixup() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" +) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/infoware/vcpkg.json b/ports/infoware/vcpkg.json index 1836379c9344fb..db5414359351fe 100644 --- a/ports/infoware/vcpkg.json +++ b/ports/infoware/vcpkg.json @@ -1,12 +1,19 @@ { - "$reason": "Note that independent usage and testing may work, but it seems to fail in CI environments for potential cross-compilation, and is thusly noted here to note break how vcpkg builds things!", "name": "infoware", - "version-date": "2021-06-16", - "port-version": 1, + "version-date": "2023-04-12", "description": "C++ Library for pulling system and hardware information, without hitting the command line.", "homepage": "https://github.com/ThePhD/infoware", - "supports": "!(arm | uwp)", + "license": "CC0-1.0", + "supports": "!android & !uwp & !(windows & arm)", "dependencies": [ + { + "name": "infoware", + "host": true + }, + { + "name": "pciids", + "platform": "native" + }, { "name": "vcpkg-cmake", "host": true @@ -18,16 +25,31 @@ ], "features": { "d3d": { - "description": "Prefer usage of Direct3D to find graphical capabilities (typically only works on Windows systems)." + "description": [ + "Use Direct3D for GPU detection.", + "This choice has priority over opencl and opengl." + ], + "supports": "windows" }, "opencl": { - "description": "Prefer usage of OpenCL to find graphical capabilities of the system." + "description": [ + "Use OpenCL for GPU detection.", + "This choice has priority over opengl." + ], + "dependencies": [ + "opencl" + ] }, "opengl": { - "description": "Prefer usage of OpenGL to find graphical capabilities (may require additional libraries to be available for linking depending on the system)." + "description": "Use OpenGL for GPU detection.", + "supports": "!osx & !ios", + "dependencies": [ + "opengl" + ] }, "x11": { - "description": "Prefer usage of X11 to find graphical capabilities." + "description": "Use X11 for display detection.", + "supports": "!windows" } } } diff --git a/ports/pciids/acquire_pciids.cmake b/ports/pciids/acquire_pciids.cmake new file mode 100644 index 00000000000000..6f8e8ec2b72c53 --- /dev/null +++ b/ports/pciids/acquire_pciids.cmake @@ -0,0 +1,9 @@ +function(acquire_pciids out_var) + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pciutils/pciids + REF 4e3f51b4b7ba7ffd3cca463d6a19daf0f4270252 + SHA512 952b56affffdf9ecf78f6125cf4216bd01d85c55e49ec4b2dfb3a77bae2258dec6b4e2d28824d6408f072667480ef7e5f7279fd69bae65c071b7b3816fe9f504 + ) + set(${out_var} "${SOURCE_PATH}/pci.ids" PARENT_SCOPE) +endfunction() diff --git a/ports/pciids/portfile.cmake b/ports/pciids/portfile.cmake new file mode 100644 index 00000000000000..200ee48c0263c0 --- /dev/null +++ b/ports/pciids/portfile.cmake @@ -0,0 +1,15 @@ +# This package doesn't "install" the pciids data file but +# provides a maintainer function which does the download. + +set(VCPKG_POLICY_CMAKE_HELPER_PORT enabled) + +include("${CMAKE_CURRENT_LIST_DIR}/acquire_pciids.cmake") +acquire_pciids(pciids_path) +cmake_path(GET pciids_path PARENT_PATH pciids_dir) + +file(INSTALL + "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" + "${CMAKE_CURRENT_LIST_DIR}/acquire_pciids.cmake" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" +) +vcpkg_install_copyright(FILE_LIST "${pciids_dir}/README") diff --git a/ports/pciids/vcpkg-port-config.cmake b/ports/pciids/vcpkg-port-config.cmake new file mode 100644 index 00000000000000..9945df984cce5f --- /dev/null +++ b/ports/pciids/vcpkg-port-config.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/acquire_pciids.cmake") diff --git a/ports/pciids/vcpkg.json b/ports/pciids/vcpkg.json new file mode 100644 index 00000000000000..edcb67c193b456 --- /dev/null +++ b/ports/pciids/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "pciids", + "version-date": "2023-04-11", + "description": "Maintainer function to acquire a PCI ID Repository database snapshot", + "homepage": "https://pci-ids.ucw.cz/", + "license": "GPL-2.0-or-later OR BSD-3-Clause", + "supports": "native" +} diff --git a/versions/baseline.json b/versions/baseline.json index 020b12662f27bd..e2aac72b7a3a81 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3325,8 +3325,8 @@ "port-version": 0 }, "infoware": { - "baseline": "2021-06-16", - "port-version": 1 + "baseline": "2023-04-12", + "port-version": 0 }, "inih": { "baseline": "56", @@ -6124,6 +6124,10 @@ "baseline": "2021-04-06", "port-version": 2 }, + "pciids": { + "baseline": "2023-04-11", + "port-version": 0 + }, "pcl": { "baseline": "1.13.0", "port-version": 3 diff --git a/versions/i-/infoware.json b/versions/i-/infoware.json index 7c148d6b7332f6..1adf69d0776b65 100644 --- a/versions/i-/infoware.json +++ b/versions/i-/infoware.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "10ceed518afc0c84b79aa36c1263a034b320511e", + "version-date": "2023-04-12", + "port-version": 0 + }, { "git-tree": "5501ab1b5d5391ca168856f073f6a46d5ea83268", "version-date": "2021-06-16", diff --git a/versions/p-/pciids.json b/versions/p-/pciids.json new file mode 100644 index 00000000000000..970dd93e6a342d --- /dev/null +++ b/versions/p-/pciids.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "ffc7c82fb249347c25b294b6c8131e1f3b2156c2", + "version-date": "2023-04-11", + "port-version": 0 + } + ] +}