-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* adapted from openssl by @jeroen * adapted from openssl by @jeroen * temp fix for broken homebrew [email protected] on CI
- Loading branch information
Showing
7 changed files
with
55 additions
and
24 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 |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
^codecov\.yml$ | ||
.lintr | ||
^configure.log$ | ||
^README.Rmd$ |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Anticonf (tm) script by Jeroen Ooms (2020) | ||
# Anticonf (tm) script by Jeroen Ooms (2023) | ||
# This script will query 'pkg-config' for the required cflags and ldflags. | ||
# If pkg-config is unavailable or does not find the library, try setting | ||
# INCLUDE_DIR and LIB_DIR manually via e.g: | ||
|
@@ -17,8 +17,13 @@ PKG_CFLAGS="" | |
# Build against a specific openssl version | ||
# export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig" | ||
|
||
# On MacOS we avoid legacy versions of openssl | ||
if [ `uname` = "Darwin" ]; then | ||
MINVERSION="--atleast-version=3" | ||
fi | ||
|
||
# Use pkg-config if available | ||
pkg-config ${PKG_CONFIG_NAME} --atleast-version=1.0 2>/dev/null | ||
pkg-config ${PKG_CONFIG_NAME} ${MINVERSION} 2>/dev/null | ||
if [ $? -eq 0 ]; then | ||
PKGCONFIG_CFLAGS=`pkg-config --cflags ${PKG_CONFIG_NAME}` | ||
PKGCONFIG_LIBS=`pkg-config --libs ${PKG_CONFIG_NAME}` | ||
|
@@ -37,14 +42,19 @@ elif [ `uname` = "Darwin" ]; then | |
test ! "$CI" && brew --version 2>/dev/null | ||
if [ $? -eq 0 ]; then | ||
BREWDIR=`brew --prefix` | ||
PKG_CFLAGS="-I$BREWDIR/opt/openssl/include -I$BREWDIR/opt/[email protected]/include" | ||
PKG_LIBS="-L$BREWDIR/opt/openssl/lib -L$BREWDIR/opt/[email protected]/lib $PKG_LIBS" | ||
PKG_CFLAGS="-I$BREWDIR/opt/openssl/include" | ||
PKG_LIBS="-L$BREWDIR/opt/openssl/lib $PKG_LIBS" | ||
else | ||
curl -sfL "https://autobrew.github.io/scripts/$PKG_BREW_NAME" > autobrew | ||
. ./autobrew | ||
fi | ||
fi | ||
|
||
# Fix broken homebrew [email protected] | ||
if echo "$PKG_LIBS" | grep -q '/opt/homebrew/Cellar/openssl@3/3.3.0 -lssl -lcrypto'; then | ||
PKG_LIBS=$(echo "$PKG_LIBS" | sed 's|/opt/homebrew/Cellar/openssl@3/3.3.0|/opt/homebrew/Cellar/openssl@3/3.3.0/lib|g') | ||
fi | ||
|
||
# Find compiler | ||
CC=`${R_HOME}/bin/R CMD config CC` | ||
CFLAGS=`${R_HOME}/bin/R CMD config CFLAGS` | ||
|
@@ -76,7 +86,7 @@ fi | |
|
||
# Try to link against the correct OpenSSL version | ||
if [ -z "$AUTOBREW" ]; then | ||
SONAME=`${CC} -E ${PKG_CFLAGS} src/tests/soname.h | sh | xargs` | ||
SONAME=`${CC} -E ${PKG_CFLAGS} src/tests/soname.h | grep 'echo' | sh | xargs` | ||
if [ "$SONAME" ]; then | ||
if [ `uname` = "Darwin" ]; then | ||
PKG_LIBS_VERSIONED=`echo "${PKG_LIBS}" | sed "s/-lssl/-lssl.${SONAME}/" | sed "s/-lcrypto/-lcrypto.${SONAME}/"` | ||
|
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
PKG_CPPFLAGS = @cflags@ | ||
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` -lz @libs@ | ||
PKG_LIBS = -lz @libs@ | ||
|
||
all: clean | ||
|
||
$(SHLIB): $(OBJECTS) | ||
|
||
clean: | ||
rm -f $(OBJECTS) $(SHLIB) |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,23 @@ | ||
VERSION=1.1.1k | ||
PKG_CPPFLAGS= -I../windows/openssl-$(VERSION)/include | ||
PKG_LIBS = -L../windows/openssl-$(VERSION)/lib${R_ARCH}${CRT} -lz -lcrypto -lws2_32 -lcrypt32 | ||
RWINLIB = ../windows/libssl | ||
TARGET = lib$(subst gcc,,$(COMPILED_BY))$(R_ARCH) | ||
PKG_CPPFLAGS = -I$(RWINLIB)/include -DOPENSSL_SUPPRESS_DEPRECATED | ||
|
||
all: clean winlibs | ||
PKG_LIBS = \ | ||
-L$(RWINLIB)/$(TARGET) \ | ||
-L$(RWINLIB)/lib \ | ||
-lssl -lcrypto -lz -lws2_32 -lcrypt32 | ||
|
||
#all: clean | ||
all: $(SHLIB) | ||
|
||
$(OBJECTS): winlibs | ||
|
||
$(SHLIB): $(OBJECTS) | ||
|
||
winlibs: | ||
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" | ||
|
||
clean: | ||
rm -f $(SHLIB) $(OBJECTS) | ||
|
||
winlibs: | ||
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION) | ||
.PHONY: all clean winlibs |
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 |
---|---|---|
@@ -1,10 +1,18 @@ | ||
# Build against mingw-w64 build of openssl | ||
VERSION <- commandArgs(TRUE) | ||
if (!file.exists(sprintf("../windows/openssl-%s/include/openssl/ssl.h", VERSION))){ | ||
if (getRversion() < "3.3.0") setInternet2() | ||
download.file(sprintf("https://github.com/rwinlib/openssl/archive/v%s.zip", VERSION), | ||
"lib.zip", quiet = TRUE) | ||
if(!file.exists("../windows/libssl/include/openssl/pem.h")){ | ||
unlink("../windows", recursive = TRUE) | ||
url <- if(grepl("aarch", R.version$platform)){ | ||
"https://github.com/r-windows/bundles/releases/download/openssl-3.1.2/openssl-3.1.2-clang-aarch64.tar.xz" | ||
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){ | ||
"https://github.com/r-windows/bundles/releases/download/openssl-3.1.2/openssl-3.1.2-clang-x86_64.tar.xz" | ||
} else if(getRversion() >= "4.2") { | ||
"https://github.com/r-windows/bundles/releases/download/openssl-3.1.2/openssl-3.1.2-ucrt-x86_64.tar.xz" | ||
} else { | ||
"https://github.com/rwinlib/openssl/archive/v3.1.1.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(), 'libssl') | ||
} |