diff options
Diffstat (limited to 'vcpkg/ports/plplot')
| -rw-r--r-- | vcpkg/ports/plplot/cmake-config.diff | 29 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/fix-pc-absolute.patch | 26 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/host-tool.cmake | 6 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/install-interface-include-directories.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/pkg_config_link_flags.diff | 65 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/pkgconfig-template.diff | 14 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/portfile.cmake | 106 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/subdirs.patch | 17 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/usage | 22 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/use-math-h-nan.patch | 28 | ||||
| -rw-r--r-- | vcpkg/ports/plplot/vcpkg.json | 50 |
11 files changed, 375 insertions, 0 deletions
diff --git a/vcpkg/ports/plplot/cmake-config.diff b/vcpkg/ports/plplot/cmake-config.diff new file mode 100644 index 0000000..e5e6995 --- /dev/null +++ b/vcpkg/ports/plplot/cmake-config.diff @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e29c43d..7063e4c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -308,7 +308,8 @@ endif(USE_DLL_SUBDIRECTORY) + # Prior to processing directories must initialize exports of installed targets. + + # Install CMake package config file which handles all those exports. +-install(FILES plplotConfig.cmake DESTINATION ${LIB_DIR}/cmake/plplot) ++configure_file("${PROJECT_SOURCE_DIR}/plplotConfig.cmake" "${PROJECT_BINARY_DIR}/plplotConfig.cmake" @ONLY) ++install(FILES "${PROJECT_BINARY_DIR}/plplotConfig.cmake" DESTINATION ${LIB_DIR}/cmake/plplot) + + # Initialize the plplot_exports.cmake file which is appended to by CMake logic + # to install and export targets that is indirectly executed by the add_subdirectory commands below. +diff --git a/plplotConfig.cmake b/plplotConfig.cmake +index 677faec..fe6d2ca 100644 +--- a/plplotConfig.cmake ++++ b/plplotConfig.cmake +@@ -1,3 +1,10 @@ ++if(NOT "@BUILD_SHARED_LIBS@") ++ include(CMakeFindDependencyMacro) ++ if("@ENABLE_wxwidgets@") ++ find_dependency(wxWidgets) ++ endif() ++endif() ++ + if(ANY_QT_DEVICE AND PLPLOT_USE_QT5) + # Find Qt5 components that we need to link applications against + # the plplot library (if ENABLE_DYNDRIVERS is false) and which we diff --git a/vcpkg/ports/plplot/fix-pc-absolute.patch b/vcpkg/ports/plplot/fix-pc-absolute.patch new file mode 100644 index 0000000..aa43451 --- /dev/null +++ b/vcpkg/ports/plplot/fix-pc-absolute.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/modules/wingcc.cmake b/cmake/modules/wingcc.cmake +index 25a7494..bb0f476 100644 +--- a/cmake/modules/wingcc.cmake ++++ b/cmake/modules/wingcc.cmake +@@ -40,7 +40,7 @@ if(PLD_wingcc) + endif(GDI32_LIBRARY) + if(GDI32_LIBRARY AND COMDLG32_LIBRARY) + message(STATUS "Looking for gdi32 header and library - found") +- set(wingcc_LINK_FLAGS "${GDI32_LIBRARY};${COMDLG32_LIBRARY}") ++ set(wingcc_LINK_FLAGS "-lgdi32;-lcomdlg32") + if(WITH_FREETYPE) + set( + wingcc_COMPILE_FLAGS +diff --git a/cmake/modules/wingdi.cmake b/cmake/modules/wingdi.cmake +index bbe7aed..24c29f9 100644 +--- a/cmake/modules/wingdi.cmake ++++ b/cmake/modules/wingdi.cmake +@@ -41,7 +41,7 @@ if(PLD_wingdi) + endif(GDI32_LIBRARY) + if(GDI32_LIBRARY AND COMDLG32_LIBRARY AND COMCTL32_LIBRARY) + message(STATUS "Looking for gdi32 header and library - found") +- set(wingdi_LINK_FLAGS "${GDI32_LIBRARY};${COMDLG32_LIBRARY};${COMCTL32_LIBRARY}") ++ set(wingdi_LINK_FLAGS "-lgdi32;-lcomdlg32;-lcomctl32") + set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${wingdi_LINK_FLAGS}) + else(GDI32_LIBRARY AND COMDLG32_LIBRARY AND COMCTL32_LIBRARY) + message(STATUS "Looking for gdi32 header and library - not found") diff --git a/vcpkg/ports/plplot/host-tool.cmake b/vcpkg/ports/plplot/host-tool.cmake new file mode 100644 index 0000000..922ee81 --- /dev/null +++ b/vcpkg/ports/plplot/host-tool.cmake @@ -0,0 +1,6 @@ +if(NOT TARGET @name@) + add_executable(@name@ IMPORTED) + set_target_properties(@name@ PROPERTIES + IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/@name@@VCPKG_TARGET_EXECUTABLE_SUFFIX@" + ) +endif() diff --git a/vcpkg/ports/plplot/install-interface-include-directories.patch b/vcpkg/ports/plplot/install-interface-include-directories.patch new file mode 100644 index 0000000..99ec812 --- /dev/null +++ b/vcpkg/ports/plplot/install-interface-include-directories.patch @@ -0,0 +1,12 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 757b4ed..7dfd6e3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -295,6 +295,7 @@ endif(NOT ENABLE_DYNDRIVERS AND ANY_QT_DEVICE AND PLPLOT_USE_QT5) + + configure_library_build(plplot "" "${plplot_LIB_SRCS}" "${libplplot_LINK_LIBRARIES}" "${LIB_INSTALL_RPATH}") + add_dependencies(${WRITEABLE_TARGET}plplot plhershey-unicode.h_built) ++target_include_directories(${WRITEABLE_TARGET}plplot INTERFACE $<INSTALL_INTERFACE:include>) + + if(NOT ENABLE_DYNDRIVERS AND (PLD_wxwidgets OR PLD_wxpng)) + set_property(TARGET ${WRITEABLE_TARGET}plplot diff --git a/vcpkg/ports/plplot/pkg_config_link_flags.diff b/vcpkg/ports/plplot/pkg_config_link_flags.diff new file mode 100644 index 0000000..bb23f4e --- /dev/null +++ b/vcpkg/ports/plplot/pkg_config_link_flags.diff @@ -0,0 +1,65 @@ +diff --git a/cmake/modules/pkg-config.cmake b/cmake/modules/pkg-config.cmake +index a0ca6b2..32e8566 100644 +--- a/cmake/modules/pkg-config.cmake ++++ b/cmake/modules/pkg-config.cmake +@@ -194,10 +194,14 @@ function(pkg_config_link_flags link_flags_out link_flags_in) + # Linux, Mac OS X, and MinGW/MSYS but it may need some + # generalization on other platforms such as Cygwin. + ++ set(prefix_literal "lib") + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(suffix_pattern "(\\.so.*|\\.a)") + elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(suffix_pattern "(\\.so.*|\\.a|\\.dylib)") ++ elseif(MSVC) ++ set(prefix_literal "") ++ set(suffix_pattern "(\\.[Ll][Ii][Bb])") + elseif(WIN32_OR_CYGWIN) + # Order is important here. + set(suffix_pattern "(\\.dll\\.a|\\.a)") +@@ -210,12 +214,35 @@ function(pkg_config_link_flags link_flags_out link_flags_in) + set(_link_flags) + foreach(link_flag IN LISTS link_flags) + #message(STATUS "link_flag = ${link_flag}") ++ if(TARGET "${link_flag}") ++ string(TOUPPER "${CMAKE_BUILD_TYPE}" config) ++ foreach(key IN ITEMS IMPORTED_IMPLIB_${config} IMPORTED_LOCATION_${config} IMPORTED_IMPLIB IMPORTED_LOCATION) ++ get_target_property(lib "${link_flag}" "${key}") ++ if(lib) ++ set(link_flag "${lib}") ++ break() ++ endif() ++ endforeach() ++ # sorry, no transitive deps for now. ++ endif() + if(WIN32_OR_CYGWIN) + # Look for colon-delimited drive-letter form on these platforms. +- string(REGEX REPLACE "^([a-zA-Z]:/.*)/lib(.*)${suffix_pattern}$" "-L\"\\1\" -l\\2" link_flag "${link_flag}") + endif(WIN32_OR_CYGWIN) + # Look for form starting with "/" on all platforms. +- string(REGEX REPLACE "^(/.*)/lib(.*)${suffix_pattern}$" "-L\"\\1\" -l\\2" link_flag "${link_flag}") ++ if(link_flag MATCHES "^([a-zA-Z]:/.*|/.*)/${prefix_literal}(.+)${suffix_pattern}$") ++ if(CMAKE_MATCH_2 IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES) ++ continue() ++ endif() ++ set(link_flag "-l${CMAKE_MATCH_2}") ++ if(NOT CMAKE_MATCH_1 IN_LIST CMAKE_C_IMPLICIT_LINK_DIRECTORIES) ++ set(lib_dir_flag "-L\"${CMAKE_MATCH_1}\"") ++ if(NOT lib_dir_flag IN_LIST _link_flags) ++ list(APPEND _link_flags "${lib_dir_flag}") ++ endif() ++ endif() ++ elseif(NOT link_flag MATCHES "^-|/") # e.g. 'm' ++ set(link_flag "-l${link_flag}") ++ endif() + #message(STATUS "(-L form of link_flag = ${link_flag}") + list(APPEND _link_flags ${link_flag}) + endforeach(link_flag IN LISTS link_flags) +@@ -290,6 +317,7 @@ macro(cmake_link_flags _link_flags_out _link_flags_in) + #message("_link_directory_list = ${_link_directory_list}") + #message("_link_flags_list (without -L options) = ${_link_flags_list}") + ++ string(REPLACE "-framework;" "-framework " _link_flags_list "${_link_flags_list}") + # Derive ${_link_flags_out} from _link_flags_list with -l options + # replaced by complete pathname of library. + list(LENGTH _link_flags_list _link_flags_length) diff --git a/vcpkg/ports/plplot/pkgconfig-template.diff b/vcpkg/ports/plplot/pkgconfig-template.diff new file mode 100644 index 0000000..d123bbd --- /dev/null +++ b/vcpkg/ports/plplot/pkgconfig-template.diff @@ -0,0 +1,14 @@ +diff --git a/pkgcfg/plplot-template.pc.in b/pkgcfg/plplot-template.pc.in +index 7c1310e..4656c03 100644 +--- a/pkgcfg/plplot-template.pc.in ++++ b/pkgcfg/plplot-template.pc.in +@@ -1,6 +1,7 @@ +-libdir=@LIB_DIR@ ++prefix=${pcfiledir}/../.. ++libdir=${prefix}/@LIB_DIR@ + includedir=@INCLUDE_DIR@ +-drvdir=@LIB_DIR@/plplot@PLPLOT_VERSION@/drivers ++drvdir=${prefix}/@LIB_DIR@/plplot@PLPLOT_VERSION@/drivers + + Name: PLplot @PC_SHORT_NAME@ + Description: Scientific plotting library (@PC_PRECISION@@PC_LONG_NAME@) diff --git a/vcpkg/ports/plplot/portfile.cmake b/vcpkg/ports/plplot/portfile.cmake new file mode 100644 index 0000000..bbe2d3a --- /dev/null +++ b/vcpkg/ports/plplot/portfile.cmake @@ -0,0 +1,106 @@ +vcpkg_from_sourceforge(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO plplot/plplot
+ REF "${VERSION}%20Source"
+ FILENAME "plplot-${VERSION}.tar.gz"
+ SHA512 54533245569b724a7ef90392cc6e9ae65873e6cbab923df0f841c8b43def5e4307690894c7681802209bd3c8df97f54285310a706428f79b3340cce3207087c8
+ PATCHES
+ cmake-config.diff
+ fix-pc-absolute.patch
+ install-interface-include-directories.patch
+ pkg_config_link_flags.diff
+ pkgconfig-template.diff
+ subdirs.patch
+ use-math-h-nan.patch
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ wxwidgets PLD_wxwidgets
+ wxwidgets ENABLE_wxwidgets
+ x11 PLD_xwin
+ x11 CMAKE_REQUIRE_FIND_PACKAGE_X11
+ INVERTED_FEATURES
+ x11 CMAKE_DISABLE_FIND_PACKAGE_X11
+)
+
+if(VCPKG_CROSSCOMPILING)
+ list(APPEND FEATURE_OPTIONS "-DCMAKE_NATIVE_BINARY_DIR=${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}")
+ # Necessary to skip a try_run which isn't used anyways due to PL_HAVE_QHULL=OFF
+ list(APPEND FEATURE_OPTIONS "-DNaNAwareCCompiler=ON")
+endif()
+
+vcpkg_find_acquire_program(PKGCONFIG)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCMAKE_CXX_STANDARD=11
+ -DDEFAULT_NO_BINDINGS=ON
+ -DDEFAULT_NO_QT_DEVICES=ON
+ -DENABLE_cxx=ON
+ -DENABLE_DYNDRIVERS=OFF
+ -DENABLE_qt=OFF
+ -DENABLE_tk=OFF
+ -DHAVE_SHAPELIB=OFF
+ -DPL_DOUBLE=ON
+ -DPL_HAVE_QHULL=OFF
+ -DPLD_aqt=OFF # needs aquaterm framework
+ -DPLD_pdf=OFF # needs haru
+ -DPLD_psttf=OFF # needs lasi (in addition to pango)
+ -DPLD_psttfc=OFF # needs lasi (in addition to pango)
+ "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
+ ${FEATURE_OPTIONS}
+ -DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=ON
+ -DCMAKE_REQUIRE_FIND_PACKAGE_Freetype=ON
+ OPTIONS_DEBUG
+ "-DDATA_DIR=${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/data"
+ "-DDOC_DIR=${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/doc"
+ OPTIONS_RELEASE
+ "-DDATA_DIR=${CURRENT_PACKAGES_DIR}/share/${PORT}/data"
+ "-DDOC_DIR=${CURRENT_PACKAGES_DIR}/share/${PORT}/doc"
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/plplot)
+vcpkg_fixup_pkgconfig()
+
+if("wxwidgets" IN_LIST FEATURES)
+ file(GLOB pkg_files "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*.pc")
+ foreach(pkg_file IN LISTS pkg_files)
+ vcpkg_replace_string("${pkg_file}" [[${prefix}/lib/mswu]] [[${prefix}/lib/mswud]] IGNORE_UNCHANGED)
+ endforeach()
+endif()
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+)
+
+if(NOT VCPKG_CROSSCOMPILING)
+ function(copy_tool name subdir cmake_name)
+ vcpkg_copy_tools(
+ TOOL_NAMES "${name}"
+ SEARCH_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${subdir}"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}/${subdir}"
+ )
+ configure_file(
+ "${CURRENT_PORT_DIR}/host-tool.cmake"
+ "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}/${subdir}/${cmake_name}"
+ @ONLY
+ )
+ endfunction()
+ copy_tool(plhershey-unicode-gen "include" "ImportExecutables.cmake")
+ copy_tool(tai-utc-gen "lib/qsastime" "tai-utc-gen.cmake")
+ copy_tool(deltaT-gen "lib/qsastime" "deltaT-gen.cmake")
+endif()
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(
+ FILE_LIST
+ "${SOURCE_PATH}/Copyright"
+ "${SOURCE_PATH}/COPYING.LIB"
+)
diff --git a/vcpkg/ports/plplot/subdirs.patch b/vcpkg/ports/plplot/subdirs.patch new file mode 100644 index 0000000..11f80ee --- /dev/null +++ b/vcpkg/ports/plplot/subdirs.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e29c43d..03f05f0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -347,12 +347,6 @@ add_subdirectory(src) + add_subdirectory(data) + add_subdirectory(bindings) + add_subdirectory(drivers) +-add_subdirectory(utils) +-add_subdirectory(plplot_test) +-add_subdirectory(examples) +-add_subdirectory(scripts) +-add_subdirectory(doc) +-add_subdirectory(www) + add_subdirectory(pkgcfg) + summary() + diff --git a/vcpkg/ports/plplot/usage b/vcpkg/ports/plplot/usage new file mode 100644 index 0000000..3b61041 --- /dev/null +++ b/vcpkg/ports/plplot/usage @@ -0,0 +1,22 @@ +plplot provides CMake targets: + + find_package(plplot CONFIG REQUIRED) + # C API, PLplot Core Library + target_link_libraries(main PRIVATE PLPLOT::plplot) + # C++ binding + target_link_libraries(main PRIVATE PLPLOT::plplotcxx) + # wxWidgets GUI binding (optional, feature "wxwidgets") + target_link_libraries(main PRIVATE PLPLOT::plplotwxwidgets) + # CSIRO Cubic Spline Approximation Library + target_link_libraries(main PRIVATE PLPLOT::csirocsa) + # QSAS Time Format Conversion Library + target_link_libraries(main PRIVATE PLPLOT::qsastime) + +plplot provides pkg-config modules: + + # C++ binding + plplot-c++ + # Core C library + plplot + # WxWidgets binding, optional, feature "wxwidgets" + plplot-wxwidgets diff --git a/vcpkg/ports/plplot/use-math-h-nan.patch b/vcpkg/ports/plplot/use-math-h-nan.patch new file mode 100644 index 0000000..1f39877 --- /dev/null +++ b/vcpkg/ports/plplot/use-math-h-nan.patch @@ -0,0 +1,28 @@ +diff --git "a/lib/csa/nan.h" "b/lib/csa/nan.h" +index 29fd3d2f..7f16e8c8 100644 +--- "a/lib/csa/nan.h" ++++ "b/lib/csa/nan.h" +@@ -19,6 +19,16 @@ + #if !defined ( _NAN_H ) + #define _NAN_H + ++// Try to use the implementation-provided NAN constant: ++ ++#include <math.h> ++ ++#if defined(NAN) ++ ++#define NaN ((double)NAN) ++ ++#else // ^^^ implementation provides NAN // implementation does not provide NAN vvv ++ + #if ( defined ( __GNUC__ ) && !defined ( __ICC ) ) || defined ( __BORLANDC__ ) + + static const double NaN = 0.0 / 0.0; +@@ -63,4 +73,6 @@ static const long long lNaN = ( (unsigned long long) 1 << 63 ) - 1; + + #endif + ++#endif // defined(NAN) ++ + #endif diff --git a/vcpkg/ports/plplot/vcpkg.json b/vcpkg/ports/plplot/vcpkg.json new file mode 100644 index 0000000..f89a3a9 --- /dev/null +++ b/vcpkg/ports/plplot/vcpkg.json @@ -0,0 +1,50 @@ +{ + "name": "plplot", + "version-semver": "5.15.0", + "port-version": 6, + "description": "PLplot is a cross-platform software package for creating scientific plots whose (UTF-8) plot symbols and text are limited in practice only by what Unicode-aware system fonts are installed on a user's computer.", + "homepage": "https://plplot.sourceforge.net/", + "license": null, + "dependencies": [ + { + "name": "freetype", + "default-features": false + }, + "pango", + { + "name": "plplot", + "host": true + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "wxwidgets": { + "description": "Enable wxWidgets GUI binding", + "dependencies": [ + { + "name": "wxwidgets", + "default-features": false + } + ] + }, + "x11": { + "description": "Enable X11 support", + "dependencies": [ + { + "name": "cairo", + "features": [ + "x11" + ] + }, + "libx11" + ] + } + } +} |