aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/infoware
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/infoware
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/infoware')
-rw-r--r--vcpkg/ports/infoware/cross-build.diff31
-rw-r--r--vcpkg/ports/infoware/portfile.cmake43
-rw-r--r--vcpkg/ports/infoware/vcpkg.json55
3 files changed, 129 insertions, 0 deletions
diff --git a/vcpkg/ports/infoware/cross-build.diff b/vcpkg/ports/infoware/cross-build.diff
new file mode 100644
index 0000000..bfff45b
--- /dev/null
+++ b/vcpkg/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 $<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)
diff --git a/vcpkg/ports/infoware/portfile.cmake b/vcpkg/ports/infoware/portfile.cmake
new file mode 100644
index 0000000..7b36bd1
--- /dev/null
+++ b/vcpkg/ports/infoware/portfile.cmake
@@ -0,0 +1,43 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ThePhD/infoware
+ REF d64a0c948593c0555115f60c79225c0b9ae09510
+ SHA512 3794cb78a1422bfc065037abbae81259e6061ba7b12ebd7b88581118e8eeebaf92d80cf7793b0f9f1da6754baf52835a6891663593dd0b0a38009a9cb141082b
+ HEAD_REF master
+ PATCHES
+ cross-build.diff
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ d3d INFOWARE_USE_D3D
+ opencl INFOWARE_USE_OPENCL
+ opengl INFOWARE_USE_OPENGL
+ x11 INFOWARE_USE_X11
+)
+
+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}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DINFOWARE_EXAMPLES=OFF
+ -DINFOWARE_TESTS=OFF
+ -DCMAKE_DISABLE_FIND_PACKAGE_Git=1
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup()
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+)
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/infoware/vcpkg.json b/vcpkg/ports/infoware/vcpkg.json
new file mode 100644
index 0000000..db54143
--- /dev/null
+++ b/vcpkg/ports/infoware/vcpkg.json
@@ -0,0 +1,55 @@
+{
+ "name": "infoware",
+ "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",
+ "license": "CC0-1.0",
+ "supports": "!android & !uwp & !(windows & arm)",
+ "dependencies": [
+ {
+ "name": "infoware",
+ "host": true
+ },
+ {
+ "name": "pciids",
+ "platform": "native"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "d3d": {
+ "description": [
+ "Use Direct3D for GPU detection.",
+ "This choice has priority over opencl and opengl."
+ ],
+ "supports": "windows"
+ },
+ "opencl": {
+ "description": [
+ "Use OpenCL for GPU detection.",
+ "This choice has priority over opengl."
+ ],
+ "dependencies": [
+ "opencl"
+ ]
+ },
+ "opengl": {
+ "description": "Use OpenGL for GPU detection.",
+ "supports": "!osx & !ios",
+ "dependencies": [
+ "opengl"
+ ]
+ },
+ "x11": {
+ "description": "Use X11 for display detection.",
+ "supports": "!windows"
+ }
+ }
+}