From 9cbb3eef123a6c360e3f6bb92a99bb6097ab7451 Mon Sep 17 00:00:00 2001 From: "mingquan.ji" <6930445+nevermore3@users.noreply.github.com> Date: Thu, 4 Jan 2024 20:58:45 +0800 Subject: [PATCH 1/3] add date --- README.md | 1 + project/CMakeLists.txt | 2 ++ project/externals/date.cmake | 43 ++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 project/externals/date.cmake diff --git a/README.md b/README.md index 879b2c4..fbb6c7d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ * breakpad * bzip2 * capstone + * date * double-conversion * fatal * fbthrift diff --git a/project/CMakeLists.txt b/project/CMakeLists.txt index 856f394..4eba42a 100644 --- a/project/CMakeLists.txt +++ b/project/CMakeLists.txt @@ -154,6 +154,7 @@ set(ALL_TARGETS bzip2 cachelib cyrus-sasl + date double-conversion duckdb fatal @@ -245,6 +246,7 @@ endmacro() maybe_add_dependencies(autoconf-archive autoconf) maybe_add_dependencies(automake autoconf autoconf-archive) maybe_add_dependencies(libtool automake) +maybe_add_dependencies(date) maybe_add_dependencies(glog libtool libunwind) maybe_add_dependencies(gettext libtool) diff --git a/project/externals/date.cmake b/project/externals/date.cmake new file mode 100644 index 0000000..378cf2c --- /dev/null +++ b/project/externals/date.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2024 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License. + +set(name date) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.tar.gz + URL_HASH MD5=78902f47f7931a3ae8a320e0dea1f20a + DOWNLOAD_NAME date-3.0.1.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --enable-shared --disable-static + CMAKE_ARGS + ${common_cmake_args} + -DBUILD_TZ_LIB=ON + -DENABLE_DATE_TESTING=OFF + -DCMAKE_BUILD_TYPE=Release + BUILD_IN_SOURCE 1 + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) From ca51938e0dc8278d949fa50dc33818070eb7dbbc Mon Sep 17 00:00:00 2001 From: "mingquan.ji" <6930445+nevermore3@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:43:25 +0800 Subject: [PATCH 2/3] fix build date error --- project/CMakeLists.txt | 2 +- project/externals/boost.cmake | 2 +- project/externals/date.cmake | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/project/CMakeLists.txt b/project/CMakeLists.txt index 4eba42a..d2eff4e 100644 --- a/project/CMakeLists.txt +++ b/project/CMakeLists.txt @@ -246,7 +246,6 @@ endmacro() maybe_add_dependencies(autoconf-archive autoconf) maybe_add_dependencies(automake autoconf autoconf-archive) maybe_add_dependencies(libtool automake) -maybe_add_dependencies(date) maybe_add_dependencies(glog libtool libunwind) maybe_add_dependencies(gettext libtool) @@ -257,6 +256,7 @@ maybe_add_dependencies(lzma gettext) maybe_add_dependencies(libev gettext) maybe_add_dependencies(libevent libtool openssl) maybe_add_dependencies(libcurl libtool openssl) +maybe_add_dependencies(date libcurl) maybe_add_dependencies(gperf libtool) maybe_add_dependencies(cyrus-sasl openssl berkeleydb automake libtool) maybe_add_dependencies(ldap berkeleydb libtool openssl cyrus-sasl) diff --git a/project/externals/boost.cmake b/project/externals/boost.cmake index 06d94dd..4644e4e 100644 --- a/project/externals/boost.cmake +++ b/project/externals/boost.cmake @@ -20,7 +20,7 @@ endif() ExternalProject_Add( ${name} - URL https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.gz + URL https://cytranet.dl.sourceforge.net/project/boost/boost/1.81.0/boost_1_81_0.tar.gz URL_HASH MD5=4bf02e84afb56dfdccd1e6aec9911f4b DOWNLOAD_NAME boost-1.81.0.tar.gz PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} diff --git a/project/externals/date.cmake b/project/externals/date.cmake index 378cf2c..f8b5006 100644 --- a/project/externals/date.cmake +++ b/project/externals/date.cmake @@ -14,14 +14,11 @@ ExternalProject_Add( STAMP_DIR ${BUILD_INFO_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR} SOURCE_DIR ${source_dir} - CONFIGURE_COMMAND - ${common_configure_envs} - ./configure ${common_configure_args} - --enable-shared --disable-static CMAKE_ARGS ${common_cmake_args} -DBUILD_TZ_LIB=ON -DENABLE_DATE_TESTING=OFF + -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release BUILD_IN_SOURCE 1 BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} From f89e40e7aa9031c78724f7ac10037f29b88f0d7c Mon Sep 17 00:00:00 2001 From: "mingquan.ji" <6930445+nevermore3@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:52:13 +0800 Subject: [PATCH 3/3] add patch --- project/externals/date.cmake | 1 + project/patches/date-3.0.1.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 project/patches/date-3.0.1.patch diff --git a/project/externals/date.cmake b/project/externals/date.cmake index f8b5006..19d9f7b 100644 --- a/project/externals/date.cmake +++ b/project/externals/date.cmake @@ -14,6 +14,7 @@ ExternalProject_Add( STAMP_DIR ${BUILD_INFO_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR} SOURCE_DIR ${source_dir} + PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/patches/${name}-3.0.1.patch CMAKE_ARGS ${common_cmake_args} -DBUILD_TZ_LIB=ON diff --git a/project/patches/date-3.0.1.patch b/project/patches/date-3.0.1.patch new file mode 100644 index 0000000..42c8415 --- /dev/null +++ b/project/patches/date-3.0.1.patch @@ -0,0 +1,13 @@ +--- CMakeLists.txt 2024-01-05 14:59:42.233660898 +0800 ++++ src/CMakeLists.txt 2024-01-08 14:07:39.058107005 +0800 +@@ -153,8 +153,8 @@ + endif( ) + if( NOT USE_SYSTEM_TZ_DB AND NOT MANUAL_TZ_DB ) + find_package( CURL REQUIRED ) +- target_include_directories( date-tz SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ) +- target_link_libraries( date-tz PRIVATE ${CURL_LIBRARIES} ) ++ target_include_directories( date-tz SYSTEM PRIVATE ${CURL_DIR}/../../../include ) ++ target_link_libraries( date-tz PRIVATE ${CURL_DIR}/../../../lib ) + endif( ) + endif( ) +