diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-10-17 02:05:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-17 02:05:12 -0700 |
| commit | 32c5722104fc28cd55d166a2c04e1d44906eec68 (patch) | |
| tree | 7c688990b7f6b50f119ef88c746c3ac2e1897a0b | |
| parent | 0b5b24698f08f6f4ca0ef984b2ae9d6a6ba0d7a6 (diff) | |
| download | vcpkg-32c5722104fc28cd55d166a2c04e1d44906eec68.tar.gz vcpkg-32c5722104fc28cd55d166a2c04e1d44906eec68.zip | |
[cfitsio] Update to 3.49 and fix dependency zlib (#14064)
* [cfitsio] Update to 3.49 and fix dependency zlib
* export unofficial cmake targets
* [cfitsio] Fix file paths, export cmake targets
* [cfitsio] Required cmake_policy CMP0012
* [ccfits] Fix dependency cfitsio
* [cfitsio] Fixup pkgconfig
* [healpix] Fix dependency cfitsio
* [cfitsio] fix homepage and patches
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
| -rw-r--r-- | ports/ccfits/CONTROL | 3 | ||||
| -rw-r--r-- | ports/ccfits/fix-dependency.patch | 15 | ||||
| -rw-r--r-- | ports/ccfits/portfile.cmake | 4 | ||||
| -rw-r--r-- | ports/cfitsio/0001-correct-headers-for-getcwd.patch | 40 | ||||
| -rw-r--r-- | ports/cfitsio/0001-fix-dependencies.patch | 39 | ||||
| -rw-r--r-- | ports/cfitsio/0002-export-cmake-targets.patch | 48 | ||||
| -rw-r--r-- | ports/cfitsio/0003-add-Wno-error-implicit-funciton-declaration-to-cmake.patch | 27 | ||||
| -rw-r--r-- | ports/cfitsio/CONTROL | 14 | ||||
| -rw-r--r-- | ports/cfitsio/portfile.cmake | 65 | ||||
| -rw-r--r-- | ports/healpix/CONTROL | 2 | ||||
| -rw-r--r-- | ports/healpix/fix-dependency.patch | 13 | ||||
| -rw-r--r-- | ports/healpix/portfile.cmake | 1 |
12 files changed, 206 insertions, 65 deletions
diff --git a/ports/ccfits/CONTROL b/ports/ccfits/CONTROL index 02234c94e..4fbc3ad80 100644 --- a/ports/ccfits/CONTROL +++ b/ports/ccfits/CONTROL @@ -1,5 +1,6 @@ Source: ccfits -Version: 2.5-5 +Version: 2.5 +Port-Version: 6 Homepage: https://heasarc.gsfc.nasa.gov/fitsio/ccfits Description: CCfits is an object oriented interface to the cfitsio library. It is designed to make the capabilities of cfitsio available to programmers working in C++. Build-Depends: cfitsio diff --git a/ports/ccfits/fix-dependency.patch b/ports/ccfits/fix-dependency.patch new file mode 100644 index 000000000..15cffeb4e --- /dev/null +++ b/ports/ccfits/fix-dependency.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d72ae85..405d96b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,8 +22,8 @@ ENDIF() + + #add_subdirectory (src) + +-find_package(CFITSIO REQUIRED) +-INCLUDE_DIRECTORIES(${CFITSIO_INCLUDE_DIR}) ++find_package(unofficial-cfitsio CONFIG REQUIRED) ++set(CFITSIO_LIBRARY cfitsio) + + SET (LIB_TYPE STATIC) + IF (BUILD_SHARED_LIBS) diff --git a/ports/ccfits/portfile.cmake b/ports/ccfits/portfile.cmake index 6c33b383b..2071e4af8 100644 --- a/ports/ccfits/portfile.cmake +++ b/ports/ccfits/portfile.cmake @@ -7,7 +7,9 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} OUT_SOURCE_PATH SOURCE_PATH - PATCHES dll_exports.patch + PATCHES + dll_exports.patch + fix-dependency.patch ) vcpkg_configure_cmake( diff --git a/ports/cfitsio/0001-correct-headers-for-getcwd.patch b/ports/cfitsio/0001-correct-headers-for-getcwd.patch deleted file mode 100644 index afd63b61a..000000000 --- a/ports/cfitsio/0001-correct-headers-for-getcwd.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 67400fcbd3ab2f7e68a8e7a60139b1b615debae2 Mon Sep 17 00:00:00 2001 -From: Nicole Mazzuca <mazzucan@outlook.com> -Date: Wed, 23 Sep 2020 10:27:43 -0700 -Subject: [PATCH] correct headers for getcwd - ---- - fitsio.h | 3 +++ - group.c | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/fitsio.h b/fitsio.h -index ec26d9d..792bb95 100644 ---- a/fitsio.h -+++ b/fitsio.h -@@ -39,6 +39,9 @@ SERVICES PROVIDED HEREUNDER." - #define CFITSIO_MAJOR 3 - #define CFITSIO_SONAME 5 - -+/* Required for getcwd() */ -+#define _POSIX_C_SOURCE 200112L -+ - /* the SONAME is incremented in a new release if the binary shared */ - /* library (on linux and Mac systems) is not backward compatible */ - /* with the previous release of CFITSIO */ -diff --git a/group.c b/group.c -index 9326c57..cec0f6a 100644 ---- a/group.c -+++ b/group.c -@@ -24,7 +24,7 @@ - #include <direct.h> /* defines the getcwd function on Windows PCs */ - #endif - --#if defined(unix) || defined(__unix__) || defined(__unix) || defined(HAVE_UNISTD_H) -+#if defined(unix) || defined(__unix__) || defined(__unix) || defined(__APPLE__) || defined(HAVE_UNISTD_H) - #include <unistd.h> /* needed for getcwd prototype on unix machines */ - #endif - --- -2.24.3 (Apple Git-128) - diff --git a/ports/cfitsio/0001-fix-dependencies.patch b/ports/cfitsio/0001-fix-dependencies.patch new file mode 100644 index 000000000..d8df38548 --- /dev/null +++ b/ports/cfitsio/0001-fix-dependencies.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d6af49..9e7d2ee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -94,9 +94,8 @@ IF (NOT MSVC) + + # Find curl library, for HTTPS support: + IF (UseCurl) +- FIND_PACKAGE(CURL) ++ FIND_PACKAGE(CURL CONFIG REQUIRED) + IF (CURL_FOUND) +- INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) + ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) + ENDIF() + ENDIF() +@@ -128,18 +127,20 @@ SET(SRC_FILES + + # Only include zlib source files if we are building a shared library. + # Users will need to link their executable with zlib independently. +-IF (BUILD_SHARED_LIBS) ++IF (0) + set(SRC_FILES ${SRC_FILES} + zlib/adler32.c zlib/crc32.c zlib/deflate.c zlib/infback.c + zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c + zlib/uncompr.c zlib/zutil.c + ) ++ELSE() ++ FIND_PACKAGE(ZLIB REQUIRED) + ENDIF() + + ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) +-TARGET_LINK_LIBRARIES(${LIB_NAME} ${PTHREADS_LIBRARY} ${M_LIB}) ++TARGET_LINK_LIBRARIES(${LIB_NAME} ${PTHREADS_LIBRARY} ${M_LIB} ZLIB::ZLIB) + IF (CURL_FOUND) +- TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBRARIES}) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} CURL::libcurl) + ENDIF(CURL_FOUND) + + SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR_VERSION}) diff --git a/ports/cfitsio/0002-export-cmake-targets.patch b/ports/cfitsio/0002-export-cmake-targets.patch new file mode 100644 index 000000000..ab3a46cfe --- /dev/null +++ b/ports/cfitsio/0002-export-cmake-targets.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e7d2ee..5b37adc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,7 +24,7 @@ OPTION(UseCurl "UseCurl" ON) + + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") + set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") +-set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/") ++set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/cfitsio") + + # Define project version + SET(${PROJECT_NAME}_MAJOR_VERSION 3) +@@ -138,19 +138,31 @@ ELSE() + ENDIF() + + ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) +-TARGET_LINK_LIBRARIES(${LIB_NAME} ${PTHREADS_LIBRARY} ${M_LIB} ZLIB::ZLIB) ++TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC $<INSTALL_INTERFACE:include/cfitsio>) ++TARGET_LINK_LIBRARIES(${LIB_NAME} PUBLIC ${PTHREADS_LIBRARY} ${M_LIB} ZLIB::ZLIB) + IF (CURL_FOUND) +- TARGET_LINK_LIBRARIES(${LIB_NAME} CURL::libcurl) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} PUBLIC CURL::libcurl) + ENDIF(CURL_FOUND) + + SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR_VERSION}) +-install(TARGETS ${LIB_NAME} DESTINATION ${LIB_DESTINATION}) + install(TARGETS ${LIB_NAME} ++ EXPORT unofficial-${LIB_NAME}-config + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) + ++set(CFITSIO_VERSION 3.49) ++include(CMakePackageConfigHelpers) ++write_basic_package_version_file(unofficial-${LIB_NAME}-version.cmake VERSION ${CFITSIO_VERSION} COMPATIBILITY ExactVersion) ++ ++install(FILES ${CMAKE_BINARY_DIR}/unofficial-${LIB_NAME}-version.cmake DESTINATION share/unofficial-${LIB_NAME}) ++ ++install( ++ EXPORT unofficial-${LIB_NAME}-config ++ DESTINATION share/unofficial-${LIB_NAME} ++) ++ + # Only build test code and executables if building a shared library: + IF (BUILD_SHARED_LIBS) + diff --git a/ports/cfitsio/0003-add-Wno-error-implicit-funciton-declaration-to-cmake.patch b/ports/cfitsio/0003-add-Wno-error-implicit-funciton-declaration-to-cmake.patch new file mode 100644 index 000000000..288a1d263 --- /dev/null +++ b/ports/cfitsio/0003-add-Wno-error-implicit-funciton-declaration-to-cmake.patch @@ -0,0 +1,27 @@ +From af09ca45ad71a540aafc4989676e9a0b88bf2948 Mon Sep 17 00:00:00 2001 +From: Nicole Mazzuca <mazzucan@outlook.com> +Date: Fri, 16 Oct 2020 12:28:37 -0700 +Subject: [PATCH] add `-Wno-error=implicit-funciton-declaration` to cmake + +--- + CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5b37adc..fead70c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,10 @@ SET(CMAKE_LEGACY_CYGWIN_WIN32 0) + PROJECT(CFITSIO) + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) + ++if (NOT MSVC) ++ add_compile_options(-Wno-error=implicit-function-declaration) ++endif() ++ + # Allow @rpath token in target install name on Macs. + # See "cmake --help-policy CMP0042" for more information. + IF(POLICY CMP0042) +-- +2.28.0.windows.1 + diff --git a/ports/cfitsio/CONTROL b/ports/cfitsio/CONTROL index e7a638303..85ff87432 100644 --- a/ports/cfitsio/CONTROL +++ b/ports/cfitsio/CONTROL @@ -1,5 +1,13 @@ Source: cfitsio -Version: 3.410 -Port-Version: 4 -Homepage: https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c +Version: 3.49 +Homepage: https://heasarc.gsfc.nasa.gov/fitsio/ Description: Library of C and Fortran subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format +Build-Depends: zlib + +Feature: curl +Description: UseCurl +Build-Depends: curl + +Feature: pthreads +Description: Thread-safe build (using pthreads) +Build-Depends: pthreads (windows) diff --git a/ports/cfitsio/portfile.cmake b/ports/cfitsio/portfile.cmake index 12e3e2d4a..095a9e62e 100644 --- a/ports/cfitsio/portfile.cmake +++ b/ports/cfitsio/portfile.cmake @@ -1,38 +1,65 @@ vcpkg_download_distfile(ARCHIVE - URLS "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio3410.tar.gz" - FILENAME "cfitsio3410.tar.gz" - SHA512 b2ac31ab17e19eeeb4f1601f42f348402c0a4ab03725dbf74fe75eaabbee2f44f64f0c0ee7f0b2688bd93a9cc0dccf29f07e73b9148fff97fc78bebdbb5f6f0f + URLS "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz" + FILENAME "cfitsio-3.49.tar.gz" + SHA512 9836a4af3bbbfed1ea1b4c70b9d500ac485d7c3d8131eb8a25ee6ef6662f46ba52b5161c45c709ed9a601ff0e9ec36daa5650eaaf4f2cc7d6f4bb5640f10da15 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} PATCHES - 0001-correct-headers-for-getcwd.patch + 0001-fix-dependencies.patch + 0002-export-cmake-targets.patch + 0003-add-Wno-error-implicit-funciton-declaration-to-cmake.patch ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + curl UseCurl +) + +if ("curl" IN_LIST FEATURES) + set(FIND_CURL_DEPENDENCY "find_dependency(CURL CONFIG)") +endif() + +if ("pthreads" IN_LIST FEATURES) + if (VCPKG_TARGET_IS_WINDOWS) + set(WITH_PTHREADS ON) + set(FIND_PTHREADS_DEPENDENCY "find_dependency(pthreads)") + else() + message(WARNING "Feature pthreads only support Windows, disable it now.") + set(WITH_PTHREADS OFF) + endif() +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} + -DUSE_PTHREADS=${WITH_PTHREADS} ) vcpkg_install_cmake() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-cfitsio TARGET_PATH share/unofficial-cfitsio) + +file(READ ${CURRENT_PACKAGES_DIR}/share/unofficial-cfitsio/unofficial-cfitsio-config.cmake ASSIMP_CONFIG) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/unofficial-cfitsio/unofficial-cfitsio-config.cmake " +include(CMakeFindDependencyMacro) +${FIND_CURL_DEPENDENCY} +${FIND_PTHREADS_DEPENDENCY} +find_dependency(ZLIB) +${ASSIMP_CONFIG} +") -# Remove duplicate include files -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/unistd.h) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/unofficial-cfitsio/unofficial-cfitsio-config.cmake + "cmake_policy(VERSION 2.6)" + "cmake_policy(VERSION 2.6)\r\n\ +# Required for the evaluation of \"if(@BUILD_SHARED_LIBS@)\" below to function\r\n\ +cmake_policy(SET CMP0012 NEW)\r\n" +) -# cfitsio uses very common names for its headers, so they must be moved to a subdirectory -file(RENAME ${CURRENT_PACKAGES_DIR}/include ${CURRENT_PACKAGES_DIR}/cfitsio) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include) -file(RENAME ${CURRENT_PACKAGES_DIR}/cfitsio ${CURRENT_PACKAGES_DIR}/include/cfitsio) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/unistd.h ${CURRENT_PACKAGES_DIR}/debug/share) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - # move DLLs to bin directories for dynamic builds - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cfitsio.dll ${CURRENT_PACKAGES_DIR}/bin/cfitsio.dll) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cfitsio.dll ${CURRENT_PACKAGES_DIR}/debug/bin/cfitsio.dll) -endif() +file(INSTALL ${SOURCE_PATH}/FindPthreads.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-cfitsio) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cfitsio RENAME copyright) +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/healpix/CONTROL b/ports/healpix/CONTROL index 8b1e856e2..554f8fb1f 100644 --- a/ports/healpix/CONTROL +++ b/ports/healpix/CONTROL @@ -1,6 +1,6 @@ Source: healpix Version: 1.12.10 -Port-Version: 6 +Port-Version: 7 Homepage: http://healpix.sourceforge.net/ Description: HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere. Build-Depends: cfitsio diff --git a/ports/healpix/fix-dependency.patch b/ports/healpix/fix-dependency.patch new file mode 100644 index 000000000..87d7336f5 --- /dev/null +++ b/ports/healpix/fix-dependency.patch @@ -0,0 +1,13 @@ +diff --git a/src/cxx/configure.ac b/src/cxx/configure.ac +index 63f05d7..e284f0d 100644 +--- a/src/cxx/configure.ac ++++ b/src/cxx/configure.ac +@@ -175,7 +175,7 @@ CXXCFLAGS_NO_C="$CXXCFLAGS $CPPFLAGS" + LDCCFLAGS="$LDFLAGS $CCFLAGS" + LDCXXFLAGS="$LDFLAGS $CXXCFLAGS" + +-AC_CHECK_LIB([cfitsio],[ffgnrwll],,AC_MSG_ERROR([could not find the cfitsio library]),[-lm]) ++AC_CHECK_LIB([cfitsio -lz],[ffgnrwll],,AC_MSG_ERROR([could not find the cfitsio library]),[-lm -lz]) + AC_CHECK_HEADERS([fitsio.h],,AC_MSG_ERROR([could not find the cfitsio header file]),) + + AC_SUBST(SILENT_RULE) diff --git a/ports/healpix/portfile.cmake b/ports/healpix/portfile.cmake index c1fa90f36..dde1ac3c1 100644 --- a/ports/healpix/portfile.cmake +++ b/ports/healpix/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_sourceforge( REF Healpix_${HEALPIX_VER} FILENAME "Healpix_${HEALPIX_PACK_NAME}.tar.gz" SHA512 29fe680d757bd94651bf029654257cb67286643aad510df4c2f0b06245174411376ec1beca64feebfac14a6fc0194525170635842916d79dcaddeddd9ac6f6c7 + PATCHES fix-dependency.patch ) vcpkg_configure_make( |
