From ed2d8564f0822115695a024f4e8ece2944e8bb4e Mon Sep 17 00:00:00 2001 From: Phoebe <20694052+PhoebeHui@users.noreply.github.com> Date: Thu, 16 Jan 2020 08:37:07 +0800 Subject: [plplot] fix static build issue (#8817) --- ports/plplot/0001-findwxwidgets-fixes.patch | 78 +++++++++++++---------- ports/plplot/0005-wxwidgets-fix-rel-lib-dir.patch | 23 ------- ports/plplot/CONTROL | 2 +- ports/plplot/fix_utils.patch | 23 +++++++ ports/plplot/portfile.cmake | 32 +++------- 5 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 ports/plplot/0005-wxwidgets-fix-rel-lib-dir.patch create mode 100644 ports/plplot/fix_utils.patch (limited to 'ports/plplot') diff --git a/ports/plplot/0001-findwxwidgets-fixes.patch b/ports/plplot/0001-findwxwidgets-fixes.patch index 72b1d6c25..cc30ca56d 100644 --- a/ports/plplot/0001-findwxwidgets-fixes.patch +++ b/ports/plplot/0001-findwxwidgets-fixes.patch @@ -1,59 +1,71 @@ diff --git a/cmake/modules/FindwxWidgets.cmake b/cmake/modules/FindwxWidgets.cmake -index 4d3a2d1..eaaa358 100644 +index 4d3a2d1..c83d8a6 100644 --- a/cmake/modules/FindwxWidgets.cmake +++ b/cmake/modules/FindwxWidgets.cmake -@@ -515,7 +515,16 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") +@@ -515,7 +515,14 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") set(_WX_ARCH _x64) endif() endif() - if(BUILD_SHARED_LIBS) -+ if(VCPKG_TARGET_TRIPLET) -+ find_library(wxWidgets_LIB_DIR -+ NAMES -+ wxmsw31ud_core.lib -+ wxmsw31u_core.lib -+ PATHS -+ DOC "Path to wxWidgets libraries" -+ ) -+ get_filename_component(wxWidgets_LIB_DIR ${wxWidgets_LIB_DIR} DIRECTORY) -+ elseif(BUILD_SHARED_LIBS) ++ ++ include(SelectLibraryConfigurations) ++ find_library(wxWidgets_LIB_DIR_LIBRARY_RELEASE NAMES wxmsw31u_core) ++ find_library(wxWidgets_LIB_DIR_LIBRARY_DEBUG NAMES wxmsw31ud_core) ++ select_library_configurations(wxWidgets_LIB_DIR) ++ get_filename_component(wxWidgets_LIB_DIR ${wxWidgets_LIB_DIR} DIRECTORY) ++ if(0) ++ if(BUILD_SHARED_LIBS) find_path(wxWidgets_LIB_DIR NAMES msw/wx/setup.h -@@ -571,6 +580,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") +@@ -554,6 +561,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") + NO_DEFAULT_PATH + ) + endif() ++ endif() + unset(_WX_TOOL) + unset(_WX_TOOLVER) + unset(_WX_ARCH) +@@ -571,7 +579,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") set(wxWidgets_DEFINITIONS WXUSINGDLL) DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}") endif() -+ if(VCPKG_TARGET_TRIPLET) +- ++ if(BUILD_SHARED_LIBS) + set(wxWidgets_DEFINITIONS WXUSINGDLL) -+ endif(VCPKG_TARGET_TRIPLET) - ++ endif(BUILD_SHARED_LIBS) # Search for available configuration types. foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw) -@@ -582,6 +594,15 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") - endif() + set(WX_${CFG}_FOUND FALSE) +@@ -583,6 +593,13 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") endforeach() DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}") -+ -+ if(VCPKG_TARGET_TRIPLET) -+ if(CMAKE_BUILD_TYPE STREQUAL "Debug") -+ set(WX_CONFIGURATION "mswud") -+ else() -+ set(WX_CONFIGURATION "mswu") -+ endif() -+ set(WX_${WX_CONFIGURATION}_FOUND TRUE) -+ endif(VCPKG_TARGET_TRIPLET) ++ if(CMAKE_BUILD_TYPE STREQUAL "Debug") ++ set(WX_CONFIGURATION "mswud") ++ else() ++ set(WX_CONFIGURATION "mswu") ++ endif() ++ set(WX_${WX_CONFIGURATION}_FOUND TRUE) ++ if(WX_CONFIGURATION) set(wxWidgets_FOUND TRUE) -@@ -616,7 +637,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") + +@@ -616,6 +633,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG) # Set wxWidgets lib setup include directory. -- if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) -+ if(VCPKG_TARGET_TRIPLET) -+ set(wxWidgets_INCLUDE_DIRS "${wxWidgets_ROOT_DIR}/include") -+ elseif(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) ++ set(wxWidgets_INCLUDE_DIRS "${wxWidgets_ROOT_DIR}/include") ++ if(0) + if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) set(wxWidgets_INCLUDE_DIRS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) - else() +@@ -623,7 +642,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") + DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") + set(wxWidgets_FOUND FALSE) + endif() +- ++ endif() + # Set wxWidgets main include directory. + if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) diff --git a/ports/plplot/0005-wxwidgets-fix-rel-lib-dir.patch b/ports/plplot/0005-wxwidgets-fix-rel-lib-dir.patch deleted file mode 100644 index 7ebe79f11..000000000 --- a/ports/plplot/0005-wxwidgets-fix-rel-lib-dir.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/cmake/modules/FindwxWidgets.cmake b/cmake/modules/FindwxWidgets.cmake -index eaaa358..a68683c 100644 ---- a/cmake/modules/FindwxWidgets.cmake -+++ b/cmake/modules/FindwxWidgets.cmake -@@ -516,13 +516,11 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") - endif() - endif() - if(VCPKG_TARGET_TRIPLET) -- find_library(wxWidgets_LIB_DIR -- NAMES -- wxmsw31ud_core.lib -- wxmsw31u_core.lib -- PATHS -- DOC "Path to wxWidgets libraries" -- ) -+ if(CMAKE_BUILD_TYPE STREQUAL "Debug") -+ find_library(wxWidgets_LIB_DIR NAMES wxmsw31ud_core.lib DOC "Path to wxWidgets libraries") -+ else() -+ find_library(wxWidgets_LIB_DIR NAMES wxmsw31u_core.lib DOC "Path to wxWidgets libraries") -+ endif() - get_filename_component(wxWidgets_LIB_DIR ${wxWidgets_LIB_DIR} DIRECTORY) - elseif(BUILD_SHARED_LIBS) - find_path(wxWidgets_LIB_DIR diff --git a/ports/plplot/CONTROL b/ports/plplot/CONTROL index b70c5d176..d489bc45f 100644 --- a/ports/plplot/CONTROL +++ b/ports/plplot/CONTROL @@ -1,5 +1,5 @@ Source: plplot -Version: 5.13.0-3 +Version: 5.13.0-4 Build-Depends: freetype, zlib, libpng, bzip2 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. diff --git a/ports/plplot/fix_utils.patch b/ports/plplot/fix_utils.patch new file mode 100644 index 000000000..d1d8596d0 --- /dev/null +++ b/ports/plplot/fix_utils.patch @@ -0,0 +1,23 @@ +diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt +index 59cfe20..b936dad 100644 +--- a/utils/CMakeLists.txt ++++ b/utils/CMakeLists.txt +@@ -75,7 +75,8 @@ add_executable(parity_bit_check parity_bit_check.c) + if(ENABLE_wxwidgets AND NOT OLD_WXWIDGETS) + # Build wxwidgets applications with same wxwidgets compile and link flags + # as used with the PLplot wxwidgets device driver. +- ++ find_package(JPEG REQUIRED) ++ find_package(TIFF REQUIRED) + set(wxPLViewer_SRCS wxplviewer.cpp wxplframe.cpp ${CMAKE_SOURCE_DIR}/drivers/wxwidgets_comms.cpp) + set_source_files_properties(${wxPLViewer_SRCS} + PROPERTIES COMPILE_FLAGS "${wxwidgets_COMPILE_FLAGS}") +@@ -90,7 +91,7 @@ if(ENABLE_wxwidgets AND NOT OLD_WXWIDGETS) + COMPILE_DEFINITIONS "USINGDLL" + ) + endif(BUILD_SHARED_LIBS) +- target_link_libraries(wxPLViewer plplotwxwidgets plplotcxx ${wxwidgets_LINK_FLAGS} ${MATH_LIB} ${RT_LIB}) ++ target_link_libraries(wxPLViewer plplotwxwidgets plplotcxx ${wxwidgets_LINK_FLAGS} ${MATH_LIB} ${RT_LIB} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES}) + + if(USE_RPATH) + # Assume that plplotwxwidgets and plplotcxx have the same install location as plplot diff --git a/ports/plplot/portfile.cmake b/ports/plplot/portfile.cmake index 46781da07..0bffd25aa 100644 --- a/ports/plplot/portfile.cmake +++ b/ports/plplot/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - set(PLPLOT_VERSION 5.13.0) set(PLPLOT_HASH 1d5cb5da17d4bde6d675585bff1f8dcb581719249a0b2687867e767703f8dab0870e7ea44b9549a497f4ac0141a3cabf6761c49520c0e2b26ffe581468512cbb) @@ -14,11 +12,11 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} REF ${PLPLOT_VERSION} PATCHES - "${CMAKE_CURRENT_LIST_DIR}/0001-findwxwidgets-fixes.patch" - "${CMAKE_CURRENT_LIST_DIR}/0002-wxwidgets-dev-fixes.patch" - "${CMAKE_CURRENT_LIST_DIR}/install-interface-include-directories.patch" - "${CMAKE_CURRENT_LIST_DIR}/use-math-h-nan.patch" - "0005-wxwidgets-fix-rel-lib-dir.patch" + 0001-findwxwidgets-fixes.patch + 0002-wxwidgets-dev-fixes.patch + install-interface-include-directories.patch + use-math-h-nan.patch + fix_utils.patch ) set(BUILD_with_wxwidgets OFF) @@ -53,8 +51,8 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/plplot) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/pltek.exe ${CURRENT_PACKAGES_DIR}/bin/pltek.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/wxPLViewer.exe - ${CURRENT_PACKAGES_DIR}/bin/wxPLViewer.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/wxPLViewer.exe + ${CURRENT_PACKAGES_DIR}/bin/wxPLViewer.exe ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -66,18 +64,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() # Remove unwanted and duplicate directories -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include -) - -file(INSTALL - ${SOURCE_PATH}/Copyright - DESTINATION ${CURRENT_PACKAGES_DIR}/share/plplot - RENAME copyright -) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() - -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/share -) +file(INSTALL ${SOURCE_PATH}/Copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/plplot RENAME copyright) \ No newline at end of file -- cgit v1.2.3