From f50ccaae93c2995bb0443222ed04f1a21a547ad2 Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Sat, 14 Dec 2024 22:43:34 +0000 Subject: [PATCH] Windows: use libsodium from Rtools if available --- .github/workflows/R-CMD-check.yaml | 1 + DESCRIPTION | 2 +- NEWS | 3 +++ src/Makevars.win | 18 ++++++++++++------ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 724dd87..5f41972 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -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'} diff --git a/DESCRIPTION b/DESCRIPTION index a82acd4..7ddf7b8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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' : a modern, diff --git a/NEWS b/NEWS index 65d2942..0a44c26 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +1.4.0 + - Windows: use libsodium from Rtools if available + 1.3.1 - Fix shell script error for cross compiling diff --git a/src/Makevars.win b/src/Makevars.win index eccd45c..a64ced3 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,14 +1,20 @@ +PKG_CONFIG ?= $(BINPREF)pkg-config +PKG_LIBS := $(shell $(PKG_CONFIG) --libs sodium) + +ifneq ($(PKG_LIBS),) +$(info using Sodium from Rtools) +PKG_CPPFLAGS := $(shell $(PKG_CONFIG) --cflags sodium) +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: