Skip to content

Commit

Permalink
[metis] Fix redefinition with msvc header file (#13778)
Browse files Browse the repository at this point in the history
Co-authored-by: Billy Robert O'Neal III <[email protected]>
  • Loading branch information
JackBoosY and BillyONeal authored Oct 13, 2020
1 parent 50fb30f commit a8ac019
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ports/metis/CONTROL
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions ports/metis/fix-INT_MIN_define.patch
Original file line number Diff line number Diff line change
@@ -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 <stdint.h>
+#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 <inttypes.h>
#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 <stdint.h>
+ #include <inttypes.h>
#include "ms_stat.h"
#else
#ifndef SUNOS
5 changes: 2 additions & 3 deletions ports/metis/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
set(OPTIONS -DSHARED=OFF)

Expand All @@ -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(
Expand All @@ -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)

0 comments on commit a8ac019

Please sign in to comment.