aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Horvát <szhorvat@gmail.com>2021-04-30 00:43:20 +0200
committerGitHub <noreply@github.com>2021-04-29 15:43:20 -0700
commit90e7eaf82432f9cafbf9fc4c7fb4565a6d3f30fd (patch)
treeed194170fcff074365bd3349c4b7d48b8201b1c2
parent2f03bdc3f03f9c50f5d73e4601aaefa2402c8dce (diff)
downloadvcpkg-90e7eaf82432f9cafbf9fc4c7fb4565a6d3f30fd.tar.gz
vcpkg-90e7eaf82432f9cafbf9fc4c7fb4565a6d3f30fd.zip
[igraph] create new port (#17311)
* [igraph] create new port * [igraph] commit x-add-version result * [igraph] fix formatting * Update ports/igraph/portfile.cmake Co-authored-by: Adam Johnson <AdamJohnso@gmail.com> * Update ports/igraph/portfile.cmake Co-authored-by: Adam Johnson <AdamJohnso@gmail.com> * Update ports/igraph/portfile.cmake Co-authored-by: Adam Johnson <AdamJohnso@gmail.com> * Update ports/igraph/portfile.cmake Co-authored-by: Adam Johnson <AdamJohnso@gmail.com> * [igraph] explain why we use the release tarball * [igraph] x-add-version * [igraph] workaround for MSVC security warnings * Disable some MSVC warnings * set up for cross-compilation * fixes * enable external CXSparse and fixes * final cleanup * vcpkg x-add-version igraph * Update ports/igraph/portfile.cmake * Update ports/igraph/portfile.cmake * Update ports/igraph/portfile.cmake * Update ports/igraph/vcpkg.json * x-add-version Co-authored-by: Adam Johnson <AdamJohnso@gmail.com> Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
-rw-r--r--ports/igraph/001_add_crt_secure_no_warnings.patch12
-rw-r--r--ports/igraph/arith_osx.h12
-rw-r--r--ports/igraph/arith_win32.h8
-rw-r--r--ports/igraph/arith_win64.h9
-rw-r--r--ports/igraph/portfile.cmake63
-rw-r--r--ports/igraph/vcpkg.json20
-rw-r--r--versions/baseline.json4
-rw-r--r--versions/i-/igraph.json9
8 files changed, 137 insertions, 0 deletions
diff --git a/ports/igraph/001_add_crt_secure_no_warnings.patch b/ports/igraph/001_add_crt_secure_no_warnings.patch
new file mode 100644
index 000000000..a138a53de
--- /dev/null
+++ b/ports/igraph/001_add_crt_secure_no_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/etc/cmake/compilers.cmake b/etc/cmake/compilers.cmake
+index 3aabff4cb..97c01e545 100644
+--- a/etc/cmake/compilers.cmake
++++ b/etc/cmake/compilers.cmake
+@@ -2,6 +2,7 @@ include(CheckCCompilerFlag)
+
+ if(MSVC)
+ add_compile_options(/FS)
++ add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
+ endif()
+
+ if (NOT MSVC)
diff --git a/ports/igraph/arith_osx.h b/ports/igraph/arith_osx.h
new file mode 100644
index 000000000..2baafd68a
--- /dev/null
+++ b/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/ports/igraph/arith_win32.h b/ports/igraph/arith_win32.h
new file mode 100644
index 000000000..ecb90c8dc
--- /dev/null
+++ b/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/ports/igraph/arith_win64.h b/ports/igraph/arith_win64.h
new file mode 100644
index 000000000..e619583b7
--- /dev/null
+++ b/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/ports/igraph/portfile.cmake b/ports/igraph/portfile.cmake
new file mode 100644
index 000000000..87ac76966
--- /dev/null
+++ b/ports/igraph/portfile.cmake
@@ -0,0 +1,63 @@
+
+# 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/0.9.2/igraph-0.9.2.tar.gz"
+ FILENAME "igraph-0.9.2.tar.gz"
+ SHA512 8feb0c23c28e62f1e538fc41917e941f45421060b6240653ee03153b13551c454be019343a314b7913edb9c908518a131034c8e2098d9dd8e5c923fb84d195b3
+)
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ PATCHES 001_add_crt_secure_no_warnings.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ graphml IGRAPH_GRAPHML_SUPPORT
+)
+
+# Allow cross-compilation. See https://igraph.org/c/doc/igraph-Installation.html#idm207877354096
+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_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DIGRAPH_ENABLE_LTO=AUTO
+ # ARPACK not yet available in vcpkg.
+ -DIGRAPH_USE_INTERNAL_ARPACK=ON
+ # OpenBLAS provides BLAS/LAPACK but some tests fail with OpenBLAS on Windows.
+ # See https://github.com/igraph/igraph/issues/1491
+ -DIGRAPH_USE_INTERNAL_BLAS=ON
+ -DIGRAPH_USE_INTERNAL_LAPACK=ON
+ -DIGRAPH_USE_INTERNAL_CXSPARSE=OFF
+ # GLPK is not yet available in vcpkg.
+ -DIGRAPH_USE_INTERNAL_GLPK=ON
+ # Currently, external GMP provides no performance of functionality benefits.
+ -DIGRAPH_USE_INTERNAL_GMP=ON
+ -DF2C_EXTERNAL_ARITH_HEADER=${ARITH_H}
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_install_cmake()
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/igraph)
+
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/ports/igraph/vcpkg.json b/ports/igraph/vcpkg.json
new file mode 100644
index 000000000..451d942db
--- /dev/null
+++ b/ports/igraph/vcpkg.json
@@ -0,0 +1,20 @@
+{
+ "name": "igraph",
+ "version": "0.9.2",
+ "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/",
+ "dependencies": [
+ "suitesparse"
+ ],
+ "default-features": [
+ "graphml"
+ ],
+ "features": {
+ "graphml": {
+ "description": "Support for reading GraphML files",
+ "dependencies": [
+ "libxml2"
+ ]
+ }
+ }
+}
diff --git a/versions/baseline.json b/versions/baseline.json
index 2fd05cd8a..5ab3dbdff 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2584,6 +2584,10 @@
"baseline": "9.0.0",
"port-version": 0
},
+ "igraph": {
+ "baseline": "0.9.2",
+ "port-version": 0
+ },
"iir1": {
"baseline": "1.8.0",
"port-version": 0
diff --git a/versions/i-/igraph.json b/versions/i-/igraph.json
new file mode 100644
index 000000000..5db5b6ad6
--- /dev/null
+++ b/versions/i-/igraph.json
@@ -0,0 +1,9 @@
+{
+ "versions": [
+ {
+ "git-tree": "c2c35718e43fc23a6187173b49c19b11b8a89fdd",
+ "version": "0.9.2",
+ "port-version": 0
+ }
+ ]
+}