Skip to content

Commit

Permalink
Use pkg-config on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 29, 2023
1 parent 8326465 commit 23edd58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 110 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/win-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ curl -sSL https://curl.se/ca/cacert.pem > etc/curl-ca-bundle.crt

# Download the TCL bundle required by tcltk package
#curl -OL https://cran.r-project.org/bin/windows/Rtools/rtools43/files/tcltk-5493-5412.zip
curl -OL https://github.com/r-windows/files/releases/download/5550/tcltk-5550-5412.zip
unzip tcltk-5550-5412.zip
curl -OL https://github.com/r-windows/bundles/releases/download/rtools43-5863/tcltk-5863-5787.zip
unzip tcltk-5863-5787.zip

# Add custom flags to MkRules.local
cp .github/scripts/MkRules.local src/gnuwin32/
Expand Down
99 changes: 3 additions & 96 deletions .github/workflows/build-svn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,99 +7,6 @@ concurrency:
cancel-in-progress: true

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
container:
image: ${{matrix.OS}}
env:
DEBIAN_FRONTEND: noninteractive
R_CRAN_WEB: "https://cran.rstudio.com"
CRAN_RSYNC: 'mirrors.nic.cz::CRAN'
strategy:
fail-fast: false
matrix:
CC: [ gcc, clang ]
OS: [ 'debian:stable', 'debian:testing' ]
steps:
- name: System dependencies
run: |
set -e
apt-get update -y
apt-get install -y ${{matrix.CC}} wget locales git rsync gfortran xvfb autoconf pkg-config texinfo texlive-latex-extra texlive-fonts-recommended tk8.6-dev \
libcurl4-openssl-dev libblas-dev libbz2-dev libicu-dev libjpeg-dev liblapack-dev liblzma-dev libncurses5-dev libpcre2-dev libpng-dev libtiff-dev libcairo2-dev libpango1.0-dev libreadline-dev libxt-dev
localedef -i en_US -f UTF-8 en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 100

- name: Prepare
run: |
git config --global --add safe.directory $PWD || true
sed -i.bak 's|$(GIT) svn info|./.github/scripts/svn-info.sh|' Makefile.in
./.github/scripts/wget-recommended.sh
./.github/scripts/svn-info.sh
- name: Configure
run: CC=${{matrix.CC}} ./configure --enable-R-shlib --with-blas --with-lapack --disable-java

- name: Build
run: make

- name: Check
run: xvfb-run make check-all

- name: Print failed tests
if: always()
run: tail -n100 tests/*.fail || true

macos:
name: MacOS
runs-on: macos-latest
timeout-minutes: 90
env:
PKG_CONFIG_PATH: /opt/X11/lib/pkgconfig
R_CRAN_WEB: "https://cran.rstudio.com"
CRAN_RSYNC: 'mirrors.nic.cz::CRAN'
R_TEXI2DVICMD: emulation

steps:
- name: System dependencies
run: |
brew install gcc gettext gmp isl jpeg libmpc libpng mpfr pcre2 pkg-config readline xz texinfo wget
echo "FC=/usr/local/opt/gcc/bin/gfortran" >> $GITHUB_ENV
echo "/Library/TeX/texbin" >> $GITHUB_PATH
echo "/usr/local/opt/texinfo/bin" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Prepare
run: |
sed -i.bak 's|$(GIT) svn info|./.github/scripts/svn-info.sh|' Makefile.in
./.github/scripts/wget-recommended.sh
./.github/scripts/svn-info.sh
- name: Configure
run: CC=clang ./configure --disable-java --without-cairo --without-tcltk --without-x --with-aqua --with-lapack --with-blas --enable-R-shlib SED=/usr/bin/sed
env:
PDFLATEX: ${{github.workspace}}/.github/scripts/dummy

- name: Build
run: make
env:
PDFLATEX: ${{github.workspace}}/.github/scripts/dummy

- name: Check
run: make check-all
env:
PDFLATEX: ${{github.workspace}}/.github/scripts/dummy

- name: Print failed tests
if: always()
run: tail -n100 tests/*.fail || true

windows:
name: Windows
runs-on: windows-latest
Expand Down Expand Up @@ -132,10 +39,10 @@ jobs:

- name: "Download rtools43 toolchain"
run: |
url="https://github.com/r-windows/files/releases/download/5550/rtools43-toolchain-libs-base-5550.tar.zst"
url="https://github.com/r-windows/bundles/releases/download/rtools43-5863/rtools43-toolchain-libs-base-5863.tar.zst"
curl -sSL $url | tar x --zstd -C /c/ || true
#echo "RTOOLS43_HOME=c:" >> $GITHUB_ENV
#echo "R_CUSTOM_TOOLS_SOFT=c:/x86_64-w64-mingw32.static.posix" >> $GITHUB_ENV
echo "RTOOLS43_HOME=c:" >> $GITHUB_ENV
echo "R_CUSTOM_TOOLS_SOFT=c:/x86_64-w64-mingw32.static.posix" >> $GITHUB_ENV
- name: Install Miktex
shell: powershell
Expand Down
17 changes: 5 additions & 12 deletions src/gnuwin32/MkRules.rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,16 @@ RC_ARCH ?=
DT_ARCH ?=
## only WIN=64 is supported from R 4.2.0
WIN ?= 64
PKG_CONFIG ?= pkg-config
USE_ICU ?= YES
ICU_PATH ?=
ICU_LIBS ?= -lsicuin -lsicuuc $(EXT_LIBS)/lib/sicudt.a -lstdc++
# (dynamic linking) ICU_LIBS ?= -licuin -licuuc -licudt -lstdc++
ICU_LIBS ?= $(shell $(PKG_CONFIG) --libs icu-i18n)
USE_CAIRO ?= YES
CAIRO_CPPFLAGS ?= "-I$(EXT_LIBS)/include/cairo -I$(EXT_LIBS)/include/freetype2"
## support freetype, curl built with libbrotli and without
LIBBROTLI = $(or $(and $(wildcard $(EXT_LIBS)/lib/libbrotlidec-static.a),-lbrotlidec-static -lbrotlicommon-static),)
CAIRO_LIBS ?= "-lcairo -lfontconfig -lfreetype -lpng -lpixman-1 -lexpat -lharfbuzz \
-lbz2 -lintl -lz -liconv -lgdi32 -lmsimg32 \
$(LIBBROTLI)"
CAIRO_CPPFLAGS ?= "$(shell $(PKG_CONFIG) --cflags --static cairo)"
CAIRO_LIBS ?= "$(shell $(PKG_CONFIG) --libs cairo)"
CURL_CA_BUNDLE ?=
USE_LIBCURL = yes
CURL_LIBS ?= -lcurl -lbcrypt -lzstd -lrtmp -lssl -lssh2 -lgcrypt -lcrypto -lgdi32 -lz \
-lws2_32 -lgdi32 -lcrypt32 -lidn2 -lunistring -liconv -lgpg-error -lwldap32 \
-lwinmm $(LIBBROTLI)

CURL_LIBS ?= $(shell $(PKG_CONFIG) --libs libcurl)
BUILD_HTML ?= NO
MIKTEX ?= TRUE
TEXI2ANY ?= texi2any
Expand Down

0 comments on commit 23edd58

Please sign in to comment.