diff options
Diffstat (limited to 'vcpkg/ports/igraph')
| -rw-r--r-- | vcpkg/ports/igraph/arith_osx.h | 12 | ||||
| -rw-r--r-- | vcpkg/ports/igraph/arith_win32.h | 8 | ||||
| -rw-r--r-- | vcpkg/ports/igraph/arith_win64.h | 9 | ||||
| -rw-r--r-- | vcpkg/ports/igraph/constant-nan.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/igraph/glpk-uwp.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/igraph/portfile.cmake | 68 | ||||
| -rw-r--r-- | vcpkg/ports/igraph/vcpkg.json | 34 |
7 files changed, 156 insertions, 0 deletions
diff --git a/vcpkg/ports/igraph/arith_osx.h b/vcpkg/ports/igraph/arith_osx.h new file mode 100644 index 0000000..2baafd6 --- /dev/null +++ b/vcpkg/ports/igraph/arith_osx.h @@ -0,0 +1,12 @@ +/* Suitable for macOS on x86_64 and arm64 */ +/* Not suitable for 32-bit macOS */ + +#define IEEE_8087 +#define Arith_Kind_ASL 1 +#define Long int +#define Intcast (int)(long) +#define Double_Align +#define X64_bit_pointers +#define NANCHECK +#define QNaN0 0x0 +#define QNaN1 0x7ff80000 diff --git a/vcpkg/ports/igraph/arith_win32.h b/vcpkg/ports/igraph/arith_win32.h new file mode 100644 index 0000000..ecb90c8 --- /dev/null +++ b/vcpkg/ports/igraph/arith_win32.h @@ -0,0 +1,8 @@ +/* Windows 32-bit */ + +#define IEEE_8087 +#define Arith_Kind_ASL 1 +#define Double_Align +#define NANCHECK +#define QNaN0 0x0 +#define QNaN1 0x7ff80000 diff --git a/vcpkg/ports/igraph/arith_win64.h b/vcpkg/ports/igraph/arith_win64.h new file mode 100644 index 0000000..e619583 --- /dev/null +++ b/vcpkg/ports/igraph/arith_win64.h @@ -0,0 +1,9 @@ +/* Windows 64-bit */ + +#define IEEE_8087 +#define Arith_Kind_ASL 1 +#define Double_Align +#define X64_bit_pointers +#define NANCHECK +#define QNaN0 0x0 +#define QNaN1 0x7ff80000 diff --git a/vcpkg/ports/igraph/constant-nan.patch b/vcpkg/ports/igraph/constant-nan.patch new file mode 100644 index 0000000..83c2d2c --- /dev/null +++ b/vcpkg/ports/igraph/constant-nan.patch @@ -0,0 +1,12 @@ +diff --git a/vendor/plfit/hzeta.c b/vendor/plfit/hzeta.c +index d8f9a6d..4ef8d5d 100644 +--- a/vendor/plfit/hzeta.c ++++ b/vendor/plfit/hzeta.c +@@ -43,6 +43,7 @@ + /* Author: Jerome G. Benoit < jgmbenoit _at_ rezozer _dot_ net > */ + + #ifdef _MSC_VER ++#define _UCRT_NOISY_NAN + #define _USE_MATH_DEFINES + #endif + diff --git a/vcpkg/ports/igraph/glpk-uwp.patch b/vcpkg/ports/igraph/glpk-uwp.patch new file mode 100644 index 0000000..7bee3ae --- /dev/null +++ b/vcpkg/ports/igraph/glpk-uwp.patch @@ -0,0 +1,13 @@ +diff --git a/vendor/glpk/env/dlsup.c b/vendor/glpk/env/dlsup.c +index 741354475..968a794b7 100644 +--- a/vendor/glpk/env/dlsup.c ++++ b/vendor/glpk/env/dlsup.c +@@ -25,6 +25,8 @@ + + #include "env.h" + ++#undef __WOE__ ++ + /* GNU version ********************************************************/ + + #if defined(HAVE_LTDL) diff --git a/vcpkg/ports/igraph/portfile.cmake b/vcpkg/ports/igraph/portfile.cmake new file mode 100644 index 0000000..95b5bcc --- /dev/null +++ b/vcpkg/ports/igraph/portfile.cmake @@ -0,0 +1,68 @@ + +# We use the release tarball from GitHub instead of the sources in the repo because: +# - igraph will not compile from the git sources unless there is an actual git repository to back it. This is because it detects the version from git tags. The release tarball has the version hard-coded. +# - The release tarball contains pre-generated parser sources, which eliminates the dependency on bison/flex. + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/igraph/igraph/releases/download/${VERSION}/igraph-${VERSION}.tar.gz" + FILENAME "igraph-${VERSION}.tar.gz" + SHA512 2a2b7930adf9cf9de550e1a1348260e0c58e4d8b387cb7b6805aad2d501272cd846d1948bde9f6cc0432d904e6b1fb1f17e5e8c81f5bd146aef2560b7a7042c8 +) + +vcpkg_extract_source_archive( + SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + "glpk-uwp.patch" # patch GLPK for UWP compatibility + "constant-nan.patch" # Workaround https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907 +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + graphml IGRAPH_GRAPHML_SUPPORT + openmp IGRAPH_OPENMP_SUPPORT +) + +# Allow cross-compilation. See https://igraph.org/c/html/latest/igraph-Installation.html#igraph-Installation-cross-compiling +set(ARITH_H "") +if (VCPKG_TARGET_IS_OSX) + set(ARITH_H ${CURRENT_PORT_DIR}/arith_osx.h) +elseif (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) + if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(ARITH_H ${CURRENT_PORT_DIR}/arith_win32.h) + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(ARITH_H ${CURRENT_PORT_DIR}/arith_win64.h) + endif() +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DIGRAPH_ENABLE_LTO=AUTO + # ARPACK not yet available in vcpkg. + -DIGRAPH_USE_INTERNAL_ARPACK=ON + # GLPK is not yet available in vcpkg. + -DIGRAPH_USE_INTERNAL_GLPK=ON + # Currently, external GMP provides no performance or functionality benefits. + -DIGRAPH_USE_INTERNAL_GMP=ON + # PLFIT is not yet available in vcpkg. + -DIGRAPH_USE_INTERNAL_PLFIT=ON + # Use BLAS and LAPACK from vcpkg + -DIGRAPH_USE_INTERNAL_BLAS=OFF + -DIGRAPH_USE_INTERNAL_LAPACK=OFF + -DF2C_EXTERNAL_ARITH_HEADER=${ARITH_H} + -DIGRAPH_WARNINGS_AS_ERRORS=OFF + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/igraph) + +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +vcpkg_fixup_pkgconfig() diff --git a/vcpkg/ports/igraph/vcpkg.json b/vcpkg/ports/igraph/vcpkg.json new file mode 100644 index 0000000..57ce45c --- /dev/null +++ b/vcpkg/ports/igraph/vcpkg.json @@ -0,0 +1,34 @@ +{ + "name": "igraph", + "version": "1.0.0", + "description": "igraph is a C library for network analysis and graph theory, with an emphasis on efficiency portability and ease of use.", + "homepage": "https://igraph.org/", + "license": "GPL-2.0-or-later", + "supports": "!xbox", + "dependencies": [ + "blas", + "lapack", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "graphml" + ], + "features": { + "graphml": { + "description": "Support for reading GraphML files", + "dependencies": [ + "libxml2" + ] + }, + "openmp": { + "description": "Use OpenMP parallelization in some functions" + } + } +} |