Skip to content

Commit

Permalink
Windows: use libsodium from Rtools if available
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 14, 2024
1 parent 8271e1e commit c9ed880
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- {os: windows-latest, r: '4.1'}
- {os: windows-latest, r: '4.2'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: sodium
Type: Package
Title: A Modern and Easy-to-Use Crypto Library
Version: 1.3.2
Version: 1.4.0
Authors@R: person("Jeroen", "Ooms", role = c("aut", "cre"), email = "jeroenooms@gmail.com",
comment = c(ORCID = "0000-0002-4035-0289"))
Description: Bindings to 'libsodium' <https://doc.libsodium.org/>: a modern,
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.4.0
- Windows: use libsodium from Rtools if available

1.3.1
- Fix shell script error for cross compiling

Expand Down
18 changes: 12 additions & 6 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
PKG_CONFIG ?= $(BINPREF)pkg-config
PKG_LIBS := $(shell $(PKG_CONFIG) --libs libsodium)

ifneq ($(PKG_LIBS),)
$(info using Sodium from Rtools)
PKG_CPPFLAGS := $(shell $(PKG_CONFIG) --cflags libsodium)
else
RWINLIB = ../windows/sodium
PKG_CPPFLAGS = -I$(RWINLIB)/include
PKG_LIBS = -L$(RWINLIB)/lib$(R_ARCH) -L${RWINLIB}/lib -lsodium
endif

PKG_LIBS = \
-L$(RWINLIB)/lib$(R_ARCH) \
-L${RWINLIB}/lib \
-lsodium
all: $(SHLIB)

all: clean winlibs
$(OBJECTS): $(RWINLIB)

winlibs:
$(RWINLIB):
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R"

clean:
Expand Down

0 comments on commit c9ed880

Please sign in to comment.