Skip to content

Commit

Permalink
chore: Support pkgload::load_all() and compilation database
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jan 20, 2025
1 parent 393af76 commit ad30dd2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

set -ex

# Get command line of grandparent process
parent_call=$(ps -o args= -p $(ps -o ppid= -p $$))

# Check if --preclean is in the command line
if [ $(echo $parent_call | grep -c -- --preclean) -ne 0 ]; then
echo "Skipping cleanup"
exit 0
fi

# Check if the archive already exists
if [ -f "src/duckdb.tar.xz" ]; then
echo "duckdb.tar.xz already exists. Skipping compression."
Expand Down
7 changes: 6 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ fi
# This happens in the cleanup script.

if [ -f duckdb.tar.xz ]; then
tar xJf duckdb.tar.xz
if [ -d duckdb ]; then
echo "Ignoring duckdb.tar.gz because duckdb directory still exists"
rm duckdb.tar.xz
else
tar xJf duckdb.tar.xz
fi
fi
4 changes: 4 additions & 0 deletions src/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ include include/sources.mk
# depending on the value of the DUCKDB_R_PREBUILT_ARCHIVE environment variable.
include Makevars.duckdb

# An empty file works well enough as a default, e.g., for pkgload::load_all()
Makevars.duckdb:
@touch $@

CXX_STD = CXX17
PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -DBROTLI_ENCODER_CLEANUP_ON_OOM -Iduckdb/src/include -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/fast_float -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/httplib -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/third_party/libpg_query -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/lz4 -Iduckdb/third_party/brotli/include -Iduckdb/third_party/brotli/common -Iduckdb/third_party/brotli/dec -Iduckdb/third_party/brotli/enc -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/miniz -Iduckdb/third_party/pcg -Iduckdb/third_party/re2 -Iduckdb/third_party/skiplist -Iduckdb/third_party/tdigest -Iduckdb/third_party/utf8proc -Iduckdb/third_party/utf8proc/include -Iduckdb/third_party/yyjson/include -Iduckdb/third_party/zstd/include -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/lz4 -Iduckdb/third_party/brotli/include -Iduckdb/third_party/brotli/common -Iduckdb/third_party/brotli/dec -Iduckdb/third_party/brotli/enc -Iduckdb/third_party/snappy -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/zstd/include -Iduckdb/extension/core_functions/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY -DDUCKDB_EXTENSION_CORE_FUNCTIONS_LINKED -DDUCKDB_BUILD_LIBRARY
OBJECTS=rfuns.o database.o connection.o statement.o register.o relational.o scan.o signal.o transform.o utils.o reltoaltrep.o types.o cpp11.o $(SOURCES)
4 changes: 4 additions & 0 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ include include/sources.mk
# depending on the value of the DUCKDB_R_PREBUILT_ARCHIVE environment variable.
include Makevars.duckdb

# An empty file works well enough as a default, e.g., for pkgload::load_all()
Makevars.duckdb:
@touch $@

CXX_STD = CXX17
PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -DBROTLI_ENCODER_CLEANUP_ON_OOM {{ INCLUDES }}
OBJECTS=rfuns.o database.o connection.o statement.o register.o relational.o scan.o signal.o transform.o utils.o reltoaltrep.o types.o cpp11.o $(SOURCES)
Expand Down
4 changes: 4 additions & 0 deletions src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ include include/sources.mk
# depending on the value of the DUCKDB_R_PREBUILT_ARCHIVE environment variable.
include Makevars.duckdb

# An empty file works well enough as a default, e.g., for pkgload::load_all()
Makevars.duckdb:
@touch $@

CXX_STD = CXX17
PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -DBROTLI_ENCODER_CLEANUP_ON_OOM -Iduckdb/src/include -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/fast_float -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/httplib -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/third_party/libpg_query -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/lz4 -Iduckdb/third_party/brotli/include -Iduckdb/third_party/brotli/common -Iduckdb/third_party/brotli/dec -Iduckdb/third_party/brotli/enc -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/miniz -Iduckdb/third_party/pcg -Iduckdb/third_party/re2 -Iduckdb/third_party/skiplist -Iduckdb/third_party/tdigest -Iduckdb/third_party/utf8proc -Iduckdb/third_party/utf8proc/include -Iduckdb/third_party/yyjson/include -Iduckdb/third_party/zstd/include -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/lz4 -Iduckdb/third_party/brotli/include -Iduckdb/third_party/brotli/common -Iduckdb/third_party/brotli/dec -Iduckdb/third_party/brotli/enc -Iduckdb/third_party/snappy -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/zstd/include -Iduckdb/extension/core_functions/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY -DDUCKDB_EXTENSION_CORE_FUNCTIONS_LINKED -DDUCKDB_BUILD_LIBRARY -DDUCKDB_PLATFORM_RTOOLS=1
OBJECTS=rfuns.o database.o connection.o statement.o register.o relational.o scan.o signal.o transform.o utils.o reltoaltrep.o types.o cpp11.o $(SOURCES)
Expand Down

0 comments on commit ad30dd2

Please sign in to comment.