Skip to content
Merged
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
13 changes: 13 additions & 0 deletions ports/arrow-adbc/fix_static_build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/c/cmake_modules/BuildUtils.cmake b/c/cmake_modules/BuildUtils.cmake
index 88209ac..aefff1d 100644
--- a/c/cmake_modules/BuildUtils.cmake
+++ b/c/cmake_modules/BuildUtils.cmake
@@ -310,7 +310,7 @@ function(ADD_ARROW_LIB LIB_NAME)
if(BUILD_STATIC)
add_library(${LIB_NAME}_static STATIC ${LIB_DEPS})
target_compile_features(${LIB_NAME}_static PRIVATE cxx_std_11)
- set_property(TARGET ${LIB_NAME}_shared PROPERTY CXX_STANDARD_REQUIRED ON)
+ set_property(TARGET ${LIB_NAME}_static PROPERTY CXX_STANDARD_REQUIRED ON)
adbc_configure_target(${LIB_NAME}_static)
if(EXTRA_DEPS)
add_dependencies(${LIB_NAME}_static ${EXTRA_DEPS})
13 changes: 13 additions & 0 deletions ports/arrow-adbc/fix_windows_build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/c/driver_manager/adbc_driver_manager.cc b/c/driver_manager/adbc_driver_manager.cc
index 0ce173a..2a7fef8 100644
--- a/c/driver_manager/adbc_driver_manager.cc
+++ b/c/driver_manager/adbc_driver_manager.cc
@@ -675,7 +675,7 @@ std::string AdbcDriverManagerDefaultEntrypoint(const std::string& driver) {
// if pos == npos this is the entire filename
std::string token = filename.substr(prev, pos - prev);
// capitalize first letter
- token[0] = std::toupper(static_cast<unsigned char>(token[0]));
+ token[0] = static_cast<char>(std::toupper(static_cast<unsigned char>(token[0])));

entrypoint += token;

65 changes: 65 additions & 0 deletions ports/arrow-adbc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apache/arrow-adbc
REF apache-arrow-adbc-${VERSION}
SHA512 59cccbeeefa295d69cacfa8851b621376106aca57ebd94291523fcca314c0bd10c1d296801d1eacce9edddd46a8c87deaf3d8367e32ba5fd5b322b34c6af8625
HEAD_REF main
PATCHES
fix_static_build.patch
fix_windows_build.patch
unvendor.patch
)
file(REMOVE_RECURSE "${SOURCE_PATH}/c/vendor")

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"sqlite" "ADBC_DRIVER_SQLITE"
"postgresql" "ADBC_DRIVER_POSTGRESQL"
"flightsql" "ADBC_DRIVER_FLIGHTSQL"
"snowflake" "ADBC_DRIVER_SNOWFLAKE"
"bigquery" "ADBC_DRIVER_BIGQUERY"
)

string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" ADBC_BUILD_SHARED)
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "static" ADBC_BUILD_STATIC)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}/c
OPTIONS
${FEATURE_OPTIONS}
-DADBC_DRIVER_MANAGER=ON
-DADBC_BUILD_SHARED=${ADBC_BUILD_SHARED}
-DADBC_BUILD_STATIC=${ADBC_BUILD_STATIC}
-DADBC_WITH_VENDORED_NANOARROW=OFF
-DADBC_WITH_VENDORED_FMT=OFF
-DADBC_BUILD_WARNING_LEVEL=PRODUCTION
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(
PACKAGE_NAME AdbcDriverManager
CONFIG_PATH lib/cmake/AdbcDriverManager
DO_NOT_DELETE_PARENT_CONFIG_PATH
)
if("postgresql" IN_LIST FEATURES)
vcpkg_cmake_config_fixup(
PACKAGE_NAME AdbcDriverPostgreSQL
CONFIG_PATH lib/cmake/AdbcDriverPostgreSQL
DO_NOT_DELETE_PARENT_CONFIG_PATH
)
endif()
if("sqlite" IN_LIST FEATURES)
vcpkg_cmake_config_fixup(
PACKAGE_NAME AdbcDriverSQLite
CONFIG_PATH lib/cmake/AdbcDriverSQLite
DO_NOT_DELETE_PARENT_CONFIG_PATH
)
endif()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
94 changes: 94 additions & 0 deletions ports/arrow-adbc/unvendor.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
index be69103..e92a7fc 100644
--- a/c/CMakeLists.txt
+++ b/c/CMakeLists.txt
@@ -29,9 +29,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(CTest)

-add_subdirectory(vendor/fmt EXCLUDE_FROM_ALL)
-set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON)
-add_subdirectory(vendor/nanoarrow)
+
+if(ADBC_WITH_VENDORED_FMT)
+ add_subdirectory(vendor/fmt EXCLUDE_FROM_ALL)
+ set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON)
+else()
+ find_package(fmt REQUIRED)
+endif()
+if(ADBC_WITH_VENDORED_NANOARROW)
+ add_subdirectory(vendor/nanoarrow)
+else()
+ find_package(nanoarrow REQUIRED)
+endif()
add_subdirectory(driver/common)
add_subdirectory(driver/framework)

diff --git a/c/cmake_modules/DefineOptions.cmake b/c/cmake_modules/DefineOptions.cmake
index 13e6757..6e990a7 100644
--- a/c/cmake_modules/DefineOptions.cmake
+++ b/c/cmake_modules/DefineOptions.cmake
@@ -133,6 +133,9 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")

define_option(ADBC_GGDB_DEBUG "Pass -ggdb flag to debug builds" ON)

+ define_option(ADBC_WITH_VENDORED_FMT "Use vendored copy of fmt" ON)
+ define_option(ADBC_WITH_VENDORED_NANOARROW "Use vendored copy of nanoarrow" ON)
+
#----------------------------------------------------------------------
set_option_category("Test and benchmark")

diff --git a/c/driver/common/CMakeLists.txt b/c/driver/common/CMakeLists.txt
index 751eda3..5739e4e 100644
--- a/c/driver/common/CMakeLists.txt
+++ b/c/driver/common/CMakeLists.txt
@@ -18,8 +18,12 @@
add_library(adbc_driver_common STATIC utils.c)
adbc_configure_target(adbc_driver_common)
set_target_properties(adbc_driver_common PROPERTIES POSITION_INDEPENDENT_CODE ON)
-target_include_directories(adbc_driver_common PRIVATE "${REPOSITORY_ROOT}/c/include"
- "${REPOSITORY_ROOT}/c/vendor")
+target_include_directories(adbc_driver_common PRIVATE "${REPOSITORY_ROOT}/c/include")
+if(ADBC_WITH_VENDORED_NANOARROW)
+ target_include_directories(adbc_driver_common PRIVATE "${REPOSITORY_ROOT}/c/vendor")
+else()
+ target_link_libraries(adbc_driver_common PRIVATE nanoarrow::nanoarrow)
+endif()

if(ADBC_BUILD_TESTS)
add_test_case(driver_common_test
diff --git a/c/driver/postgresql/CMakeLists.txt b/c/driver/postgresql/CMakeLists.txt
index a720696..32af4ac 100644
--- a/c/driver/postgresql/CMakeLists.txt
+++ b/c/driver/postgresql/CMakeLists.txt
@@ -46,13 +46,11 @@ add_arrow_lib(adbc_driver_postgresql
SHARED_LINK_LIBS
adbc_driver_common
adbc_driver_framework
- nanoarrow
${LIBPQ_LINK_LIBRARIES}
STATIC_LINK_LIBS
${LIBPQ_LINK_LIBRARIES}
adbc_driver_common
adbc_driver_framework
- nanoarrow
${LIBPQ_STATIC_LIBRARIES})

foreach(LIB_TARGET ${ADBC_LIBRARIES})
diff --git a/c/driver/sqlite/CMakeLists.txt b/c/driver/sqlite/CMakeLists.txt
index d0c45b7..bb0772b 100644
--- a/c/driver/sqlite/CMakeLists.txt
+++ b/c/driver/sqlite/CMakeLists.txt
@@ -52,12 +52,10 @@ add_arrow_lib(adbc_driver_sqlite
${SQLite3_LINK_LIBRARIES}
adbc_driver_common
adbc_driver_framework
- nanoarrow
STATIC_LINK_LIBS
${SQLite3_LINK_LIBRARIES}
adbc_driver_common
adbc_driver_framework
- nanoarrow
${LIBPQ_STATIC_LIBRARIES})

foreach(LIB_TARGET ${ADBC_LIBRARIES})
53 changes: 53 additions & 0 deletions ports/arrow-adbc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "arrow-adbc",
"version": "16",
"description": "Apache Arrow ADBC: Database Connectivity API for Arrow-based data systems",
"homepage": "https://arrow.apache.org/adbc/",
"license": "Apache-2.0",
"dependencies": [
{
"name": "arrow",
"default-features": false,
"features": [
"dataset",
"parquet"
]
},
"fmt",
"nanoarrow",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"bigquery": {
"description": "Enable bigquery support",
"supports": "!windows"
},
"flightsql": {
"description": "Enable flightsql support",
"supports": "!windows"
},
"postgresql": {
"description": "Enable PostgreSQL support",
"dependencies": [
"libpq"
]
},
"snowflake": {
"description": "Enable snowflake support",
"supports": "!windows"
},
"sqlite": {
"description": "Enable SQLite support",
"dependencies": [
"sqlite3"
]
}
}
}
14 changes: 14 additions & 0 deletions ports/flatcc/fix_install_dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/runtime/CMakeLists.txt b/src/runtime/CMakeLists.txt
index 127e2a4..f827a79 100644
--- a/src/runtime/CMakeLists.txt
+++ b/src/runtime/CMakeLists.txt
@@ -12,5 +12,8 @@ add_library(flatccrt
)

if (FLATCC_INSTALL)
- install(TARGETS flatccrt DESTINATION ${lib_dir})
+ install(TARGETS flatccrt
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
30 changes: 30 additions & 0 deletions ports/flatcc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO dvidelabs/flatcc
REF "v${VERSION}"
SHA512 46ba5ca75facc7d3360dba797d24ae7bfe539a854a48831e1c7b96528cf9594d8bea22b267678fd7c6d742b6636d9e52930987119b4c6b2e38d4abe89b990cae
HEAD_REF master
PATCHES
fix_install_dir.patch
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DFLATCC_INSTALL=ON
-DFLATCC_ALLOW_WERROR=OFF
-DFLATCC_TEST=OFF
-DFLATCC_CXX_TEST=OFF
-DFLATCC_RTONLY=ON
${EXTRA_OPTIONS}
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
17 changes: 17 additions & 0 deletions ports/flatcc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "flatcc",
"version": "0.6.1",
"description": "FlatBuffers Compiler and Library in C for C",
"homepage": "https://github.com/dvidelabs/flatcc",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
Loading