From 947e0c6a07e578eb861340b9e4a3a76bdf31239b Mon Sep 17 00:00:00 2001 From: Stanislav Ershov Date: Wed, 11 Sep 2019 23:16:11 +0300 Subject: [PATCH] [libqrencode] Remove unnessesary patch, it's in upstream now (#8099) [libqrencode] Add feature to build qrencode tool --- ports/libqrencode/CONTROL | 6 ++++- ports/libqrencode/fix-found-wingetopt.patch | 13 ++++++++++ ports/libqrencode/portfile.cmake | 24 +++++++++++++++++-- .../remove-deprecated-attribute.patch | 16 ------------- 4 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 ports/libqrencode/fix-found-wingetopt.patch delete mode 100644 ports/libqrencode/remove-deprecated-attribute.patch diff --git a/ports/libqrencode/CONTROL b/ports/libqrencode/CONTROL index 9bfd8fa85..d707bb900 100644 --- a/ports/libqrencode/CONTROL +++ b/ports/libqrencode/CONTROL @@ -1,5 +1,9 @@ Source: libqrencode -Version: 4.0.2 +Version: 4.0.2-1 Build-Depends: libpng, libiconv Homepage: https://github.com/fukuchi/libqrencode Description: libqrencode - a fast and compact QR Code encoding library + +Feature: tool +Description: Build qrencode tool +Build-Depends: getopt (windows) diff --git a/ports/libqrencode/fix-found-wingetopt.patch b/ports/libqrencode/fix-found-wingetopt.patch new file mode 100644 index 000000000..4c28f1cf3 --- /dev/null +++ b/ports/libqrencode/fix-found-wingetopt.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3a85c41..92dadca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -73,7 +73,7 @@ if(MSVC) + + if(WITH_TOOLS) + find_path(GETOPT_INCLUDE_DIR getopt.h PATH_SUFFIXES include) +- find_library(GETOPT_LIBRARIES wingetopt PATH_SUFFIXES lib) ++ find_library(GETOPT_LIBRARIES getopt PATH_SUFFIXES lib) + include_directories(${GETOPT_INCLUDE_DIR}) + endif(WITH_TOOLS) + endif(MSVC) diff --git a/ports/libqrencode/portfile.cmake b/ports/libqrencode/portfile.cmake index cfcd4650a..98a6d400e 100644 --- a/ports/libqrencode/portfile.cmake +++ b/ports/libqrencode/portfile.cmake @@ -6,24 +6,38 @@ vcpkg_from_github( REF v4.0.2 SHA512 847e32bd13358319f3beabde103b5335a6e11c3f9275425b74e89a00b0ee4d67af8a428f12acc8b80a0419382480e5aeb02e58602a69ee750c21b28f357af6bc HEAD_REF master - PATCHES remove-deprecated-attribute.patch + PATCHES + fix-found-wingetopt.patch ) +if("tool" IN_LIST FEATURES) + set(WITH_TOOLS YES) +else() + set(WITH_TOOLS NO) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DWITH_TOOLS=NO + -DWITH_TOOLS=${WITH_TOOLS} -DWITH_TEST=NO -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON -DSKIP_INSTALL_FILES=ON OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON + -DWITH_TOOLS=NO ) vcpkg_install_cmake() +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") # Windows + set(EXECUTABLE_SUFFIX ".exe") +else() + set(EXECUTABLE_SUFFIX "") +endif() + if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/qrencode.dll) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/qrencode.dll ${CURRENT_PACKAGES_DIR}/bin/qrencode.dll) @@ -32,6 +46,12 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/qrencoded.dll) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/qrencoded.dll ${CURRENT_PACKAGES_DIR}/debug/bin/qrencoded.dll) endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/qrencode${EXECUTABLE_SUFFIX}) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/qrencode") + file(RENAME "${CURRENT_PACKAGES_DIR}/bin/qrencode${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/qrencode/qrencode${EXECUTABLE_SUFFIX}") + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qrencode) +endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libqrencode) diff --git a/ports/libqrencode/remove-deprecated-attribute.patch b/ports/libqrencode/remove-deprecated-attribute.patch deleted file mode 100644 index 1a00c3a3b..000000000 --- a/ports/libqrencode/remove-deprecated-attribute.patch +++ /dev/null @@ -1,16 +0,0 @@ - qrencode.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/qrencode.h b/qrencode.h -index b855f0a..a6d4a29 100644 ---- a/qrencode.h -+++ b/qrencode.h -@@ -555,7 +555,7 @@ extern char *QRcode_APIVersionString(void); - /** - * @deprecated - */ --extern void QRcode_clearCache(void) __attribute__ ((deprecated)); -+extern void QRcode_clearCache(void); - - #if defined(__cplusplus) - }