Skip to content

Commit

Permalink
Fix missing Pango support in R 3.x for openSUSE 15.6
Browse files Browse the repository at this point in the history
On R <= 3.6, running png() or similar was returning an error, and
getOption("bitmapType") returned "Xlib" instead of "cairo" as expected.
  • Loading branch information
glin committed Aug 3, 2024
1 parent 282e1ad commit 7749015
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
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
-d 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

0 comments on commit 7749015

Please sign in to comment.