aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Phantom Derpstorm <phdofthehouse@gmail.com>2020-06-12 02:32:03 -0400
committerGitHub <noreply@github.com>2020-06-11 23:32:03 -0700
commit250e35a961f6faea691e2266613e671a61bb3ab6 (patch)
tree6a24c29a4b6585b7fd7e743b0882aeb35a3c4b61
parentb97fe822f5e59fbf6b93fd9c97794dddc1d8b9f0 (diff)
downloadvcpkg-250e35a961f6faea691e2266613e671a61bb3ab6.tar.gz
vcpkg-250e35a961f6faea691e2266613e671a61bb3ab6.zip
[infoware] Add port of infoware library (#11410)
* Improved infoware and portfile port * Add a note for why we do this. * Add vcpkg_fail_port_install call requested by @PhoebeHui Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
-rw-r--r--ports/infoware/CONTROL19
-rw-r--r--ports/infoware/portfile.cmake38
2 files changed, 57 insertions, 0 deletions
diff --git a/ports/infoware/CONTROL b/ports/infoware/CONTROL
new file mode 100644
index 000000000..90b7d6532
--- /dev/null
+++ b/ports/infoware/CONTROL
@@ -0,0 +1,19 @@
+Source: infoware
+Homepage: https://github.com/ThePhD/infoware
+Version: 0.5.3
+Description: C++ Library for pulling system and hardware information, without hitting the command line.
+# 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!
+Supports: !(arm|uwp)
+
+Feature: x11
+Description: Prefer usage of X11 to find graphical capabilities.
+
+Feature: d3d
+Description: Prefer usage of Direct3D to find graphical capabilities (typically only works on Windows systems).
+
+Feature: opencl
+Description: Prefer usage of OpenCL to find graphical capabilities of the system.
+
+Feature: opengl
+Description: Prefer usage of OpenGL to find graphical capabilities (may require additional libraries to be available for linking depending on the system).
diff --git a/ports/infoware/portfile.cmake b/ports/infoware/portfile.cmake
new file mode 100644
index 000000000..4b012954d
--- /dev/null
+++ b/ports/infoware/portfile.cmake
@@ -0,0 +1,38 @@
+vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ThePhD/infoware
+ REF v0.5.3
+ SHA512 217bb9332214d823445e19f2c465199536e89a36faccea8cb72f8dd41a177e1739969d131ad25d1878e688a3a6cc1290c2125ef9d2205ad4fd334b24b27d491a
+ HEAD_REF master
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ x11 INFOWARE_USE_X11
+ d3d INFOWARE_USE_D3D
+ opencl INFOWARE_USE_OPENCL
+ opengl INFOWARE_USE_OPENGL
+)
+
+# git must be injected, because vcpkg isolates the build
+# from the environment entirely to have reproducible builds
+vcpkg_find_acquire_program(GIT)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DINFOWARE_EXAMPLES=OFF
+ -DINFOWARE_TESTS=OFF
+ -DGIT_EXECUTABLE=${GIT}
+ -DGIT_FOUND=true
+)
+
+vcpkg_install_cmake()
+
+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/share")