aboutsummaryrefslogtreecommitdiff
path: root/ports/cgns
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2020-06-23 19:20:18 +0200
committerGitHub <noreply@github.com>2020-06-23 10:20:18 -0700
commit03766d0834c1ca8dea25ffafbe4fe1c60786a412 (patch)
treef1dfa6d4a06ed5129f12ce59296c50d2eb920fbb /ports/cgns
parentaef838536ea3a08e3c1030ead553ca6456cc7fe3 (diff)
downloadvcpkg-03766d0834c1ca8dea25ffafbe4fe1c60786a412.tar.gz
vcpkg-03766d0834c1ca8dea25ffafbe4fe1c60786a412.zip
[CGNS/ParaView] Add new ports (#9960)
* [cgns] add port cgns * [paraview] add new port * [paraview] correct dependencies; disable catalyst * [VTK/ParaView] Make ParaView build * [paraview] add missing patch * [paraview] add cgns patch * [paraview] add qt plugin patches back in. Remove in the future * [vtk] slightly improved patches * [vtk] don't disable findPython * [paraview] add more features * [paraview] remove X11Extras from OSX * [vtk] make vtk workcorrectly with python and prepare for paraview with python * [paraview] Python fixes * [paraview] small bin -> lib replacement fix for static builds * [vtk] fix patch path * update baseline to exclude paraview for the time being on osx and linux. requires a fix in qt5-base linkage of libpq. * [paraview]try setting LD_LIBRARY_PATH for unix systems * [paraview] a bit of cleanup * update baseline * fix typo in baseline * [paraview] remove unnecessary patch * [vtk] replace custom patch with upstream patch * [paraview] cleanup in the portfile. * Update ports/paraview/CONTROL Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Diffstat (limited to 'ports/cgns')
-rw-r--r--ports/cgns/CONTROL32
-rw-r--r--ports/cgns/cgnsconfig.h6
-rw-r--r--ports/cgns/defines.patch16
-rw-r--r--ports/cgns/hdf5.patch108
-rw-r--r--ports/cgns/linux_lfs.patch12
-rw-r--r--ports/cgns/portfile.cmake88
-rw-r--r--ports/cgns/zlib_szip_mpi.patch35
7 files changed, 297 insertions, 0 deletions
diff --git a/ports/cgns/CONTROL b/ports/cgns/CONTROL
new file mode 100644
index 000000000..3398bad14
--- /dev/null
+++ b/ports/cgns/CONTROL
@@ -0,0 +1,32 @@
+Source: cgns
+Version: 3.4.0-1
+Homepage: http://cgns.org/
+Description: The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations.
+Default-Features: hdf5, lfsselector
+
+Feature: mpi
+Description: Compile with support for the message passage interface (MPI)
+Build-Depends: hdf5[core,parallel]
+
+Feature: fortran
+Description: Enable fortran support (not yet implemented)
+
+Feature: tests
+Description: Build tests
+
+Feature: tools
+Description: Build tools
+
+Feature: hdf5
+Description: Enable hdf5 support
+Build-Depends: hdf5[core,tools]
+
+Feature: lfsselector
+Description: Selector for LFS
+Build-Depends: cgns[core,lfs] (!osx)
+
+Feature: lfs
+Description: Enable LFS support
+
+Feature: legacy
+Description: Enable legacy support
diff --git a/ports/cgns/cgnsconfig.h b/ports/cgns/cgnsconfig.h
new file mode 100644
index 000000000..7ebe18ac5
--- /dev/null
+++ b/ports/cgns/cgnsconfig.h
@@ -0,0 +1,6 @@
+#ifndef CGNSCONFIG_H
+#define CGNSCONFIG_H
+
+#include "cgnstypes.h"
+
+#endif \ No newline at end of file
diff --git a/ports/cgns/defines.patch b/ports/cgns/defines.patch
new file mode 100644
index 000000000..e17d48828
--- /dev/null
+++ b/ports/cgns/defines.patch
@@ -0,0 +1,16 @@
+diff --git a/src/cgnstypes.h.in b/src/cgnstypes.h.in
+index 98c4e7fdc..8c6bcea62 100644
+--- a/src/cgnstypes.h.in
++++ b/src/cgnstypes.h.in
+@@ -29,6 +29,11 @@
+ #ifndef CGNSTYPES_H
+ #define CGNSTYPES_H
+
++#define CG_BUILD_HDF5 @BUILDHDF5@
++#define CG_BUILD_FORTRAN @BUILDFORTRAN@
++#define CG_BUILD_PARALLEL @BUILDPARALLEL@
++#define CG_BUILD_BASESCOPE @BUILDBASESCOPE@
++
+ #define CG_BUILD_LEGACY @BUILDLEGACY@
+ #define CG_BUILD_64BIT @BUILD64BIT@
+ #define CG_BUILD_SCOPE @BUILDSCOPE@
diff --git a/ports/cgns/hdf5.patch b/ports/cgns/hdf5.patch
new file mode 100644
index 000000000..4de9ee35b
--- /dev/null
+++ b/ports/cgns/hdf5.patch
@@ -0,0 +1,108 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 58f078fe7..46446da8a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -194,71 +194,17 @@ endif (CGNS_ENABLE_FORTRAN AND HAS_FORTRAN)
+ option(CGNS_ENABLE_HDF5 "Enable or disable HDF5 interface" "OFF")
+ if (CGNS_ENABLE_HDF5)
+
+- if (CGNS_BUILD_SHARED)
+- set (FIND_HDF_COMPONENTS C shared)
+- else (CGNS_BUILD_SHARED)
+- set (FIND_HDF_COMPONENTS C static)
+- endif (CGNS_BUILD_SHARED)
+- message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}")
+-
+- #set (SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME})
+- set (SEARCH_PACKAGE_NAME "hdf5")
+-
+- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS})
+- message (STATUS "HDF5 C libs:${HDF5_FOUND} static:${HDF5_static_C_FOUND} and shared:${HDF5_shared_C_FOUND}")
+- if (HDF5_FOUND)
+- add_executable (h5dump IMPORTED)
+- if (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
+- set (FIND_HDF_COMPONENTS C)
+-
+- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS})
+- message (STATUS "HDF5 libs:${HDF5_FOUND} C:${HDF5_C_FOUND}")
+- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+- if (HDF5_BUILD_SHARED_LIBS)
+- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB)
+- else (HDF5_BUILD_SHARED_LIBS)
+- add_definitions (-DH5_BUILT_AS_STATIC_LIB)
+- endif (HDF5_BUILD_SHARED_LIBS)
+- if (BUILD_SHARED_LIBS AND WIN32)
+- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dumpdll")
+- else (BUILD_SHARED_LIBS AND WIN32)
+- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump")
+- endif (BUILD_SHARED_LIBS AND WIN32)
+- else (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
+- if (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND)
+- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_SHARED_LIBRARY})
+- else (HDF5_static_C_FOUND)
+- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY})
+- endif (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND)
+- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump")
+- endif (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
++ find_package(HDF5 CONFIG REQUIRED)
++ if(TARGET hdf5::hdf5-shared)
++ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-shared)
++ #add_executable(h5dump ALIAS hdf5::h5dump-shared)
++ set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump-shared>)
++ else()
++ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static)
++ #add_executable(h5dump ALIAS hdf5::h5dump)
+ set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump>)
+-
+- set (HDF5_HAVE_H5PUBCONF_H 1)
+- set (HDF5_HAVE_HDF5 1)
+- set (HDF5_HDF5_HEADER "h5pubconf.h")
+- set (HDF5_INCLUDE_DIR_GEN ${HDF5_INCLUDE_DIR})
+- message (STATUS "HDF5-${HDF5_VERSION_STRING} found: INC=${HDF5_INCLUDE_DIR} TOOLS=${HDF5_TOOLS_DIR}")
+- else (HDF5_FOUND)
+- find_package (HDF5) # Legacy find
+-#Legacy find_package does not set HDF5_TOOLS_DIR, so we set it here
+- set(HDF5_TOOLS_DIR ${HDF5_LIBRARY_DIRS}/../bin)
+-#Legacy find_package does not set HDF5_BUILD_SHARED_LIBS, so we set it here
+- if (CGNS_BUILD_SHARED AND EXISTS "${HDF5_LIBRARY_DIRS}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}")
+- set (HDF5_BUILD_SHARED_LIBS 1)
+- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB)
+- else ()
+- set (HDF5_BUILD_SHARED_LIBS 0)
+- add_definitions (-DH5_BUILT_AS_STATIC_LIB)
+- endif ()
+- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+-
+- add_executable (h5dump IMPORTED)
+- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump")
+- set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump>)
+- endif (HDF5_FOUND)
+- set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME})
+-
++ endif()
++
+ if (HDF5_FOUND)
+ set (HDF5_HAVE_H5PUBCONF_H 1)
+ set (HDF5_HAVE_HDF5 1)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 66b547ed1..4051f07d4 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -12,13 +12,14 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
+ if (CGNS_ENABLE_HDF5)
+ add_definitions(-DBUILD_HDF5)
+ if (WIN32)
+- if (HDF5_LIBRARY)
++ add_definitions(-DWIN32)
++ if (HDF5_BUILD_SHARED_LIBS)
+ # file(STRINGS ${HDF5_LIBRARY} HDF5isDLL REGEX "__imp__H5close")
+ # if (HDF5isDLL)
+ # this is only needed when using hdf5 dll libs
+- add_definitions(-DWIN32 -D_HDF5USEDLL_)
++ add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB)
+ # endif (HDF5isDLL)
+- endif (HDF5_LIBRARY)
++ endif (HDF5_BUILD_SHARED_LIBS)
+ endif (WIN32)
+ if(HDF5_NEED_MPI AND MPI_INC)
+ include_directories(${MPI_INC})
diff --git a/ports/cgns/linux_lfs.patch b/ports/cgns/linux_lfs.patch
new file mode 100644
index 000000000..3ccda64e2
--- /dev/null
+++ b/ports/cgns/linux_lfs.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 46446da8a..a3d8cd98f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -82,6 +82,7 @@ if (CGNS_ENABLE_LFS)
+ else (WIN32)
+ check_symbol_exists(open64 "sys/types.h;sys/stat.h;unistd.h" HAVE_OPEN64)
+ check_symbol_exists(lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64)
++ add_definitions(-D_FILE_OFFSET_BITS=64 -D__LARGEFILE64_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
+ endif (WIN32)
+ if (HAVE_OPEN64)
+ add_definitions(-DHAVE_OPEN64)
diff --git a/ports/cgns/portfile.cmake b/ports/cgns/portfile.cmake
new file mode 100644
index 000000000..39b65d55f
--- /dev/null
+++ b/ports/cgns/portfile.cmake
@@ -0,0 +1,88 @@
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO CGNS/CGNS
+ REF 3420e23febf0eb38c1b05af3c157d614d8476557 # v3.4.0
+ SHA512 3fec1c32f1514cd9bc327f12f3f9db6a229df05f514193bd9e913d06b8ae6465664410a3c77a30b0c29f3e999e5efcb1ebed3a8b80e14be92035940c10b1d6d7
+ HEAD_REF develop
+ PATCHES
+ hdf5.patch
+ linux_lfs.patch
+ zlib_szip_mpi.patch
+ defines.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ mpi HDF5_NEEDS_MPI
+ fortran CGNS_ENABLE_FORTRAN
+ tests CGNS_ENABLE_TESTS
+ hdf5 CGNS_ENABLE_HDF5
+ lfs CGNS_ENABLE_LFS
+ legacy CGNS_ENABLE_LEGACY
+)
+
+if(VCPKG_TARGET_ARCHITECTURE MATCHES "64")
+ list(APPEND CGNS_BUILD_OPTS "-DCGNS_ENABLE_64BIT=ON")
+endif()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ list(APPEND CGNS_BUILD_OPTS "-DCGNS_BUILD_SHARED=ON;-DCGNS_USE_SHARED=ON")
+else()
+ list(APPEND CGNS_BUILD_OPTS "-DCGNS_BUILD_SHARED=OFF;-DCGNS_USE_SHARED=OFF")
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA # Disable this option if project cannot be built with Ninja
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ ${CGNS_BUILD_OPTS}
+)
+
+vcpkg_install_cmake()
+
+file(INSTALL ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
+file(REMOVE ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/include/cgnsconfig.h)
+
+file(INSTALL ${CURRENT_PORT_DIR}/cgnsconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) # we patched the config and the include is all that is needed
+
+set(TOOLS cgnscheck cgnscompress cgnsconvert cgnsdiff cgnslist cgnsnames)
+
+foreach(tool ${TOOLS})
+ set(suffix ${VCPKG_TARGET_EXECUTABLE_SUFFIX})
+ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}")
+ endif()
+ if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
+ file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
+ endif()
+endforeach()
+
+vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
+
+IF(EXISTS ${CURRENT_PACKAGES_DIR}/debug)
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/debug/include/cgnsconfig.h)
+endif()
+
+file(REMOVE ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/include/cgnsconfig.h)
+file(GLOB_RECURSE BATCH_FILES ${CURRENT_PACKAGES_DIR}/bin/*.bat)
+
+vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
+
+# # Moves all .cmake files from /debug/share/cgns/ to /share/cgns/
+# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details
+# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/cgns)
+
+# # Handle copyright
+file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+
+# # Post-build test for cmake libraries
+# vcpkg_test_cmake(PACKAGE_NAME cgns)
diff --git a/ports/cgns/zlib_szip_mpi.patch b/ports/cgns/zlib_szip_mpi.patch
new file mode 100644
index 000000000..4f6608cf4
--- /dev/null
+++ b/ports/cgns/zlib_szip_mpi.patch
@@ -0,0 +1,35 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 46446da8a..cd05cf51a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -219,20 +221,10 @@ if (CGNS_ENABLE_HDF5)
+ endif (HDF5_FOUND)
+
+ set(HDF5_NEED_ZLIB "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?")
+- if(HDF5_NEED_ZLIB)
+- find_library(ZLIB_LIBRARY z)
+- mark_as_advanced(CLEAR ZLIB_LIBRARY)
+- else (HDF5_NEED_ZLIB)
+- mark_as_advanced(FORCE ZLIB_LIBRARY)
+- endif(HDF5_NEED_ZLIB)
++ set(HDF5_NEED_ZLIB ${HDF5_ENABLE_Z_LIB_SUPPORT} CACHE INTERNAL "" FORCE)
+
+ set(HDF5_NEED_SZIP "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?")
+- if (HDF5_NEED_SZIP)
+- find_library(SZIP_LIBRARY szip)
+- mark_as_advanced(CLEAR SZIP_LIBRARY)
+- else (HDF5_NEED_SZIP)
+- mark_as_advanced(FORCE SZIP_LIBRARY)
+- endif (HDF5_NEED_SZIP)
++ set(HDF5_NEED_SZIP ${HDF5_ENABLE_SZIP_SUPPORT} CACHE INTERNAL "" FORCE)
+
+ # Check if HDF5 version is 1.8 or greater
+ if (HDF5_VERSION VERSION_LESS "1.8.0")
+@@ -240,6 +231,7 @@ if (CGNS_ENABLE_HDF5)
+ endif (HDF5_VERSION VERSION_LESS "1.8.0")
+
+ set(HDF5_NEED_MPI "OFF" CACHE BOOL "Does the HDF5 library require linking to mpi? (Only true if using parallel HDF5)")
++ set(HDF5_NEED_MPI ${HDF5_ENABLE_PARALLEL} CACHE INTERNAL "" FORCE)
+ set(MPI_INC)
+ set(MPI_LIBS)
+ if (HDF5_NEED_MPI)