aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-03-05 13:58:02 -0800
committerGitHub <noreply@github.com>2020-03-05 13:58:02 -0800
commit961378b1cbabe74b65886578ccb2d5bad215a70b (patch)
tree0b35b42e287d0aec12332e41daffd81c56a95b35
parent8cd675cc58ee71cae251d7d15fad5dc8b40d5fe1 (diff)
downloadvcpkg-961378b1cbabe74b65886578ccb2d5bad215a70b.tar.gz
vcpkg-961378b1cbabe74b65886578ccb2d5bad215a70b.zip
[Polymorphic-value] Add new port (#10267)
* add polymorphic_value * make head work * fix the config file * address polymorphic_value review comments * use ${PORT} instead of literal name
-rw-r--r--ports/polymorphic-value/001_no_catch_submodule.patch33
-rw-r--r--ports/polymorphic-value/002_fixed_config.patch14
-rw-r--r--ports/polymorphic-value/CONTROL4
-rw-r--r--ports/polymorphic-value/portfile.cmake32
4 files changed, 83 insertions, 0 deletions
diff --git a/ports/polymorphic-value/001_no_catch_submodule.patch b/ports/polymorphic-value/001_no_catch_submodule.patch
new file mode 100644
index 000000000..8fec58a76
--- /dev/null
+++ b/ports/polymorphic-value/001_no_catch_submodule.patch
@@ -0,0 +1,33 @@
+diff --git C:/Users/Charles Barto/Source/vcpkg/buildtrees/polymorphic-value/src/1.3.0-33dc249788/CMakeLists.txt C:/Users/Charles Barto/patched_list.txt
+index 2819bf6a4..0ee5fba76 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -9,9 +9,9 @@ set(POLYMOPHIC_VALUE_VERSION "1.3.0") # Revision 3, see paper p0201r3
+ project(polymorphic_value VERSION ${POLYMOPHIC_VALUE_VERSION})
+
+ option(ENABLE_SANITIZERS "Enable Address Sanitizer and Undefined Behaviour Sanitizer if available" OFF)
+-
++if(BUILD_TESTING)
+ add_subdirectory(externals/catch)
+-
++endif()
+ add_library(polymorphic_value INTERFACE)
+ target_include_directories(polymorphic_value
+ INTERFACE
+@@ -45,6 +45,7 @@ target_compile_features(polymorphic_value
+ add_library(polymorphic_value::polymorphic_value ALIAS polymorphic_value)
+
+ if(POLYMORPHIC_IS_NOT_SUBPROJECT)
++ if(BUILD_TESTING)
+ add_executable(test_polymorphic_value test_polymorphic_value.cpp)
+ target_link_libraries(test_polymorphic_value
+ PRIVATE
+@@ -107,7 +108,7 @@ if(POLYMORPHIC_IS_NOT_SUBPROJECT)
+ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/externals/catch/contrib)
+ include(Catch)
+ catch_discover_tests(test_polymorphic_value)
+-
++ endif()
+ install(
+ FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/polymorphic_value.h"
diff --git a/ports/polymorphic-value/002_fixed_config.patch b/ports/polymorphic-value/002_fixed_config.patch
new file mode 100644
index 000000000..77a99b058
--- /dev/null
+++ b/ports/polymorphic-value/002_fixed_config.patch
@@ -0,0 +1,14 @@
+diff --git a/./broken_config.cmake.in b/./fixed_config.cmake.in
+index e64f8a20f..38c441451 100644
+--- a/polymorphic_value-config.cmake.in
++++ b/polymorphic_value-config.cmake.in
+@@ -1,5 +1,7 @@
+ @PACKAGE_INIT@
+
+-set_and_check(POLYMORPHIC_VALUE_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
+
+-check_required_components(Foo)
++
++check_required_components(polymorphic_value)
++
++include(${CMAKE_CURRENT_LIST_DIR}/polymorphic_value-target.cmake)
diff --git a/ports/polymorphic-value/CONTROL b/ports/polymorphic-value/CONTROL
new file mode 100644
index 000000000..1016ead69
--- /dev/null
+++ b/ports/polymorphic-value/CONTROL
@@ -0,0 +1,4 @@
+Source: polymorphic-value
+Version: 1.3.0-1
+Description: A polymorphic value-type for C++
+Homepage: https://github.com/jbcoe/polymorphic_value
diff --git a/ports/polymorphic-value/portfile.cmake b/ports/polymorphic-value/portfile.cmake
new file mode 100644
index 000000000..5a03c827b
--- /dev/null
+++ b/ports/polymorphic-value/portfile.cmake
@@ -0,0 +1,32 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO jbcoe/polymorphic_value
+ REF 1.3.0
+ SHA512 67d49933c46d2a2bccb68c65c6f28b92603e193c68ff434b2c6b1602a573855a176fc98227d85cd24a64ae9299461adb42e792b4f165482bb250488620161742
+ HEAD_REF master
+ PATCHES 001_no_catch_submodule.patch
+ 002_fixed_config.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DBUILD_TESTING=OFF
+)
+
+vcpkg_install_cmake()
+if(VCPKG_HEAD_VERSION)
+ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/polymorphic_value TARGET_PATH share/polymorphic_value)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
+else()
+ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/polymorphic_value)
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/LICENSE.txt")
+endif()
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
+file(
+ INSTALL ${SOURCE_PATH}/LICENSE.txt
+ DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
+ RENAME copyright
+)
+