Skip to content

Commit

Permalink
Regenerate with the latest rextendr (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation authored Jul 7, 2023
1 parent a1d192d commit 3d6741f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 54 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
^tests/testthat/_snaps$
^\.github$

^src/\.cargo$
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ RoxygenNote: 7.2.3
Suggests:
rmarkdown,
testthat
Config/rextendr/version: 0.3.1.9000
7 changes: 0 additions & 7 deletions R/extendr-wrappers.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Generated by extendr: Do not edit by hand

# nolint start

#
# This file was created with the following call:
# .Call("wrap__make_helloextendr_wrappers", use_symbols = TRUE, package_name = "helloextendr")

#' @docType package
#' @usage NULL
#' @useDynLib helloextendr, .registration = TRUE
Expand All @@ -15,5 +9,4 @@ NULL
#' @export
hello_world <- function() .Call(wrap__hello_world)


# nolint end
1 change: 1 addition & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.so
*.dll
target
.cargo
11 changes: 10 additions & 1 deletion src/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ all: C_clean

$(SHLIB): $(STATLIB)

CARGOTMP = $(CURDIR)/.cargo

$(STATLIB):
# In some environments, ~/.cargo/bin might not be included in PATH, so we need
# to set it here to ensure cargo can be invoked. It is appended to PATH and
# therefore is only used if cargo is absent from the user's PATH.
export PATH="$(PATH):$(HOME)/.cargo/bin" && \
if [ "$(NOT_CRAN)" != "true" ]; then \
export CARGO_HOME=$(CARGOTMP); \
fi && \
export PATH="$(PATH):$(HOME)/.cargo/bin" && \
cargo build --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR)
if [ "$(NOT_CRAN)" != "true" ]; then \
rm -Rf $(CARGOTMP) && \
rm -Rf $(LIBDIR)/build; \
fi

C_clean:
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS)
Expand Down
13 changes: 11 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ all: C_clean

$(SHLIB): $(STATLIB)

CARGOTMP = $(CURDIR)/.cargo

$(STATLIB):
mkdir -p $(TARGET_DIR)/libgcc_mock
# `rustc` adds `-lgcc_eh` flags to the compiler, but Rtools' GCC doesn't have
Expand All @@ -20,12 +22,19 @@ $(STATLIB):
touch $(TARGET_DIR)/libgcc_mock/libgcc_eh.a

# CARGO_LINKER is provided in Makevars.ucrt for R >= 4.2
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \
if [ "$(NOT_CRAN)" != "true" ]; then \
export CARGO_HOME=$(CARGOTMP); \
fi && \
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \
export LIBRARY_PATH="$${LIBRARY_PATH};$(CURDIR)/$(TARGET_DIR)/libgcc_mock" && \
cargo build --target=$(TARGET) --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR)
if [ "$(NOT_CRAN)" != "true" ]; then \
rm -Rf $(CARGOTMP) && \
rm -Rf $(LIBDIR)/build; \
fi

C_clean:
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS)

clean:
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) rust/target
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) $(TARGET_DIR)
63 changes: 19 additions & 44 deletions src/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = 'helloextendr'
publish = false
version = '0.3.0'
edition = '2021'

Expand Down

0 comments on commit 3d6741f

Please sign in to comment.