-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
229af65
commit 577f15c
Showing
15 changed files
with
1,666 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ |
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 @@ | ||
.Rproj.user |
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,14 @@ | ||
Package: serdesri | ||
Title: What the Package Does (One Line, Title Case) | ||
Version: 0.0.0.9000 | ||
Authors@R: | ||
person("Josiah", "Parry", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0001-9910-865X")) | ||
Description: What the package does (one paragraph). | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
Language: en | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.2.3 | ||
Config/rextendr/version: 0.3.1.9000 | ||
SystemRequirements: Cargo (rustc package manager) |
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,5 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(parse_esri_json_raw) | ||
export(parse_esri_json_str) | ||
useDynLib(serdesri, .registration = TRUE) |
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,21 @@ | ||
# Generated by extendr: Do not edit by hand | ||
|
||
# nolint start | ||
|
||
# | ||
# This file was created with the following call: | ||
# .Call("wrap__make_serdesri_wrappers", use_symbols = TRUE, package_name = "serdesri") | ||
|
||
#' @docType package | ||
#' @usage NULL | ||
#' @useDynLib serdesri, .registration = TRUE | ||
NULL | ||
|
||
#' @export | ||
parse_esri_json_str <- function(str, n_dim) .Call(wrap__parse_esri_json_str, str, n_dim) | ||
|
||
#' @export | ||
parse_esri_json_raw <- function(raw, n_dim) .Call(wrap__parse_esri_json_raw, raw, n_dim) | ||
|
||
|
||
# nolint end |
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,22 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: No | ||
SaveWorkspace: No | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
AutoAppendNewline: Yes | ||
StripTrailingWhitespace: Yes | ||
LineEndingConversion: Posix | ||
|
||
BuildType: Package | ||
PackageUseDevtools: Yes | ||
PackageInstallArgs: --no-multiarch --with-keep.source | ||
PackageRoxygenize: rd,collate,namespace |
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,5 @@ | ||
*.o | ||
*.so | ||
*.dll | ||
target | ||
.cargo |
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,30 @@ | ||
TARGET_DIR = ./rust/target | ||
LIBDIR = $(TARGET_DIR)/release | ||
STATLIB = $(LIBDIR)/libserdesri.a | ||
PKG_LIBS = -L$(LIBDIR) -lserdesri | ||
|
||
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. | ||
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) | ||
|
||
clean: | ||
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) rust/target |
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,5 @@ | ||
# Rtools42 doesn't have the linker in the location that cargo expects, so we | ||
# need to overwrite it via configuration. | ||
CARGO_LINKER = x86_64-w64-mingw32.static.posix-gcc.exe | ||
|
||
include Makevars.win |
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,40 @@ | ||
TARGET = $(subst 64,x86_64,$(subst 32,i686,$(WIN)))-pc-windows-gnu | ||
|
||
TARGET_DIR = ./rust/target | ||
LIBDIR = $(TARGET_DIR)/$(TARGET)/release | ||
STATLIB = $(LIBDIR)/libserdesri.a | ||
PKG_LIBS = -L$(LIBDIR) -lserdesri -lws2_32 -ladvapi32 -luserenv -lbcrypt -lntdll | ||
|
||
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 | ||
# `libgcc_eh` due to the compilation settings. So, in order to please the | ||
# compiler, we need to add empty `libgcc_eh` to the library search paths. | ||
# | ||
# For more details, please refer to | ||
# https://github.com/r-windows/rtools-packages/blob/2407b23f1e0925bbb20a4162c963600105236318/mingw-w64-gcc/PKGBUILD#L313-L316 | ||
touch $(TARGET_DIR)/libgcc_mock/libgcc_eh.a | ||
|
||
# CARGO_LINKER is provided in Makevars.ucrt for R >= 4.2 | ||
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) $(TARGET_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// We need to forward routine registration from C to Rust | ||
// to avoid the linker removing the static library. | ||
|
||
void R_init_serdesri_extendr(void *dll); | ||
|
||
void R_init_serdesri(void *dll) { | ||
R_init_serdesri_extendr(dll); | ||
} |
Oops, something went wrong.