Skip to content

Commit

Permalink
duckdb: add version 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
toge committed Sep 9, 2024
1 parent e50cb79 commit 59fa27b
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 2 deletions.
10 changes: 10 additions & 0 deletions recipes/duckdb/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions recipes/duckdb/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]")
Expand Down Expand Up @@ -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
Expand Down
110 changes: 110 additions & 0 deletions recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -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=$<TARGET_FILE:${TARGET_NAME}>${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=$<TARGET_FILE:${TARGET_NAME}>${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 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
-
+ endif()
target_include_directories(
duckdb_static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
@@ -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()
13 changes: 13 additions & 0 deletions recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 2 additions & 0 deletions recipes/duckdb/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.1.0":
folder: "all"
"1.0.0":
folder: "all"
"0.10.2":
Expand Down

0 comments on commit 59fa27b

Please sign in to comment.