From 59fa27b781ac48d9a1bb836f75e85a5720245ee3 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 10 Sep 2024 00:29:38 +0900 Subject: [PATCH] duckdb: add version 1.1.0 --- recipes/duckdb/all/conandata.yml | 10 ++ recipes/duckdb/all/conanfile.py | 7 +- .../all/patches/1.1.0-0001-fix-cmake.patch | 110 ++++++++++++++++++ .../all/patches/1.1.0-0002-msvc-bicobj.patch | 13 +++ recipes/duckdb/config.yml | 2 + 5 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch create mode 100644 recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index 4288594f5fc5e..cf9fce4151d56 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.1.0.tar.gz" + sha256: "d9be2c6d3a5ebe2b3d33044fb2cb535bb0bd972a27ae38c4de5e1b4caa4bf68d" "1.0.0": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.0.0.tar.gz" sha256: "04e472e646f5cadd0a3f877a143610674b0d2bcf9f4102203ac3c3d02f1c5f26" @@ -33,6 +36,13 @@ sources: url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.5.1.tar.gz" sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b" patches: + "1.1.0": + - patch_file: "patches/1.1.0-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/1.1.0-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" "1.0.0": - patch_file: "patches/1.0.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py index 0c71916124ae9..7f21bb189c4b0 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -76,6 +76,8 @@ def config_options(self): del self.options.fPIC if Version(self.version) >= "0.9.0": del self.options.with_parquet + if Version(self.version) >= "1.1.0": + del self.options.with_odbc def configure(self): if self.options.shared: @@ -86,7 +88,7 @@ def layout(self): def requirements(self): # FIXME: duckdb vendors a bunch of deps by modify the source code to have their own namespace - if self.options.with_odbc: + if self.options.get_safe("with_odbc"): self.requires("odbc/2.3.11") if self.options.with_httpfs: self.requires("openssl/[>=1.1 <4]") @@ -148,7 +150,8 @@ def generate(self): tc.variables["BUILD_EXCEL_EXTENSION"] = self.options.with_excel tc.variables["BUILD_SQLSMITH_EXTENSION"] = self.options.with_sqlsmith - tc.variables["BUILD_ODBC_DRIVER"] = self.options.with_odbc + if "self.options" in self.options: + tc.variables["BUILD_ODBC_DRIVER"] = self.options.with_odbc tc.variables["FORCE_QUERY_LOG"] = self.options.with_query_log tc.variables["BUILD_SHELL"] = self.options.with_shell tc.variables["DISABLE_THREADS"] = not self.options.with_threads diff --git a/recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..988bca9f377f1 --- /dev/null +++ b/recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch @@ -0,0 +1,110 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7dc2bb7..89c0adc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -896,12 +896,12 @@ function(build_loadable_extension_directory NAME ABI_TYPE OUTPUT_DIRECTORY EXTEN + set(FOOTER_VERSION_VALUE ${CAPI_VERSION}) + endif() + +- add_custom_command( +- TARGET ${TARGET_NAME} +- POST_BUILD +- COMMAND +- ${CMAKE_COMMAND} -DABI_TYPE=${ABI_TYPE} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DVERSION_FIELD="${FOOTER_VERSION_VALUE}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake +- ) ++ # add_custom_command( ++ # TARGET ${TARGET_NAME} ++ # POST_BUILD ++ # COMMAND ++ # ${CMAKE_COMMAND} -DABI_TYPE=${ABI_TYPE} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DVERSION_FIELD="${FOOTER_VERSION_VALUE}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake ++ # ) + add_dependencies(${TARGET_NAME} duckdb_platform) + if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY) + add_dependencies(duckdb_local_extension_repo ${TARGET_NAME}) +@@ -931,7 +931,7 @@ function(build_static_extension NAME PARAMETERS) + set(FILES "${ARGV}") + list(REMOVE_AT FILES 0) + add_library(${NAME}_extension STATIC ${FILES}) +- target_link_libraries(${NAME}_extension duckdb_static) ++ # target_link_libraries(${NAME}_extension duckdb_static) + endfunction() + + # Internal extension register function +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3e757a4..957f0e4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -109,7 +109,7 @@ else() + duckdb_skiplistlib + duckdb_mbedtls + duckdb_yyjson) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + + if(WIN32 AND NOT MINGW) +@@ -135,16 +135,16 @@ else() + target_link_libraries(duckdb ${DUCKDB_LINK_LIBS}) + link_threads(duckdb) + link_extension_libraries(duckdb) +- ++ endif() + add_library(duckdb_static STATIC ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS}) + link_threads(duckdb_static) + link_extension_libraries(duckdb_static) +- ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ endif() + target_include_directories( + duckdb_static PUBLIC $ + $) +@@ -160,10 +160,18 @@ else() + DESTINATION "${INSTALL_INCLUDE_DIR}") + + endif() +- ++if(BUILD_SHARED_LIBS) + install( +- TARGETS duckdb duckdb_static ++ TARGETS duckdb + EXPORT "${DUCKDB_EXPORT_SET}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..9e387f9 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,12 +26,12 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32 AND NOT ZOS) ++if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) + endif() +- ++if(0) + include_directories(../../third_party/catch) + + include_directories(test/include) +@@ -43,3 +43,4 @@ if(WIN32 OR ZOS) + else() + target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) + endif() ++endif() diff --git a/recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch new file mode 100644 index 0000000000000..838678649e638 --- /dev/null +++ b/recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 89c0adc..af5b786 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -574,7 +574,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/config.yml b/recipes/duckdb/config.yml index 5a30e62447ed4..f79e88a559bee 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: "all" "1.0.0": folder: "all" "0.10.2":