mirror of
https://github.com/microsoft/vcpkg.git
synced 2026-01-18 01:11:23 +01:00
[vcpkg baseline][orc] Update, fix, cleanup (#49121)
This commit is contained in:
31
ports/orc/external-project.diff
Normal file
31
ports/orc/external-project.diff
Normal file
@@ -0,0 +1,31 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 341a4c3..1aaff3e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -112,6 +112,13 @@ SET(CPACK_PACKAGE_CONTACT "Apache ORC <dev@orc.apache.org>")
|
||||
|
||||
INCLUDE(CPack)
|
||||
INCLUDE(ExternalProject)
|
||||
+function(ExternalProject_Add name)
|
||||
+ z_vcpkg_function_arguments(args 1)
|
||||
+ if(NOT "${name}" MATCHES "^orc-format")
|
||||
+ message(FATAL_ERROR "Unexpected external project: ${name}")
|
||||
+ endif()
|
||||
+ _ExternalProject_Add(${name} "${args}")
|
||||
+endfunction()
|
||||
|
||||
if (BUILD_POSITION_INDEPENDENT_LIB)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
|
||||
index 851cdc4..a23115e 100644
|
||||
--- a/cmake_modules/ThirdpartyToolchain.cmake
|
||||
+++ b/cmake_modules/ThirdpartyToolchain.cmake
|
||||
@@ -397,7 +397,7 @@ add_library (orc::lz4 ALIAS orc_lz4)
|
||||
# ----------------------------------------------------------------------
|
||||
# IANA - Time Zone Database
|
||||
|
||||
-if (WIN32)
|
||||
+if (WIN32 AND BUILD_CPP_TESTS)
|
||||
SET(CURRENT_TZDATA_FILE "")
|
||||
SET(CURRENT_TZDATA_SHA512 "")
|
||||
File(DOWNLOAD "https://ftp.osuosl.org/pub/cygwin/noarch/release/tzdata/sha512.sum" ${CMAKE_CURRENT_BINARY_DIR}/sha512.sum)
|
||||
@@ -4,69 +4,54 @@ vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO apache/orc
|
||||
REF "v${VERSION}"
|
||||
SHA512 eabee16a6e984452a8cb715d0524041b20dd1bd88d78bb32534db93e5dbdd786aa4df8c05975406cb0728241eb3025a506c4fefb8c334ef0d8a27e6cb920d44c
|
||||
SHA512 b81e1c2cebfd97757aaaa8dc9bed913810b0a47e599556bc3e9989dadf6b7665c335c37cd29d8430cd9b1af9048f37efaa56869872eb5f50fe35a570ec109a40
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
external-project.diff
|
||||
tools-build.diff
|
||||
)
|
||||
file(GLOB modules "${SOURCE_PATH}/cmake_modules/Find*.cmake")
|
||||
file(REMOVE ${modules} "${SOURCE_PATH}/c++/libs/libhdfspp/libhdfspp.tar.gz")
|
||||
|
||||
set(orc_format_version 1.1.1)
|
||||
vcpkg_download_distfile(ORC_FORMAT_ARCHIVE
|
||||
URLS "https://dlcdn.apache.org/orc/orc-format-${orc_format_version}/orc-format-${orc_format_version}.tar.gz"
|
||||
FILENAME "apache-orc-format-${orc_format_version}.tar.gz"
|
||||
SHA512 8aa0bcd3345ed8be836995d4347175526f4b0fc91f41e27f29279fad39b94ff157f5cd597bc2d9f3dc403f5ba405807675a283abe822f8a83758b7c3b8292c1c
|
||||
)
|
||||
set(ENV{ORC_FORMAT_URL} "file://${ORC_FORMAT_ARCHIVE}")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS options
|
||||
FEATURES
|
||||
tools BUILD_TOOLS
|
||||
)
|
||||
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_modules/FindGTest.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_modules/FindLZ4.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_modules/FindZSTD.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_modules/FindProtobuf.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_modules/FindSnappy.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_modules/FindZLIB.cmake")
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(BUILD_TOOLS OFF)
|
||||
# when cross compiling, we can't run their test. however:
|
||||
# - Windows doesn't support time_t < 0 => HAS_PRE_1970 test returns false
|
||||
# - Windows doesn't support setenv => HAS_POST_2038 test fails to compile
|
||||
set(time_t_checks "-DHAS_PRE_1970=OFF" "-DHAS_POST_2038=OFF")
|
||||
else()
|
||||
set(BUILD_TOOLS ON)
|
||||
set(time_t_checks "")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
set(configure_opts WINDOWS_USE_MSBUILD)
|
||||
list(APPEND options "-DHAS_PRE_1970=OFF" "-DHAS_POST_2038=OFF")
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
${configure_opts}
|
||||
OPTIONS
|
||||
${time_t_checks}
|
||||
-DBUILD_TOOLS=${BUILD_TOOLS}
|
||||
${options}
|
||||
-DBUILD_CPP_TESTS=OFF
|
||||
-DBUILD_JAVA=OFF
|
||||
-DINSTALL_VENDORED_LIBS=OFF
|
||||
-DBUILD_LIBHDFSPP=OFF
|
||||
-DSTOP_BUILD_ON_WARNING=OFF
|
||||
-DENABLE_TEST=OFF
|
||||
-DORC_PACKAGE_KIND=vcpkg
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
ENABLE_TEST
|
||||
-DSTOP_BUILD_ON_WARNING=OFF
|
||||
OPTIONS_DEBUG
|
||||
-DBUILD_TOOLS=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_cmake_config_fixup()
|
||||
|
||||
file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/bin/orc-*)
|
||||
if(TOOLS)
|
||||
file(COPY ${TOOLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/orc")
|
||||
file(REMOVE ${TOOLS})
|
||||
endif()
|
||||
|
||||
file(GLOB BINS "${CURRENT_PACKAGES_DIR}/bin/*")
|
||||
if(NOT BINS)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
if("tools" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(TOOL_NAMES csv-import orc-contents orc-memory orc-metadata orc-scan orc-statistics timezone-dump AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/NOTICE" "${SOURCE_PATH}/LICENSE")
|
||||
|
||||
66
ports/orc/tools-build.diff
Normal file
66
ports/orc/tools-build.diff
Normal file
@@ -0,0 +1,66 @@
|
||||
diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt
|
||||
index d247f90..498d369 100644
|
||||
--- a/tools/src/CMakeLists.txt
|
||||
+++ b/tools/src/CMakeLists.txt
|
||||
@@ -36,8 +36,12 @@
|
||||
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g ${CXX17_FLAGS} ${WARN_FLAGS}")
|
||||
|
||||
-add_library (orc-tools-common INTERFACE)
|
||||
-target_include_directories (orc-tools-common INTERFACE
|
||||
+add_library (orc-tools-common STATIC ToolsHelper.cc)
|
||||
+if(WIN32 AND NOT MINGW)
|
||||
+ find_package(getopt CONFIG REQUIRED)
|
||||
+ target_link_libraries(orc-tools-common PUBLIC $<IF:$<TARGET_EXISTS:getopt::getopt_shared>,getopt::getopt_shared,getopt::getopt_static>)
|
||||
+endif()
|
||||
+target_include_directories (orc-tools-common PUBLIC
|
||||
${PROJECT_BINARY_DIR}/c++/include
|
||||
${PROJECT_BINARY_DIR}/c++/src
|
||||
${PROJECT_SOURCE_DIR}/c++/include
|
||||
@@ -50,7 +54,6 @@ target_link_libraries (orc-tools-common INTERFACE
|
||||
|
||||
add_executable (orc-contents
|
||||
FileContents.cc
|
||||
- ToolsHelper.cc
|
||||
)
|
||||
|
||||
target_link_libraries (orc-contents
|
||||
@@ -59,7 +62,6 @@ target_link_libraries (orc-contents
|
||||
|
||||
add_executable (orc-scan
|
||||
FileScan.cc
|
||||
- ToolsHelper.cc
|
||||
)
|
||||
|
||||
target_link_libraries (orc-scan
|
||||
@@ -68,7 +70,6 @@ target_link_libraries (orc-scan
|
||||
|
||||
add_executable (orc-metadata
|
||||
FileMetadata.cc
|
||||
- ToolsHelper.cc
|
||||
)
|
||||
|
||||
target_link_libraries (orc-metadata
|
||||
@@ -86,7 +87,6 @@ target_link_libraries (orc-statistics
|
||||
|
||||
add_executable (orc-memory
|
||||
FileMemory.cc
|
||||
- ToolsHelper.cc
|
||||
)
|
||||
|
||||
target_link_libraries (orc-memory
|
||||
@@ -108,6 +108,14 @@ add_executable (csv-import
|
||||
target_link_libraries (csv-import
|
||||
orc-tools-common
|
||||
)
|
||||
+if(WIN32 AND NOT MINGW)
|
||||
+ find_path(GETTIMEOFDAY_INCLUDE_DIR gettimeofday.h REQUIRED)
|
||||
+ target_include_directories(csv-import PRIVATE "${GETTIMEOFDAY_INCLUDE_DIR}")
|
||||
+ file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/c++/include/sys")
|
||||
+ file(WRITE "${PROJECT_BINARY_DIR}/c++/include/sys/time.h" "extern \"C\" {\n#include <gettimeofday.h>\n}\n")
|
||||
+ find_library(GETTIMEOFDAY_LIBRARY gettimeofday PATH_SUFFIXES manual-link REQUIRED)
|
||||
+ target_link_libraries(csv-import "${GETTIMEOFDAY_LIBRARY}")
|
||||
+endif()
|
||||
|
||||
set(CPP_TOOL_NAMES
|
||||
orc-contents
|
||||
@@ -1,4 +0,0 @@
|
||||
orc provides CMake targets:
|
||||
|
||||
find_package(orc CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE orc::orc)
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "orc",
|
||||
"version": "2.1.0",
|
||||
"version": "2.2.1",
|
||||
"description": "The smallest, fastest columnar storage for Hadoop workloads.",
|
||||
"homepage": "https://orc.apache.org/",
|
||||
"license": "Apache-2.0",
|
||||
@@ -23,5 +23,20 @@
|
||||
},
|
||||
"zlib",
|
||||
"zstd"
|
||||
]
|
||||
],
|
||||
"features": {
|
||||
"tools": {
|
||||
"description": "Build tools",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "getopt-win32",
|
||||
"platform": "windows & !mingw"
|
||||
},
|
||||
{
|
||||
"name": "gettimeofday",
|
||||
"platform": "windows & !mingw"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +199,7 @@ openzl:x64-windows-release=fail
|
||||
openzl:x64-windows-static-md=fail
|
||||
openzl:x64-windows-static=fail
|
||||
openzl:x64-windows=fail
|
||||
orc(android)=fail # try_run for time_t properties
|
||||
paho-mqtt(uwp)=fail
|
||||
paraview(arm64 & windows & !uwp)=fail # in-build host tools
|
||||
pfring:arm64-osx=fail
|
||||
|
||||
@@ -7369,7 +7369,7 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"orc": {
|
||||
"baseline": "2.1.0",
|
||||
"baseline": "2.2.1",
|
||||
"port-version": 0
|
||||
},
|
||||
"orefkov-simstr": {
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "8257ee1040f79b5efc737713fbd6b524518e0845",
|
||||
"version": "2.2.1",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "0be0ad4bd945bf213667aa0d682b91b498073eb0",
|
||||
"version": "2.1.0",
|
||||
|
||||
Reference in New Issue
Block a user