Skip to content

Move all dependencies to VCPKG + apply patches and update DuckDB #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
duckdb_version: main
extension_name: spatial
ci_tools_version: main
vcpkg_commit: 5e5d0e1cd7785623065e77eff011afdeec1a3574
vcpkg_commit: d7112d1a4fb50410d3639f5f586972591d848beb
exclude_archs: 'linux_amd64_musl'

duckdb-latest-deploy:
name: Deploy extension binaries
Expand All @@ -41,3 +42,4 @@ jobs:
ci_tools_version: main
extension_name: spatial
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
exclude_archs: 'linux_amd64_musl'
4 changes: 3 additions & 1 deletion .github/workflows/StableDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
duckdb_version: v1.1.3
extension_name: spatial
ci_tools_version: v1.1.3
vcpkg_commit: 5e5d0e1cd7785623065e77eff011afdeec1a3574
vcpkg_commit: d7112d1a4fb50410d3639f5f586972591d848beb
exclude_archs: 'linux_amd64_musl'


duckdb-stable-deploy:
Expand All @@ -42,3 +43,4 @@ jobs:
ci_tools_version: v1.1.3
extension_name: spatial
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/v1.1.3' }}
exclude_archs: 'linux_amd64_musl'
63 changes: 31 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,34 @@
# local (compatible) GDAL installation, we should use that instead of building
# our own. (unless a static build is requested)

if(NOT EXISTS ${CMAKE_BINARY_DIR}/deps)
execute_process(
# Generate project
COMMAND
${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} -DDUCKDB_ENABLE_DEPRECATED_API=1
-DWASM_LOADABLE_EXTENSIONS=1 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
-DSPATIAL_USE_NETWORK=${SPATIAL_USE_NETWORK}
-DOPENSSL_ROOT_DIR=$ENV{OPENSSL_ROOT_DIR}
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
-DVCPKG_INSTALLED_DIR='${CMAKE_BINARY_DIR}/vcpkg_installed'
-DCMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'
-DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET}'
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE='${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}' -S
${CMAKE_CURRENT_SOURCE_DIR}/deps -B ${CMAKE_BINARY_DIR}/deps
RESULT_VARIABLE DEPENDENCIES_GENERATE_RESULT)
if(NOT DEPENDENCIES_GENERATE_RESULT EQUAL 0)
message(FATAL_ERROR "Could not generate dependencies project")
endif()

execute_process(
# Build project
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/deps --config
${CMAKE_BUILD_TYPE} RESULT_VARIABLE DEPENDENCIES_BUILD_RESULT)
if(NOT DEPENDENCIES_BUILD_RESULT EQUAL 0)
message(FATAL_ERROR "Could not build dependencies project")
endif()
endif()
#if(NOT EXISTS ${CMAKE_BINARY_DIR}/deps)
# execute_process(
# # Generate project
# COMMAND
# ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} -DDUCKDB_ENABLE_DEPRECATED_API=1
# -DWASM_LOADABLE_EXTENSIONS=1 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
# -DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
# -DSPATIAL_USE_NETWORK=${SPATIAL_USE_NETWORK}
# -DOPENSSL_ROOT_DIR=$ENV{OPENSSL_ROOT_DIR}
# -DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
# -DVCPKG_INSTALLED_DIR='${CMAKE_BINARY_DIR}/vcpkg_installed'
# -DCMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'
# -DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET}'
# -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE='${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}' -S
# ${CMAKE_CURRENT_SOURCE_DIR}/deps -B ${CMAKE_BINARY_DIR}/deps
# RESULT_VARIABLE DEPENDENCIES_GENERATE_RESULT)
# if(NOT DEPENDENCIES_GENERATE_RESULT EQUAL 0)
# message(FATAL_ERROR "Could not generate dependencies project")
# endif()
#
# execute_process(
# # Build project
# COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/deps --config
# ${CMAKE_BUILD_TYPE} RESULT_VARIABLE DEPENDENCIES_BUILD_RESULT)
# if(NOT DEPENDENCIES_BUILD_RESULT EQUAL 0)
# message(FATAL_ERROR "Could not build dependencies project")
# endif()
#endif()

# annoyingly for expat on windows
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} MD.lib)
Expand All @@ -86,24 +86,23 @@
set(OPENSSL_USE_STATIC_LIBS OFF)
endif()

find_library(SQLITE3_MEMVFS memvfs)
find_package(ZLIB REQUIRED)
find_package(PROJ REQUIRED)
find_package(SQLite3 REQUIRED)
# find_package(SQLite3 REQUIRED)
find_package(GEOS REQUIRED)
find_package(GDAL REQUIRED)
find_package(EXPAT REQUIRED)
find_package(GeographicLib REQUIRED)
find_package(unofficial-sqlite3 CONFIG REQUIRED)

# Important: The link order matters, its the reverse order of dependency
set(EXTENSION_DEPENDENCIES
GDAL::GDAL
GEOS::geos_c
PROJ::proj
EXPAT::EXPAT
SQLite::SQLite3
unofficial::sqlite3::sqlite3
ZLIB::ZLIB
${SQLITE3_MEMVFS}
${GeographicLib_LIBRARIES})

if(SPATIAL_USE_NETWORK)
Expand Down
Loading
Loading