diff --git a/ports/xalan-c/0001-ALLOW_RTCc_IN_STL.patch b/ports/xalan-c/0001-ALLOW_RTCc_IN_STL.patch new file mode 100644 index 00000000000..a01096b0da8 --- /dev/null +++ b/ports/xalan-c/0001-ALLOW_RTCc_IN_STL.patch @@ -0,0 +1,65 @@ +diff --git a/c/Projects/Win32/VC10/AllInOne/AllInOne.vcxproj b/c/Projects/Win32/VC10/AllInOne/AllInOne.vcxproj +index 5a9d6a0..a0d12e8 100644 +--- a/c/Projects/Win32/VC10/AllInOne/AllInOne.vcxproj ++++ b/c/Projects/Win32/VC10/AllInOne/AllInOne.vcxproj +@@ -159,7 +159,7 @@ + + Disabled + $(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\src\;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories) +- XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions) ++ _ALLOW_RTCc_IN_STL;XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions) + true + true + EnableFastChecks +@@ -197,7 +197,7 @@ + + Disabled + $(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\src\;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories) +- XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions) ++ _ALLOW_RTCc_IN_STL;XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions) + true + true + EnableFastChecks +diff --git a/c/Projects/Win32/VC10/Utils/MsgCreator/MsgCreator.vcxproj b/c/Projects/Win32/VC10/Utils/MsgCreator/MsgCreator.vcxproj +index 27958b5..9f7767b 100644 +--- a/c/Projects/Win32/VC10/Utils/MsgCreator/MsgCreator.vcxproj ++++ b/c/Projects/Win32/VC10/Utils/MsgCreator/MsgCreator.vcxproj +@@ -159,6 +159,7 @@ + + Disabled + $(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;%(AdditionalIncludeDirectories) ++ _ALLOW_RTCc_IN_STL;%(PreprocessorDefinitions) + true + true + EnableFastChecks +@@ -191,7 +192,7 @@ + + Disabled + $(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;%(AdditionalIncludeDirectories) +- %(PreprocessorDefinitions) ++ _ALLOW_RTCc_IN_STL;%(PreprocessorDefinitions) + true + true + EnableFastChecks +diff --git a/c/Projects/Win32/VC10/Utils/XalanMsgLib/XalanMsgLib.vcxproj b/c/Projects/Win32/VC10/Utils/XalanMsgLib/XalanMsgLib.vcxproj +index facbbc1..53b83a8 100644 +--- a/c/Projects/Win32/VC10/Utils/XalanMsgLib/XalanMsgLib.vcxproj ++++ b/c/Projects/Win32/VC10/Utils/XalanMsgLib/XalanMsgLib.vcxproj +@@ -144,7 +144,7 @@ + Disabled + false + $(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories) +- XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions) ++ _ALLOW_RTCc_IN_STL;XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + true +@@ -170,7 +170,7 @@ + Disabled + false + $(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories) +- XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions) ++ _ALLOW_RTCc_IN_STL;XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + true diff --git a/ports/xalan-c/CONTROL b/ports/xalan-c/CONTROL new file mode 100644 index 00000000000..188c6bd4485 --- /dev/null +++ b/ports/xalan-c/CONTROL @@ -0,0 +1,4 @@ +Source: xalan-c +Version: 1.11 +Description: Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types +Build-Depends: xerces-c diff --git a/ports/xalan-c/portfile.cmake b/ports/xalan-c/portfile.cmake new file mode 100644 index 00000000000..bc92562b54f --- /dev/null +++ b/ports/xalan-c/portfile.cmake @@ -0,0 +1,61 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/xalan-c-1.11) +vcpkg_download_distfile(ARCHIVE + URLS "http://www-us.apache.org/dist/xalan/xalan-c/sources/xalan_c-1.11-src.zip" + FILENAME "xalan_c-1.11-src.zip" + SHA512 2e79a2c8f755c9660ffc94b26b6bd4b140685e05a88d8e5abb19a2f271383a3f2f398b173ef403f65dc33af75206214bd21ac012c39b4c0051b3a9f61f642fe6 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-ALLOW_RTCc_IN_STL.patch") + +if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") + set(BUILD_ARCH "Win32") + set(OUTPUT_DIR "Win32") +elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "x64") + set(BUILD_ARCH "x64") + set(OUTPUT_DIR "Win64") +else() + message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") +endif() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/c/projects/Win32/VC10/AllInOne/AllInOne.vcxproj + PLATFORM ${BUILD_ARCH} + # Need this for it to pick up xerces-c port: https://github.com/Microsoft/vcpkg/issues/891 + OPTIONS /p:ForceImportBeforeCppTargets=${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/vcpkg.targets) + +file(COPY ${SOURCE_PATH}/c/Build/${OUTPUT_DIR}/VC10/Debug/XalanMessages_1_11D.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +file(COPY ${SOURCE_PATH}/c/Build/${OUTPUT_DIR}/VC10/Debug/Xalan-C_1_11D.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +file(COPY ${SOURCE_PATH}/c/Build/${OUTPUT_DIR}/VC10/Debug/Xalan-C_1D.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(COPY ${SOURCE_PATH}/c/Build/${OUTPUT_DIR}/VC10/Release/XalanMessages_1_11.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY ${SOURCE_PATH}/c/Build/${OUTPUT_DIR}/VC10/Release/Xalan-C_1_11.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY ${SOURCE_PATH}/c/Build/${OUTPUT_DIR}/VC10/Release/Xalan-C_1.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +file(COPY ${SOURCE_PATH}/c/src/xalanc DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.hpp) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xalanc/NLS) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xalanc/util/MsgLoaders/ICU/resources) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xalanc/TestXSLT) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xalanc/XalanExe) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xalanc/XPathCAPI) + +# Handle copyright +file(COPY ${SOURCE_PATH}/c/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xalan-c) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/xalan-c/LICENSE ${CURRENT_PACKAGES_DIR}/share/xalan-c/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file