From a8ac019a32a734c9329c09929832e70f17b157a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Tue, 13 Oct 2020 16:20:22 -0700 Subject: [metis] Fix redefinition with msvc header file (#13778) Co-authored-by: Billy Robert O'Neal III --- ports/metis/CONTROL | 3 ++- ports/metis/fix-INT_MIN_define.patch | 34 ++++++++++++++++++++++++++++++++++ ports/metis/portfile.cmake | 5 ++--- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 ports/metis/fix-INT_MIN_define.patch diff --git a/ports/metis/CONTROL b/ports/metis/CONTROL index c47b9d85e..8feca5689 100644 --- a/ports/metis/CONTROL +++ b/ports/metis/CONTROL @@ -1,4 +1,5 @@ Source: metis -Version: 5.1.0-6 +Version: 5.1.0 +Port-Version: 7 Homepage: https://glaros.dtc.umn.edu/gkhome/metis/metis/overview Description: Serial Graph Partitioning and Fill-reducing Matrix Ordering diff --git a/ports/metis/fix-INT_MIN_define.patch b/ports/metis/fix-INT_MIN_define.patch new file mode 100644 index 000000000..97d7881f5 --- /dev/null +++ b/ports/metis/fix-INT_MIN_define.patch @@ -0,0 +1,34 @@ +diff --git a/include/metis.h b/include/metis.h +index dc5406a..7732437 100644 +--- a/include/metis.h ++++ b/include/metis.h +@@ -72,10 +72,14 @@ typedef __int64 int64_t; + #define PRId64 "I64d" + #define SCNd32 "ld" + #define SCNd64 "I64d" ++#ifdef _WIN32 ++#include ++#else + #define INT32_MIN ((int32_t)_I32_MIN) + #define INT32_MAX _I32_MAX + #define INT64_MIN ((int64_t)_I64_MIN) + #define INT64_MAX _I64_MAX ++#endif + #else + #include + #endif +diff --git a/GKlib/gk_arch.h b/GKlib/gk_arch.h +index 78b1431..7258763 100644 +--- a/GKlib/gk_arch.h ++++ b/GKlib/gk_arch.h +@@ -32,8 +32,8 @@ + + + #ifdef __MSC__ +- #include "ms_stdint.h" +- #include "ms_inttypes.h" ++ #include ++ #include + #include "ms_stat.h" + #else + #ifndef SUNOS diff --git a/ports/metis/portfile.cmake b/ports/metis/portfile.cmake index 1ba641bcb..07f5d0257 100644 --- a/ports/metis/portfile.cmake +++ b/ports/metis/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) set(OPTIONS -DSHARED=OFF) @@ -23,6 +21,7 @@ vcpkg_extract_source_archive_ex( fix-gklib-vs14-math.patch fix-linux-build-error.patch install-metisConfig.patch + fix-INT_MIN_define.patch ) vcpkg_configure_cmake( @@ -39,4 +38,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/metis) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/metis/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/metis/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -- cgit v1.2.3