From acad35f493231baff5406d04c562a89deaad5e16 Mon Sep 17 00:00:00 2001 From: Rodrigo Hernandez Date: Wed, 8 Nov 2017 00:08:05 -0600 Subject: [PATCH 1/2] [tidy-html5] Added libtidy version 5.4.0 --- ports/tidy-html5/CONTROL | 3 + ports/tidy-html5/portfile.cmake | 27 ++++++ .../remove_execution_character_set.patch | 90 +++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 ports/tidy-html5/CONTROL create mode 100644 ports/tidy-html5/portfile.cmake create mode 100644 ports/tidy-html5/remove_execution_character_set.patch diff --git a/ports/tidy-html5/CONTROL b/ports/tidy-html5/CONTROL new file mode 100644 index 0000000000..9f415ab7a6 --- /dev/null +++ b/ports/tidy-html5/CONTROL @@ -0,0 +1,3 @@ +Source: tidy-html5 +Version: 5.4.0 +Description: Tidy tidies HTML and XML. It can tidy your documents by itself, and developers can easily integrate its features into even more powerful tools. diff --git a/ports/tidy-html5/portfile.cmake b/ports/tidy-html5/portfile.cmake new file mode 100644 index 0000000000..ff0c2e5458 --- /dev/null +++ b/ports/tidy-html5/portfile.cmake @@ -0,0 +1,27 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO htacg/tidy-html5 + REF 5.4.0 + SHA512 d92c89f2ef371499f9c3de6f9389783d2449433b4da1f5a29e2eb81b7a7db8dd9f68e220cdde092d446e9bd779bcbc30f84bda79013526540f29d00f438cb402 + HEAD_REF master) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/remove_execution_character_set.patch +) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DBUILD_SHARED_LIB=ON -DTIDY_CONSOLE_SHARED=ON +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/tidyd.exe) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/tidy.exe ${CURRENT_PACKAGES_DIR}/tools/tidy.exe) +file(INSTALL ${SOURCE_PATH}/README/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/tidy-html5 RENAME copyright) diff --git a/ports/tidy-html5/remove_execution_character_set.patch b/ports/tidy-html5/remove_execution_character_set.patch new file mode 100644 index 0000000000..9f5ebf3e70 --- /dev/null +++ b/ports/tidy-html5/remove_execution_character_set.patch @@ -0,0 +1,90 @@ +diff --git a/src/language_en.h b/src/language_en.h +index ab191e0..e1cd96b 100644 +--- a/src/language_en.h ++++ b/src/language_en.h +@@ -18,10 +18,6 @@ + * Created by Jim Derry on 11/28/15. + */ + +-#ifdef _MSC_VER +-#pragma execution_character_set("utf-8") +-#endif +- + #include "language.h" + #include "access.h" + #include "message.h" +diff --git a/src/language_en_gb.h b/src/language_en_gb.h +index a89f0fe..7b14d6f 100644 +--- a/src/language_en_gb.h ++++ b/src/language_en_gb.h +@@ -31,10 +31,6 @@ + * PO_REVISION_DATE=2016-03-24 10:59:55 + */ + +-#ifdef _MSC_VER +-#pragma execution_character_set("utf-8") +-#endif +- + #include "language.h" + #include "access.h" + #include "message.h" +diff --git a/src/language_es.h b/src/language_es.h +index db09f2a..1e474b5 100644 +--- a/src/language_es.h ++++ b/src/language_es.h +@@ -31,10 +31,6 @@ + * PO_REVISION_DATE=2016-03-24 10:59:55 + */ + +-#ifdef _MSC_VER +-#pragma execution_character_set("utf-8") +-#endif +- + #include "language.h" + #include "access.h" + #include "message.h" +diff --git a/src/language_es_mx.h b/src/language_es_mx.h +index 5574b3b..530c9f1 100644 +--- a/src/language_es_mx.h ++++ b/src/language_es_mx.h +@@ -31,10 +31,6 @@ + * PO_REVISION_DATE=2016-03-24 10:59:55 + */ + +-#ifdef _MSC_VER +-#pragma execution_character_set("utf-8") +-#endif +- + #include "language.h" + #include "access.h" + #include "message.h" +diff --git a/src/language_fr.h b/src/language_fr.h +index c87ae7b..91baa5e 100644 +--- a/src/language_fr.h ++++ b/src/language_fr.h +@@ -31,10 +31,6 @@ + * PO_REVISION_DATE= + */ + +-#ifdef _MSC_VER +-#pragma execution_character_set("utf-8") +-#endif +- + #include "language.h" + #include "access.h" + #include "message.h" +diff --git a/src/language_zh_cn.h b/src/language_zh_cn.h +index 1c35fef..218203d 100644 +--- a/src/language_zh_cn.h ++++ b/src/language_zh_cn.h +@@ -31,10 +31,6 @@ + * PO_REVISION_DATE=2016-03-24 10:59:55 + */ + +-#ifdef _MSC_VER +-#pragma execution_character_set("utf-8") +-#endif +- + #include "language.h" + #include "access.h" + #include "message.h" From ef48879bd33f4c134907812bcdb3a5a40a30802e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Nov 2017 11:18:21 -0800 Subject: [PATCH 2/2] [tidy-html5] Handle static builds. --- ports/tidy-html5/CONTROL | 2 +- ports/tidy-html5/portfile.cmake | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ports/tidy-html5/CONTROL b/ports/tidy-html5/CONTROL index 9f415ab7a6..377e47f133 100644 --- a/ports/tidy-html5/CONTROL +++ b/ports/tidy-html5/CONTROL @@ -1,3 +1,3 @@ Source: tidy-html5 -Version: 5.4.0 +Version: 5.4.0-1 Description: Tidy tidies HTML and XML. It can tidy your documents by itself, and developers can easily integrate its features into even more powerful tools. diff --git a/ports/tidy-html5/portfile.cmake b/ports/tidy-html5/portfile.cmake index ff0c2e5458..da0ba45cac 100644 --- a/ports/tidy-html5/portfile.cmake +++ b/ports/tidy-html5/portfile.cmake @@ -12,16 +12,29 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/remove_execution_character_set.patch ) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIB) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DBUILD_SHARED_LIB=ON -DTIDY_CONSOLE_SHARED=ON + OPTIONS + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON + -DBUILD_SHARED_LIB=${BUILD_SHARED_LIB} + -DTIDY_CONSOLE_SHARED=${BUILD_SHARED_LIB} ) vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/tidyd.exe) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/tidy.exe ${CURRENT_PACKAGES_DIR}/tools/tidy.exe) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/tidy-html5) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/tidy.exe ${CURRENT_PACKAGES_DIR}/tools/tidy-html5/tidy.exe) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(INSTALL ${SOURCE_PATH}/README/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/tidy-html5 RENAME copyright)