Skip to content

Commit

Permalink
MacOS: temporary use static build of libcurl because the apple build …
Browse files Browse the repository at this point in the history
…is broken (#375)
  • Loading branch information
jeroen authored Jan 22, 2025
1 parent 736dc20 commit 86f9c94
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- if: runner.os == 'macos'
run: brew uninstall --ignore-dependencies curl || true

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ inst/doc
windows
configure.log
src/ada*
autobrew
.deps
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
6.2.0
- MacOS: temporary use static build of libcurl because the apple build is broken
- Fix LTO error for R_multi_setopt
- Fix parsing of #fragment links in curl_parse() (#366)

Expand Down
2 changes: 1 addition & 1 deletion R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ curl_options <- function(filter = ""){
}

# Remove this when RHEL-8 is EOL
option_table_legacy <- if(.Platform$OS.type == "unix" && grepl("^7", libcurlVersion())){
option_table_legacy <- if(grepl("linux", version$os) && grepl("^7", libcurlVersion())){
(function(){
env <- new.env()
if(file.exists("tools/option_table.txt")){
Expand Down
1 change: 1 addition & 0 deletions cleanup
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
rm -f src/Makevars configure.log
rm -f src/ada*
rm -Rf .deps autobrew
14 changes: 12 additions & 2 deletions configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Anticonf (tm) script by Jeroen Ooms (2024)
# Anticonf (tm) script by Jeroen Ooms (2025)
# 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:
Expand All @@ -15,8 +15,14 @@ PKG_CFLAGS=""

#export PKG_CONFIG_PATH="/opt/homebrew/opt/curl/lib/pkgconfig"

# (Jan 2025) MacOS ships a very buggy libcurl 8.7.1 so we avoid this until apple updates it
# See: https://github.com/jeroen/curl/issues/376
if [ `uname` = "Darwin" ]; then
MINVERSION="--atleast-version=8.8.0"
fi

# Use pkg-config if available
pkg-config --version >/dev/null 2>&1
pkg-config ${PKG_CONFIG_NAME} ${MINVERSION} 2>/dev/null
if [ $? -eq 0 ]; then
PKGCONFIG_CFLAGS=`pkg-config --cflags ${PKG_CONFIG_NAME}`
case "$PKGCONFIG_CFLAGS" in
Expand All @@ -34,6 +40,10 @@ elif [ "$PKGCONFIG_CFLAGS" ] || [ "$PKGCONFIG_LIBS" ]; then
echo "Found pkg-config cflags and libs!"
PKG_CFLAGS=${PKGCONFIG_CFLAGS}
PKG_LIBS=${PKGCONFIG_LIBS}
elif [ `uname` = "Darwin" ]; then
# Temporary fix for: https://github.com/jeroen/curl/issues/376
curl -sfL "https://autobrew.github.io/scripts/libcurl" > autobrew
. ./autobrew
fi

# Find compiler
Expand Down

0 comments on commit 86f9c94

Please sign in to comment.