vcpkg/ports/xalan-c/portfile.cmake

133 lines
5.6 KiB
CMake
Raw Normal View History

include(vcpkg_common_functions)
2017-04-11 19:58:14 +08:00
2019-03-27 17:40:19 +08:00
string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH)
if(BUILDTREES_PATH_LENGTH GREATER 37 AND CMAKE_HOST_WIN32)
[many ports] improvements for linux/wsl (#6730) * [many ports] improve compatibility with WSL and mixed case filesystems * [treehopper] express dependency on libusb, which was not working on non-win32 platforms and is still broken there * [libharu] add compatibility with non-win32 platforms * [geogram] fix openblas on linux [clapack] better integration with linux environment [visit-struct] put cmake config file in the expected folder [geogram] remove trailing underscore to enable compatibility with OpenBLAS * [openblas] playing with underscore, without success * [openblas/lapack] fix library integration * [clapack] improve target handling in cmake module * [openblas] promote self-generated config to default cmake module, otherwise internal ones thinks wrongly that openblas can also solve lapack libs * [clapack,openblas] improve libraries integration * [many ports] fix cmake unnecessary target paths, wrong config paths, empty default dependencies, unnecessary [core] tags * [suitesparse] improve integration with new lapack/openblas mechanism * [suitesparse] add no underscore postfix also for linux * [ceres] fix integration with newer openblas/lapack configs * [aws-c-event-stream] fix regression * [systemc] fix regression * [libwebp,geogram] trigger rebuild * [libwebp,pthread4w] fix regressions * [glbinding] fix cmake module installation * [globjects] disentangle unnecessary dependency from qt5 * [jasper] remove broken and unnecessary patches * [libwebp] fix regression * [many ports] avoid using BUILD_SHARED_LIBS which is uninitialized in port files * [clapack] correctly find dlls * [clapack] use a generic blas as dependency * [fizz,g2o] restore expected version * fix mistake * [many ports] remove WIN32, APPLE and UNIX (again, they keep creeping in) from ports since they are broken and usually break non-win32 ports * [libressl,openssl] do not try to build one if the other is already installed * [itk] update ref and patch to avoid regression * [libressl,openssl] implement full strategy to fix CI * [libwebp] disable components that are broken on macOS * [ogre] enable macOS build * [freeimage,jxrlib,ogre,openexr,protobuf] port patches from #5169 * [ogre] add missing install command * [ffmpeg] enable wrapper for cmake module * [ffmpeg] add avresample module finder * [ffmpeg] improve module detection and exported symbols * [ffmpeg] add variables to cache * [thrift] remove unnecessary build option * [allegro5] fix shared/static inversion * [protobuf] cleanup * [libressl] cleanup * [moos-core] cleanup * commented features must not be separated from other features, otherwise vcpkg complains * [itk] fix regression * [shogun,itk] fix regressions * [ogre] fix regression * [opusfile] add compatibility with non-win32 * [itk] fix regression * [sndfile,libsndfile] remove duplicate, redirect sndfile to libsndfile * add missing dependencies * [ismrmrd] fix regression * [ffmpeg] trigger rebuild * [clapack,openblas,libogg] fix regressions on macOS * [libtins] fix regression * force rebuild windows regressions, unable to reproduce locally * [mosquitto] enable non-win32 builds * [json-dto] force rebuild, unable to reproduce regression locally * [many ports] uniform naming and path length requests * fix regression * fix regression * [ffmpeg] fixes for downstream projects * clean up - thanks to reviewers * trigger rebuild of regressions on macOS * trigger rebuild of regressions on macOS - part2 * Add core back * Use VCPKG_CONCURRENCY * Add core back to suitesparse * Add core back to curl * Add core back to magnum * Add core back to magnum * Add core back to magnum * Add core back to cgal
2019-06-21 10:11:54 +08:00
message(WARNING "${PORT}'s buildsystem uses very long paths and may fail on your system.\n"
2019-03-27 17:40:19 +08:00
"We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command."
)
endif()
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
2017-04-23 23:35:13 +08:00
set(XALANC_VERSION 1.11)
2017-04-23 23:35:13 +08:00
2017-04-11 19:58:14 +08:00
vcpkg_download_distfile(ARCHIVE
URLS "http://www-us.apache.org/dist/xalan/xalan-c/sources/xalan_c-${XALANC_VERSION}-src.zip"
FILENAME "xalan_c-${XALANC_VERSION}-src.zip"
2017-04-11 19:58:14 +08:00
SHA512 2e79a2c8f755c9660ffc94b26b6bd4b140685e05a88d8e5abb19a2f271383a3f2f398b173ef403f65dc33af75206214bd21ac012c39b4c0051b3a9f61f642fe6
)
vcpkg_download_distfile(XALAN_PATCH8
URLS "https://github.com/rleigh-codelibre/vcpkg-patches/raw/ca09d69280469ce8f787c67b48f86e46a463ef5d/xalan-c/0008-remove-unary-binary-function.patch"
FILENAME "0008-remove-unary-binary-function.patch"
SHA512 059d9a39b29125ae770369e4c44ab7804ae16d4ff5c90e35f25b7990dc987161bf1187ceb2dcbab181ffb72490a9d9f45e30ab5928644734e7627cb74b03e201
)
vcpkg_download_distfile(XALAN_PATCH9
URLS "https://raw.githubusercontent.com/rleigh-codelibre/vcpkg-patches/ca09d69280469ce8f787c67b48f86e46a463ef5d/xalan-c/0009-remove-select-workaround.patch"
FILENAME "0009-remove-select-workaround.patch"
SHA512 73730736cd1f1809ebcc35562017402d606cbfd5a64665d104a21d89d679ab3274f6f5685ab63305c57fffab74e62084c0e18c76d19eb5f9c2e36be6679fd4d3
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${XALANC_VERSION}
PATCHES
0001-ALLOW_RTCc_IN_STL.patch
0002-no-mfc.patch
0003-char16_t.patch
0004-macosx-dyld-fallback.patch
0005-fix-ftbfs-ld-as-needed.patch
0006-fix-testxslt-segfault.patch
0007-fix-readme-typos.patch
${XALAN_PATCH8}
${XALAN_PATCH9}
)
2017-04-11 19:58:14 +08:00
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
2019-07-30 07:11:43 +08:00
set(BITS 32)
2017-04-11 19:58:14 +08:00
elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
2019-07-30 07:11:43 +08:00
set(BITS 64)
2017-04-11 19:58:14 +08:00
else()
message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
2019-07-30 07:11:43 +08:00
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
list(APPEND BUILD_TYPES "release")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
list(APPEND BUILD_TYPES "debug")
endif()
2017-04-11 19:58:14 +08:00
2019-07-30 07:11:43 +08:00
set(XALANCROOT ${SOURCE_PATH}/c)
set(ENV{XALANCROOT} ${XALANCROOT})
foreach(BUILD_TYPE IN LISTS BUILD_TYPES)
if(BUILD_TYPE STREQUAL "release")
set(P ${CURRENT_PACKAGES_DIR})
set(SHORT rel)
set(OPTS)
set(ENV{XERCESCROOT} ${CURRENT_INSTALLED_DIR})
else()
set(P ${CURRENT_PACKAGES_DIR}/debug)
set(SHORT dbg)
set(OPTS -d -z -I${CURRENT_INSTALLED_DIR}/include)
set(ENV{XERCESCROOT} ${CURRENT_INSTALLED_DIR}/debug)
endif()
set(DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT})
file(REMOVE_RECURSE ${DIR})
file(MAKE_DIRECTORY ${DIR})
message(STATUS "Configuring ${TARGET_TRIPLET}-${SHORT}")
vcpkg_execute_required_process(
COMMAND ${XALANCROOT}/runConfigure -p linux -c gcc -x g++ -b ${BITS} -P ${P} ${OPTS}
WORKING_DIRECTORY ${DIR}
LOGNAME configure-${TARGET_TRIPLET}-${SHORT}
)
message(STATUS "Building ${TARGET_TRIPLET}-${SHORT}")
vcpkg_execute_required_process(
COMMAND make -i -j${VCPKG_CONCURRENCY}
WORKING_DIRECTORY ${DIR}
LOGNAME make-${TARGET_TRIPLET}-${SHORT}
)
message(STATUS "Installing ${TARGET_TRIPLET}-${SHORT}")
vcpkg_execute_required_process(
COMMAND make install
WORKING_DIRECTORY ${DIR}
LOGNAME install-${TARGET_TRIPLET}-${SHORT}
)
endforeach()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/debug/include)
file(COPY ${SOURCE_PATH}/c/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
else()
set(ENV{CL} "$ENV{CL} \"/I${CURRENT_INSTALLED_DIR}/include\"")
set(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin")
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH c/projects/Win32/VC10/AllInOne/AllInOne.vcxproj
OPTIONS_RELEASE /p:XERCESCROOT=${CURRENT_INSTALLED_DIR}
OPTIONS_DEBUG /p:XERCESCROOT=${CURRENT_INSTALLED_DIR}/debug
LICENSE_SUBPATH c/LICENSE
SKIP_CLEAN
)
2019-07-30 07:11:43 +08:00
file(COPY ${SOURCE_PATH}/c/src/xalanc DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.hpp)
2017-04-11 19:58:14 +08:00
2019-07-30 07:11:43 +08:00
# LocalMsgIndex.hpp and LocalMsgData.hpp are here
file(GLOB NLS_INCLUDES "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/c/Build/*/VC10/Release/Nls/Include/*.hpp")
if(NOT NLS_INCLUDES)
message(FATAL_ERROR "Could not locate LocalMsgIndex.hpp")
endif()
file(COPY ${NLS_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/xalanc/PlatformSupport)
2019-07-30 07:11:43 +08:00
vcpkg_clean_msbuild()
2019-07-30 07:11:43 +08:00
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)
endif()