Skip to content

Commit

Permalink
maybe fix sqlite/postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jul 26, 2024
1 parent 998bc47 commit c162101
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 198 deletions.
59 changes: 14 additions & 45 deletions r/adbcpostgresql/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,22 @@
# specific language governing permissions and limitations
# under the License.

dir.create("src/arrow-adbc", showWarnings=FALSE)
dir.create("src/arrow-adbc", showWarnings = FALSE)
file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")

# If we are building within the repo, copy the latest adbc.h and driver source
# into src/
source_files <- c(
"c/driver/common/options.h",
"c/driver/common/utils.c",
"c/driver/common/utils.h",
"c/driver/framework/catalog.h",
"c/driver/framework/catalog.cc",
"c/driver/framework/status.h",
"c/driver/postgresql/connection.cc",
"c/driver/postgresql/connection.h",
"c/driver/postgresql/copy/copy_common.h",
"c/driver/postgresql/copy/reader.h",
"c/driver/postgresql/copy/writer.h",
"c/driver/postgresql/database.cc",
"c/driver/postgresql/database.h",
"c/driver/postgresql/error.cc",
"c/driver/postgresql/error.h",
"c/driver/postgresql/postgres_type.h",
"c/driver/postgresql/postgres_util.h",
"c/driver/postgresql/postgresql.cc",
"c/driver/postgresql/result_helper.cc",
"c/driver/postgresql/result_helper.h",
"c/driver/postgresql/statement.cc",
"c/driver/postgresql/statement.h",
"c/vendor/fmt/include/fmt/args.h",
"c/vendor/fmt/include/fmt/base.h",
"c/vendor/fmt/include/fmt/chrono.h",
"c/vendor/fmt/include/fmt/color.h",
"c/vendor/fmt/include/fmt/compile.h",
"c/vendor/fmt/include/fmt/core.h",
"c/vendor/fmt/include/fmt/format-inl.h",
"c/vendor/fmt/include/fmt/format.h",
"c/vendor/fmt/include/fmt/os.h",
"c/vendor/fmt/include/fmt/ostream.h",
"c/vendor/fmt/include/fmt/printf.h",
"c/vendor/fmt/include/fmt/ranges.h",
"c/vendor/fmt/include/fmt/std.h",
"c/vendor/fmt/include/fmt/xchar.h",
"c/vendor/nanoarrow/nanoarrow.c",
"c/vendor/nanoarrow/nanoarrow.h",
"c/vendor/nanoarrow/nanoarrow.hpp"
)
files_to_vendor <- file.path("../..", source_files)
source_files <- list.files("../../c", "\\.(h|c|cc|hpp)$", recursive = TRUE)
source_files <- source_files[!grepl("_test\\.cc", source_files)]
source_files <- source_files[!grepl("^(build|out)/", source_files)]
source_files <- file.path("c", source_files)
src <- file.path("../..", source_files)
dst <- file.path("src", source_files)

unlink("src/c", recursive = TRUE)
for (dir_name in rev(unique(dirname(dst)))) {
dir.create(dir_name, showWarnings = FALSE, recursive = TRUE)
}

stopifnot(all(file.copy(src, dst)))

if (all(file.exists(files_to_vendor))) {
files_dst <- file.path("src", basename(files_to_vendor))
Expand Down
11 changes: 0 additions & 11 deletions r/adbcpostgresql/configure
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,3 @@ sed \
-e "s|@cppflags@|$PKG_CPPFLAGS|" \
-e "s|@libs@|$PKG_LIBS|" \
src/Makevars.in > src/Makevars


if [ -f "src/arrow-adbc/adbc.h" ]; then
echo "Found vendored ADBC"
exit 0
fi


echo "Vendored ADBC PostgreSQL driver was not found."
echo "This source package was probably built incorrectly and it's probably not your fault"
exit 1
3 changes: 2 additions & 1 deletion r/adbcpostgresql/src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
*.o
*.so
*.dll
adbc.h
Makevars
arrow-adbc/
c/
20 changes: 0 additions & 20 deletions r/adbcpostgresql/src/c/driver/common/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions r/adbcpostgresql/src/c/driver/framework/.gitignore

This file was deleted.

30 changes: 0 additions & 30 deletions r/adbcpostgresql/src/c/driver/postgresql/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions r/adbcpostgresql/src/c/driver/postgresql/copy/.gitignore

This file was deleted.

31 changes: 0 additions & 31 deletions r/adbcpostgresql/src/c/vendor/fmt/include/fmt/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions r/adbcpostgresql/src/c/vendor/nanoarrow/.gitignore

This file was deleted.

0 comments on commit c162101

Please sign in to comment.