From 75a683c1402b5fff29ab08adb1f2b1c04897b07e Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Tue, 6 Aug 2024 11:52:44 -0500 Subject: [PATCH] Fix missing Pango support in R 3.x for openSUSE 15.6 (#235) * 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 --- .github/workflows/test.yml | 4 ++-- builder/Dockerfile.opensuse-156 | 3 +++ builder/build.sh | 2 +- builder/package.opensuse-156 | 9 +++++---- test/get_r_versions.py | 5 +++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 777ba60..e16774e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/builder/Dockerfile.opensuse-156 b/builder/Dockerfile.opensuse-156 index 15e2775..2fb0bb4 100644 --- a/builder/Dockerfile.opensuse-156 +++ b/builder/Dockerfile.opensuse-156 @@ -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 diff --git a/builder/build.sh b/builder/build.sh index 48b4129..92bf495 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -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 diff --git a/builder/package.opensuse-156 b/builder/package.opensuse-156 index 5aca991..094f355 100644 --- a/builder/package.opensuse-156 +++ b/builder/package.opensuse-156 @@ -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. @@ -72,7 +73,7 @@ depends: - libreadline7 - libtiff6 - make -- ${pcre_lib} +${pcre_libs} - tar - tcl - tk diff --git a/test/get_r_versions.py b/test/get_r_versions.py index 413a7ac..5f6f003 100644 --- a/test/get_r_versions.py +++ b/test/get_r_versions.py @@ -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()