Merge pull request #963 from jumpinjackie/port-xalan-c

Add xalan-c
This commit is contained in:
Robert Schumacher 2017-04-23 09:03:46 -07:00 committed by GitHub
commit 1cbb3e8714
5 changed files with 163 additions and 0 deletions

3
ports/atlmfc/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: atlmfc
Version: 0
Description: a stub package that ensures VS has ATL/MFC installed.

View File

@ -0,0 +1,10 @@
find_path(AFXRES_H
NAMES afxres.h
PATHS $ENV{INCLUDE}
)
if(NOT AFXRES_H)
message(FATAL_ERROR "Unable to locate 'afxres.h'. Ensure you have installed the ATL/MFC component of Visual Studio.")
endif()
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)

View File

@ -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 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\src\;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_ALLOW_RTCc_IN_STL;XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -197,7 +197,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\src\;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_ALLOW_RTCc_IN_STL;XALAN_BUILD_DLL;XALAN_INMEM_MSG_LOADER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
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 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_ALLOW_RTCc_IN_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -191,7 +192,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_ALLOW_RTCc_IN_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
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 @@
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_ALLOW_RTCc_IN_STL;XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<SmallerTypeCheck>true</SmallerTypeCheck>
@@ -170,7 +170,7 @@
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)\include;$(XERCESCROOT)\src;..\..\..\..\..\src;$(OutDir)Nls\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_ALLOW_RTCc_IN_STL;XALAN_XALANMSGLIB_BUILD_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<SmallerTypeCheck>true</SmallerTypeCheck>

4
ports/xalan-c/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: xalan-c
Version: 1.11-1
Description: Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types
Build-Depends: xerces-c, atlmfc

View File

@ -0,0 +1,81 @@
# 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 = <C:\path\to\current\vcpkg>
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
#
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message(STATUS "Only DLL builds are currently supported.")
set(VCPKG_LIBRARY_LINKAGE "dynamic")
endif()
if(VCPKG_CRT_LINKAGE STREQUAL "static")
message(FATAL_ERROR "Only dynamic linking against the CRT is currently supported.")
endif()
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)
# This is needed to generate the required LocalMsgIndex.hpp header
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/c/projects/Win32/VC10/Utils/XalanMsgLib/XalanMsgLib.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)
# LocalMsgIndex.hpp is here
file(COPY ${SOURCE_PATH}/c/Build/${OUTPUT_DIR}/VC10/Release/Nls/Include/LocalMsgIndex.hpp
DESTINATION ${CURRENT_PACKAGES_DIR}/include/xalanc/PlatformSupport)
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()