-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make rextendr packages CRAN compatible by default (#394)
* make rustflags additive * make rustflags additive * rework the makevars configure approach * overhaul makevars. remove use_cran_defaults() add tests for r cmd check for cran and non-cran packages * remove unneeded rm -rf from makevars fix indentation etc * add rcmdcheck to suggests update makevars templates to check for NOT_CRAN != true * update tests * refactor use_extendr tests * there is a bug in rcmdcheck * use tabs instead of spaces for Makevars.win.in * update snapshots * set CRAN_FLAGS only when vendored packages are used
- Loading branch information
1 parent
d58284b
commit 4aefce1
Showing
25 changed files
with
618 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ Imports: | |
withr | ||
Suggests: | ||
devtools, | ||
rcmdcheck, | ||
knitr, | ||
lintr, | ||
rmarkdown, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
TARGET_DIR = ./rust/target | ||
LIBDIR = $(TARGET_DIR)/release | ||
STATLIB = $(LIBDIR)/lib{{{lib_name}}}.a | ||
PKG_LIBS = -L$(LIBDIR) -l{{{lib_name}}} | ||
|
||
all: C_clean | ||
|
||
$(SHLIB): $(STATLIB) | ||
|
||
CARGOTMP = $(CURDIR)/.cargo | ||
VENDOR_DIR = $(CURDIR)/vendor | ||
|
||
|
||
# RUSTFLAGS appends --print=native-static-libs to ensure that | ||
# the correct linkers are used. Use this for debugging if need. | ||
# | ||
# CRAN note: Cargo and Rustc versions are reported during | ||
# configure via tools/msrv.R. | ||
# | ||
# When the NOT_CRAN flag is *not* set, the vendor.tar.xz, if present, | ||
# is unzipped and used for offline compilation. | ||
$(STATLIB): | ||
|
||
# Check if NOT_CRAN is false and unzip vendor.tar.xz if so | ||
if [ "$(NOT_CRAN)" != "true" ]; then \ | ||
if [ -f ./rust/vendor.tar.xz ]; then \ | ||
tar xf rust/vendor.tar.xz && \ | ||
mkdir -p $(CARGOTMP) && \ | ||
cp rust/vendor-config.toml $(CARGOTMP)/config.toml; \ | ||
fi; \ | ||
fi | ||
|
||
export CARGO_HOME=$(CARGOTMP) && \ | ||
export PATH="$(PATH):$(HOME)/.cargo/bin" && \ | ||
RUSTFLAGS="$(RUSTFLAGS) --print=native-static-libs" cargo build @CRAN_FLAGS@ --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) | ||
|
||
# Always clean up CARGOTMP | ||
rm -Rf $(CARGOTMP); | ||
|
||
C_clean: | ||
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) | ||
|
||
clean: | ||
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) $(TARGET_DIR) $(VENDOR_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.