diff --git a/ports/cfitsio/0004-pkg-config.patch b/ports/cfitsio/0004-pkg-config.patch new file mode 100644 index 00000000000000..65d98b56a629f6 --- /dev/null +++ b/ports/cfitsio/0004-pkg-config.patch @@ -0,0 +1,13 @@ +diff -urw cfitsio-3-7822097674.clean/cfitsio.pc.cmake cfitsio-3-7822097674/cfitsio.pc.cmake +--- cfitsio-3-7822097674.clean/cfitsio.pc.cmake 2020-08-12 20:01:04.000000000 +0200 ++++ cfitsio-3-7822097674/cfitsio.pc.cmake 2021-05-06 08:46:49.160351519 +0200 +@@ -6,7 +6,8 @@ + Name: cfitsio + Description: FITS File Subroutine Library + URL: https://heasarc.gsfc.nasa.gov/fitsio/ +-Version: @CFITSIO_MAJOR@.@CFITSIO_MINOR@ ++Version: @CFITSIO_VERSION@ ++Requires.private: @PKG_CONFIG_REQUIRES_PRIVATE@ + Libs: -L${libdir} @PKG_CONFIG_LIBS@ + Libs.private: -lm + Cflags: -I${includedir} diff --git a/ports/cfitsio/CONTROL b/ports/cfitsio/CONTROL deleted file mode 100644 index 85ff874322201b..00000000000000 --- a/ports/cfitsio/CONTROL +++ /dev/null @@ -1,13 +0,0 @@ -Source: cfitsio -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 095a9e62e8c71b..05821771a0b3a5 100644 --- a/ports/cfitsio/portfile.cmake +++ b/ports/cfitsio/portfile.cmake @@ -11,14 +11,19 @@ vcpkg_extract_source_archive_ex( 0001-fix-dependencies.patch 0002-export-cmake-targets.patch 0003-add-Wno-error-implicit-funciton-declaration-to-cmake.patch + 0004-pkg-config.patch ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - curl UseCurl +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + curl UseCurl ) +set(PKG_CONFIG_REQUIRES_PRIVATE zlib) if ("curl" IN_LIST FEATURES) set(FIND_CURL_DEPENDENCY "find_dependency(CURL CONFIG)") + string(APPEND PKG_CONFIG_REQUIRES_PRIVATE " libcurl") endif() if ("pthreads" IN_LIST FEATURES) @@ -34,8 +39,11 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS ${FEATURE_OPTIONS} + OPTIONS + ${FEATURE_OPTIONS} -DUSE_PTHREADS=${WITH_PTHREADS} + "-DPKG_CONFIG_REQUIRES_PRIVATE=${PKG_CONFIG_REQUIRES_PRIVATE}" + -DPKG_CONFIG_LIBS=-lcfitsio ) vcpkg_install_cmake() diff --git a/ports/cfitsio/vcpkg.json b/ports/cfitsio/vcpkg.json new file mode 100644 index 00000000000000..fe2794b54221db --- /dev/null +++ b/ports/cfitsio/vcpkg.json @@ -0,0 +1,27 @@ +{ + "name": "cfitsio", + "version": "3.49", + "port-version": 1, + "description": "Library of C and Fortran subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format", + "homepage": "https://heasarc.gsfc.nasa.gov/fitsio/", + "dependencies": [ + "zlib" + ], + "features": { + "curl": { + "description": "UseCurl", + "dependencies": [ + "curl" + ] + }, + "pthreads": { + "description": "Thread-safe build (using pthreads)", + "dependencies": [ + { + "name": "pthreads", + "platform": "windows" + } + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 729cc1c7efa2ff..297cdb5edacf8d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1154,7 +1154,7 @@ }, "cfitsio": { "baseline": "3.49", - "port-version": 0 + "port-version": 1 }, "cgal": { "baseline": "5.2", diff --git a/versions/c-/cfitsio.json b/versions/c-/cfitsio.json index 5763f0addc3d99..adf8116dd3323e 100644 --- a/versions/c-/cfitsio.json +++ b/versions/c-/cfitsio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0ed894cb8efbfd277570991a78f29b70e4e931cd", + "version": "3.49", + "port-version": 1 + }, { "git-tree": "cd71c6293e902542ed6cb0c146b5de5d6d7906a9", "version-string": "3.49",