From 83e3a296dc6921b2371b12dde004b6d7a4d11dd6 Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Wed, 5 Jul 2017 12:52:10 +0300 Subject: [PATCH] [suitesparse] Porfile fix --- ports/suitesparse/CONTROL | 2 +- ports/suitesparse/portfile.cmake | 22 ++------------------ ports/suitesparse/remove-debug-postfix.patch | 11 ++++++++++ 3 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 ports/suitesparse/remove-debug-postfix.patch diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL index 74491898e0..000132c374 100644 --- a/ports/suitesparse/CONTROL +++ b/ports/suitesparse/CONTROL @@ -1,4 +1,4 @@ Source: suitesparse -Version: 4.5.5-1 +Version: 4.5.5-2 Build-Depends: metis, clapack Description: algebra library diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake index 737561f9f0..ce97c4b9fb 100644 --- a/ports/suitesparse/portfile.cmake +++ b/ports/suitesparse/portfile.cmake @@ -42,6 +42,7 @@ vcpkg_extract_source_archive(${SUITESPARSE} ${SUITESPARSEWIN_PATH}) vcpkg_apply_patches( SOURCE_PATH ${SUITESPARSEWIN_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-suitesparse.patch" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/remove-debug-postfix.patch" ) vcpkg_configure_cmake( @@ -63,11 +64,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/suitesparse/) - -file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SuiteSparse-config.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SuiteSparse-config-release.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-release.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/cmake/SuiteSparse-config-debug.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake) +vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake") file(RENAME ${CURRENT_PACKAGES_DIR}/UseSuiteSparse.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/UseSuiteSparse.cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/SuiteSparseConfig.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake) @@ -77,24 +74,9 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/SuiteSparseConfig.cmake) # Update paths in SuiteSparseConfig.cmake file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake _contents) string(REPLACE "set(SuiteSparse_LIB_POSTFIX \"64\")" "set(SuiteSparse_LIB_POSTFIX \"\")" _contents "${_contents}") -string(REPLACE "\#\# do nothing, it's OK" "include(${USE_SuiteSparse})" _contents "${_contents}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake "${_contents}") -# Update paths in SuiteSparse-config.cmake -file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake _contents) -string(REPLACE "get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)" - "get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)" _contents "${_contents}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake "${_contents}") - -# Update paths in SuiteSparse-config-debug.cmake -file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake _contents) -string(REPLACE "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/debug/lib/" _contents "${_contents}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake "${_contents}") - #clean folders -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright of suitesparse and suitesparse-metis-for-windows diff --git a/ports/suitesparse/remove-debug-postfix.patch b/ports/suitesparse/remove-debug-postfix.patch new file mode 100644 index 0000000000..1b41139dae --- /dev/null +++ b/ports/suitesparse/remove-debug-postfix.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt Mon Feb 22 22:18:25 2016 ++++ CMakeLists.txt Wed Jul 05 14:14:21 2017 +@@ -35,7 +35,7 @@ + + # We want libraries to be named "libXXX" and "libXXXd" in all compilers: + # ------------------------------------------------------------------------ +-set(CMAKE_DEBUG_POSTFIX "d") ++#set(CMAKE_DEBUG_POSTFIX "d") + IF(MSVC) + set(SP_LIB_PREFIX "lib") # Libs are: "libXXX" + ENDIF(MSVC)