-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vcpkg baseline][infoware][pciids] Update infoware and add new port p…
…ciids (#31388) * [infoware] Update * Fix cross builds * Update 'supports' * [pciids] New helper port * Remove obsolete comment
- Loading branch information
Showing
10 changed files
with
135 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 $<TARGET_FILE:infoware_pci_generator> "${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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include("${CMAKE_CURRENT_LIST_DIR}/acquire_pciids.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "ffc7c82fb249347c25b294b6c8131e1f3b2156c2", | ||
"version-date": "2023-04-11", | ||
"port-version": 0 | ||
} | ||
] | ||
} |