diff --git a/recipes/cfitsio/all/conandata.yml b/recipes/cfitsio/all/conandata.yml index 6b0480fb20585..63cc622faf8bc 100644 --- a/recipes/cfitsio/all/conandata.yml +++ b/recipes/cfitsio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.4.0": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.4.0.tar.gz" + sha256: "c42bd609151c0b0d7c4f3578d425ae7aaa9afa4828cab35c0accea588e290c29" "4.3.1": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.1.tar.gz" sha256: "2332b965d327a15c103a7d31d6d1afaf775d00e9785dd25332ae76b9725351e4" @@ -17,13 +20,10 @@ sources: "3.490": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz" sha256: "8cc4beddd0ff389fb81bde9c181e0e3c419c15ec8a66df201ff4619a93715558" - "3.480": - url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.48.tar.gz" - sha256: "fc369363616753fa4dbe9bf28fa7e49cc1b057081229d89b52087d85ef303314" - "3.470": - url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.47.tar.gz" - sha256: "985606e058403c073a68d95be74e9696f0ded9414520784457a1d4cba8cca7e2" patches: + "4.4.0": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.2.0.patch" "4.3.1": - patch_file: "patches/windows-use-strtok_s.patch" - patch_file: "patches/fix-cmake-4.2.0.patch" @@ -42,9 +42,3 @@ patches: "3.490": - patch_file: "patches/windows-use-strtok_s.patch" - patch_file: "patches/fix-cmake-3.490.patch" - "3.480": - - patch_file: "patches/windows-use-strtok_s.patch" - - patch_file: "patches/fix-cmake-3.470.patch" - "3.470": - - patch_file: "patches/windows-use-strtok_s.patch" - - patch_file: "patches/fix-cmake-3.470.patch" diff --git a/recipes/cfitsio/all/conanfile.py b/recipes/cfitsio/all/conanfile.py index 782f21cb2a73b..e2f5688059f62 100644 --- a/recipes/cfitsio/all/conanfile.py +++ b/recipes/cfitsio/all/conanfile.py @@ -1,9 +1,10 @@ +import glob +import os + from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version -import glob -import os required_conan_version = ">=1.54.0" @@ -12,7 +13,7 @@ class CfitsioConan(ConanFile): name = "cfitsio" description = "C library for reading and writing data files in FITS " \ "(Flexible Image Transport System) data format" - license = "CFITSIO" + license = ("CFITSIO", "NASA-1.3") topics = ("fits", "image", "nasa", "astronomy", "astrophysics", "space") homepage = "https://heasarc.gsfc.nasa.gov/fitsio/" url = "https://github.com/conan-io/conan-center-index" @@ -104,7 +105,11 @@ def build(self): cmake.build() def package(self): - copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) >= "4.4.0": + copy(self, "NASA*", src=os.path.join(self.source_folder, "licenses"), + dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) diff --git a/recipes/cfitsio/all/patches/fix-cmake-3.470.patch b/recipes/cfitsio/all/patches/fix-cmake-3.470.patch deleted file mode 100644 index 46df9c1140c70..0000000000000 --- a/recipes/cfitsio/all/patches/fix-cmake-3.470.patch +++ /dev/null @@ -1,223 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3,8 +3,8 @@ - # Suppress warning about WIN32 no longer being defined on Cygwin: - SET(CMAKE_LEGACY_CYGWIN_WIN32 0) - -+CMAKE_MINIMUM_REQUIRED(VERSION 3.1) - PROJECT(CFITSIO) --CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) - - # Allow @rpath token in target install name on Macs. - # See "cmake --help-policy CMP0042" for more information. -@@ -12,12 +12,14 @@ IF(POLICY CMP0042) - CMAKE_POLICY(SET CMP0042 NEW) - ENDIF() - --INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) --INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -+INCLUDE(CheckSymbolExists) -+INCLUDE(CheckCSourceCompiles) - - # Allow the developer to select if Dynamic or Static libraries are built - OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) - OPTION (USE_PTHREADS "Thread-safe build (using pthreads)" OFF) -+OPTION(CFITSIO_USE_SSE2 "Enable use of instructions in the SSE2 extended instruction set" OFF) -+OPTION(CFITSIO_USE_SSSE3 "Enable use of instructions in the SSSE3 extended instruction set" OFF) - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") - set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") -@@ -55,12 +57,19 @@ IF (BUILD_SHARED_LIBS) - ENDIF (BUILD_SHARED_LIBS) - - --FILE(GLOB H_FILES "*.h") -+SET(H_FILES fitsio.h fitsio2.h longnam.h) -+SET(LINK_LIBS "") - - IF (USE_PTHREADS) -- FIND_PACKAGE(pthreads REQUIRED) -- INCLUDE_DIRECTORIES(${PTHREADS_INCLUDE_DIR}) -- ADD_DEFINITIONS(-D_REENTRANT) -+ SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) -+ SET(THREADS_PREFER_PTHREAD_FLAG TRUE) -+ FIND_PACKAGE(Threads REQUIRED) -+ IF(CMAKE_USE_PTHREADS_INIT) -+ LIST(APPEND LINK_LIBS "Threads::Threads") -+ ELSE() -+ find_package(pthreads4w REQUIRED CONFIG) -+ LIST(APPEND LINK_LIBS "pthreads4w::pthreads4w") -+ ENDIF() - ENDIF() - - # Math library (not available in MSVC or MINGW) -@@ -71,35 +80,36 @@ ELSE() - ENDIF() - - # Support for remote file drivers is not implemented for native Windows: --IF (NOT MSVC) -+IF (NOT WIN32) - # Find library needed for gethostbyname: -- CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) -- IF(NOT CMAKE_HAVE_GETHOSTBYNAME) -- CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_HAVE_GETHOSTBYNAME) -- ENDIF() -+ CHECK_SYMBOL_EXISTS(gethostbyname "netdb.h" CMAKE_HAVE_GETHOSTBYNAME) - - # Find library needed for connect: -- CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) -- IF(NOT CMAKE_HAVE_CONNECT) -- CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_HAVE_CONNECT) -- ENDIF() -+ CHECK_SYMBOL_EXISTS(connect "sys/types.h;sys/socket.h" CMAKE_HAVE_CONNECT) - - # Define HAVE_NET_SERVICES if gethostbyname & connect were found: - IF (CMAKE_HAVE_GETHOSTBYNAME AND CMAKE_HAVE_CONNECT) - ADD_DEFINITIONS(-DHAVE_NET_SERVICES) -+ CHECK_SYMBOL_EXISTS(fmemopen "stdio.h" HAVE_FMEMOPEN) -+ IF(HAVE_FMEMOPEN) -+ ADD_DEFINITIONS(-DHAVE_FMEMOPEN) -+ ENDIF() - ENDIF () - - # Find curl library, for HTTPS support: -- FIND_PACKAGE(CURL) -- IF (CURL_FOUND) -- INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) -- ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) -+ OPTION(UseCurl "UseCurl" ON) -+ IF (UseCurl) -+ FIND_PACKAGE(CURL) -+ IF (CURL_FOUND) -+ LIST(APPEND LINK_LIBS "CURL::libcurl") -+ ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) -+ ENDIF() - ENDIF() - ENDIF() - - SET(SRC_FILES - buffers.c cfileio.c checksum.c -- drvrfile.c drvrmem.c drvrnet.c -+ drvrfile.c drvrmem.c drvrnet.c drvrsmem.c - editcol.c edithdu.c eval_f.c eval_l.c eval_y.c - f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c - fits_hcompress.c fits_hdecompress.c fitscore.c -@@ -123,27 +133,99 @@ 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) -- 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 -- ) -+find_package(ZLIB REQUIRED) -+LIST(APPEND LINK_LIBS "ZLIB::ZLIB") -+ -+IF(CFITSIO_USE_SSE2) -+ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") -+ ADD_COMPILE_OPTIONS(-msse2) -+ ENDIF() -+ IF(MSVC) -+ ADD_DEFINITIONS(-D__SSE2__=1) -+ ENDIF() -+ENDIF() -+ -+IF(CFITSIO_USE_SSSE3) -+ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") -+ ADD_COMPILE_OPTIONS(-mssse3) -+ ENDIF() -+ IF(MSVC) -+ ADD_DEFINITIONS(-D__SSE2__=1 -D__SSSE3__=1) -+ ENDIF() -+ENDIF() -+ -+OPTION(CFITSIO_USE_BZIP2 "Enable bzip2 support" OFF) -+IF(CFITSIO_USE_BZIP2) -+ FIND_PACKAGE(BZip2 REQUIRED) -+ LIST(APPEND LINK_LIBS "BZip2::BZip2") -+ ADD_DEFINITIONS(-DHAVE_BZIP2=1) -+ENDIF() -+ -+# Test for the unix ftruncate function -+CHECK_SYMBOL_EXISTS(ftruncate "unistd.h" HAVE_FTRUNCATE) -+IF(HAVE_FTRUNCATE) -+ ADD_DEFINITIONS(-DHAVE_FTRUNCATE) -+ENDIF() -+ -+# Check is System V IPC is supported on this machine -+CHECK_C_SOURCE_COMPILES(" -+#include -+#include -+#include -+int main() { -+ shmat(0,0,0); -+ shmdt(0); -+ shmget(0, 0, 0); -+ semget(0, 0, 0); -+ return 0; -+}" HAVE_SHMEM_SERVICES) -+IF(HAVE_SHMEM_SERVICES) -+ ADD_DEFINITIONS(-DHAVE_SHMEM_SERVICES) -+ -+ # Some systems define flock_t, for others we have to define it ourselves -+ CHECK_C_SOURCE_COMPILES(" -+ #include -+ int main() { -+ flock_t filler; -+ return 0; -+ }" HAVE_FLOCK_T) -+ IF(HAVE_FLOCK_T) -+ ADD_DEFINITIONS(-DHAVE_FLOCK_T) -+ ENDIF() -+ -+ # Check union semun -+ CHECK_C_SOURCE_COMPILES(" -+ #include -+ #include -+ #include -+ int main() { -+ union semun filler; -+ return 0; -+ }" HAVE_UNION_SEMUN) -+ IF(HAVE_UNION_SEMUN) -+ ADD_DEFINITIONS(-DHAVE_UNION_SEMUN) -+ ENDIF() - ENDIF() - - ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) --TARGET_LINK_LIBRARIES(${LIB_NAME} ${PTHREADS_LIBRARY} ${M_LIB} ${CURL_LIBRARIES}) -+TARGET_LINK_LIBRARIES(${LIB_NAME} ${LINK_LIBS} ${M_LIB}) -+if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "12") -+ TARGET_COMPILE_OPTIONS(${LIB_NAME} PRIVATE -Wno-error=implicit-function-declaration) -+endif() - - 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} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) - --# Only build test code and executables if building a shared library: --IF (BUILD_SHARED_LIBS) -+# Do not build test code and executables: -+IF (FALSE) - - ENABLE_TESTING() - -@@ -173,7 +255,7 @@ IF (BUILD_SHARED_LIBS) - set_target_properties(FPack Funpack PROPERTIES LINK_FLAGS "setargv.obj") - endif(MSVC) - --ENDIF(BUILD_SHARED_LIBS) -+ENDIF() - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cfitsio.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc DESTINATION lib/pkgconfig/) diff --git a/recipes/cfitsio/config.yml b/recipes/cfitsio/config.yml index 644678fbd04e4..bfb174dc329f7 100644 --- a/recipes/cfitsio/config.yml +++ b/recipes/cfitsio/config.yml @@ -1,4 +1,6 @@ versions: + "4.4.0": + folder: all "4.3.1": folder: all "4.3.0": @@ -11,7 +13,3 @@ versions: folder: all "3.490": folder: all - "3.480": - folder: all - "3.470": - folder: all