Skip to content

Commit

Permalink
Windows: update libs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Sep 26, 2023
1 parent 989014c commit ca228ee
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
Expand All @@ -16,10 +16,11 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: '3.6'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: windows-2022, r: 'devel'}
- {os: windows-latest, r: '4.2'}
- {os: windows-latest, r: '4.1'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
Expand All @@ -41,6 +42,9 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
3 changes: 0 additions & 3 deletions src/Makevars.ucrt

This file was deleted.

16 changes: 10 additions & 6 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
VERSION = 3.2.5
RWINLIB = ../windows/libmariadbclient-$(VERSION)
TLS_LIBS ?= -lssl -lcrypto
RWINLIB = ../windows/libmariadbclient
OLDLIBDIR = lib${R_ARCH}${CRT}

ifeq ($(R_COMPILED_BY),gcc 8.3.0)
TLS_LIBS = -lssl -lcrypto
endif

CXX_STD=CXX11
PKG_CPPFLAGS = -I$(RWINLIB)/include/mariadb
PKG_LIBS= -L$(RWINLIB)/lib${R_ARCH}${CRT} \
PKG_LIBS =
-L$(RWINLIB)/lib$(R_ARCH) \
-L$(RWINLIB)/lib \
-lmariadbclient $(TLS_LIBS) -lz -lsecur32 -lshlwapi -lcrypt32 -lgdi32 -lws2_32 -pthread

#all: clean
all: winlibs
all: clean winlibs

clean:
rm -f $(SHLIB) $(OBJECTS)
Expand Down
23 changes: 16 additions & 7 deletions tools/winlibs.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Link against libmariadbclient static libraries
VERSION <- commandArgs(TRUE)
if(!file.exists(sprintf("../windows/libmariadbclient-%s/include/mariadb/mysql.h", VERSION))){
if(getRversion() < "3.3.0") setInternet2()
download.file(sprintf("https://github.com/rwinlib/libmariadbclient/archive/v%s.zip", VERSION), "lib.zip", quiet = TRUE)
if(!file.exists("../windows/libssl/include/mysql.h")){
unlink("../windows", recursive = TRUE)
url <- if(grepl("aarch", R.version$platform)){
"https://github.com/r-windows/bundles/releases/download/libmariadbclient-3.2.5/libmariadbclient-3.2.5-clang-aarch64.tar.xz"
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
"https://github.com/r-windows/bundles/releases/download/libmariadbclient-3.2.5/libmariadbclient-3.2.5-clang-x86_64.tar.xz"
} else if(getRversion() >= "4.2") {
"https://github.com/r-windows/bundles/releases/download/libmariadbclient-3.2.5/libmariadbclient-3.2.5-ucrt-x86_64.tar.xz"
} else {
"https://github.com/rwinlib/libmariadbclient/archive/v3.2.5.tar.gz"
}
download.file(url, basename(url), quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unlink("lib.zip")
untar(basename(url), exdir = "../windows", tar = 'internal')
unlink(basename(url))
setwd("../windows")
file.rename(list.files(), 'libmariadbclient')
}

0 comments on commit ca228ee

Please sign in to comment.