diff options
| author | zi-m <53815290+zi-m@users.noreply.github.com> | 2019-09-26 21:56:46 +0200 |
|---|---|---|
| committer | dan-shaw <51385773+dan-shaw@users.noreply.github.com> | 2019-09-26 12:56:46 -0700 |
| commit | 22389a469001231fdf347ce8de9c94c281baa755 (patch) | |
| tree | 5d669dab3f1b81554dcec4c0ac91090a4f21d1bf | |
| parent | 4afc873253cbcf46c4418dde3d017cf1cfdfdd71 (diff) | |
| download | vcpkg-22389a469001231fdf347ce8de9c94c281baa755.tar.gz vcpkg-22389a469001231fdf347ce8de9c94c281baa755.zip | |
[clickhouse-cpp] Add new port (#7880)
* cityhash
* clickhouse-cpp
* add LZ4_DISABLE_DEPRECATE_WARNINGS
* add CXX_STANDARD 11
* remove 'usage' file
* tabs -> spaces
* use version of 2019-05-22 instead of patching code
* fix: remove ports/cityhash/usage
| -rw-r--r-- | ports/clickhouse-cpp/00001-fix-build.patch | 42 | ||||
| -rw-r--r-- | ports/clickhouse-cpp/CMakeLists.txt | 40 | ||||
| -rw-r--r-- | ports/clickhouse-cpp/CONTROL | 5 | ||||
| -rw-r--r-- | ports/clickhouse-cpp/portfile.cmake | 28 |
4 files changed, 115 insertions, 0 deletions
diff --git a/ports/clickhouse-cpp/00001-fix-build.patch b/ports/clickhouse-cpp/00001-fix-build.patch new file mode 100644 index 000000000..8fb57d50e --- /dev/null +++ b/ports/clickhouse-cpp/00001-fix-build.patch @@ -0,0 +1,42 @@ +diff --git a/clickhouse/base/compressed.cpp b/clickhouse/base/compressed.cpp +index 6b7af08..c3a6449 100644 +--- a/clickhouse/base/compressed.cpp ++++ b/clickhouse/base/compressed.cpp +@@ -1,8 +1,8 @@ + #include "compressed.h" + #include "wire_format.h" + +-#include <cityhash/city.h> +-#include <lz4/lz4.h> ++#include <city.h> ++#include <lz4.h> + + #include <system_error> + +diff --git a/clickhouse/client.cpp b/clickhouse/client.cpp +index 1053006..59950ab 100644 +--- a/clickhouse/client.cpp ++++ b/clickhouse/client.cpp +@@ -8,8 +8,8 @@ + + #include "columns/factory.h" + +-#include <cityhash/city.h> +-#include <lz4/lz4.h> ++#include <city.h> ++#include <lz4.h> + + #include <assert.h> + #include <atomic> +diff --git a/clickhouse/types/types.h b/clickhouse/types/types.h +index 8d453cd..69aa6a4 100644 +--- a/clickhouse/types/types.h ++++ b/clickhouse/types/types.h +@@ -4,6 +4,7 @@ + #include <memory> + #include <string> + #include <vector> ++#include <stdexcept> + + namespace clickhouse { + diff --git a/ports/clickhouse-cpp/CMakeLists.txt b/ports/clickhouse-cpp/CMakeLists.txt new file mode 100644 index 000000000..08a597b39 --- /dev/null +++ b/ports/clickhouse-cpp/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.13) +project(clickhouse-cpp CXX) + +find_package(lz4 CONFIG REQUIRED) +find_package(cityhash CONFIG REQUIRED) + +file(GLOB_RECURSE SOURCES "clickhouse/*.cpp") +file(GLOB_RECURSE HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "clickhouse/*.h") + +add_library(clickhouse-cpp STATIC ${SOURCES}) + +target_compile_definitions(clickhouse-cpp PRIVATE LZ4_DISABLE_DEPRECATE_WARNINGS) + +set_target_properties(clickhouse-cpp PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON +) + +target_include_directories(clickhouse-cpp PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> +) + +target_link_libraries(clickhouse-cpp + PRIVATE lz4::lz4 + PRIVATE cityhash +) + +install(TARGETS clickhouse-cpp EXPORT clickhouse-cpp-config + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +install(EXPORT clickhouse-cpp-config DESTINATION share/cmake/clickhouse-cpp) + +foreach (HEADER ${HEADERS} ) + get_filename_component(HEADER_DIR ${HEADER} DIRECTORY) + install(FILES ${HEADER} DESTINATION include/${HEADER_DIR}) +endforeach() diff --git a/ports/clickhouse-cpp/CONTROL b/ports/clickhouse-cpp/CONTROL new file mode 100644 index 000000000..fc8cf6a61 --- /dev/null +++ b/ports/clickhouse-cpp/CONTROL @@ -0,0 +1,5 @@ +Source: clickhouse-cpp +Version: 2019-05-22 +Build-Depends: lz4, cityhash +Homepage: https://github.com/artpaul/clickhouse-cpp +Description: C++ client for Yandex ClickHouse. diff --git a/ports/clickhouse-cpp/portfile.cmake b/ports/clickhouse-cpp/portfile.cmake new file mode 100644 index 000000000..eefea2acf --- /dev/null +++ b/ports/clickhouse-cpp/portfile.cmake @@ -0,0 +1,28 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO artpaul/clickhouse-cpp + REF 1634d8b9e2f3183de1574344563d90557be3b305 + SHA512 bef74f624c2a777f8ec6b7e87ac3cc564e914bcecc639b3889695da56be4c90531309a8fd87054c2777580c36bc3b2d6e9c5690a6345018bf65a5294eeeb3390 + HEAD_REF master + PATCHES 00001-fix-build.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/clickhouse-cpp) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/clickhouse-cpp/copyright COPYONLY) |
