Skip to content

Commit

Permalink
Fix missing Pango support in R 3.x for openSUSE 15.6 (#235)
Browse files Browse the repository at this point in the history
* Add R 3.6 to test matrix

* Fix missing Pango support in R 3.x for openSUSE 15.6

On R <= 3.6, running png() or similar was returning an error, and
getOption("bitmapType") returned "Xlib" instead of "cairo" as expected.

* Fix yaml syntax error
  • Loading branch information
glin authored Aug 6, 2024
1 parent c69508b commit 75a683c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ on:
description: |
Comma-separated list of R versions. Specify "last-N" to use the
last N minor R versions, or "all" to use all minor R versions since R 3.1.
Defaults to "last-5,devel".
Defaults to "last-5,3.6.3,devel".
required: false
default: 'last-5,devel'
default: 'last-5,3.6.3,devel'
type: string

permissions:
Expand Down
3 changes: 3 additions & 0 deletions builder/Dockerfile.opensuse-156
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ ENV CONFIGURE_OPTIONS="\
# https://solutions.posit.co/envs-pkgs/using-rjava/
ENV JAVA_HOME=/usr/lib64/jvm/jre-11-openjdk

# R 3.x requires PCRE2 for Pango support on SUSE 15.6
ENV INCLUDE_PCRE2_IN_R_3 yes

COPY package.opensuse-156 /package.sh
COPY build.sh .
COPY patches /patches
Expand Down
2 changes: 1 addition & 1 deletion builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ compile_r() {
#
# The INCLUDE_PCRE2_IN_R_3 environment variable can be set to include PCRE2
# in R 3.x builds, for distributions where PCRE2 is always required.
# In Debian 11/Ubuntu 22/RHEL 9, Pango now depends on PCRE2, so R 3.x will not be compiled with
# In Debian 11/Ubuntu 22/RHEL 9/SUSE 15.6, Pango now depends on PCRE2, so R 3.x will not be compiled with
# Pango support if the PCRE2 pkg-config file is missing.
if [[ "${r_version}" =~ ^3 ]] && pkg-config --exists libpcre2-8 && [ -z "$INCLUDE_PCRE2_IN_R_3" ]; then
mkdir -p /tmp/pcre2
Expand Down
9 changes: 5 additions & 4 deletions builder/package.opensuse-156
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi

# R 3.x requires PCRE1
pcre_lib='pcre2-devel'
# R 3.x requires PCRE1. On openSUSE 15.6+, R 3.x also requires PCRE2 for Pango support.
pcre_libs='- pcre2-devel'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='pcre-devel'
pcre_libs='- pcre2-devel
- pcre-devel'
fi

# Create post-install script required for OpenBLAS.
Expand Down Expand Up @@ -72,7 +73,7 @@ depends:
- libreadline7
- libtiff6
- make
- ${pcre_lib}
${pcre_libs}
- tar
- tcl
- tk
Expand Down
5 changes: 3 additions & 2 deletions test/get_r_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ def main():
'versions',
type=str,
nargs='?',
default='last-5,devel',
# R 3.6 is a special case, as we need longer term (but unstated) support for it.
default='last-5,3.6.3,devel',
help="""Comma-separated list of R versions. Specify "last-N" to use the
last N minor R versions, or "all" to use all minor R versions since R 3.1.
Defaults to "last-5,devel".
Defaults to "last-5,3.6.3,devel".
"""
)
args = parser.parse_args()
Expand Down

0 comments on commit 75a683c

Please sign in to comment.