Merge pull request #146 from rstudio/fix-rhel9-pcre2

Fix missing PCRE2 dependency in R 3.x builds for RHEL 9
This commit is contained in:
Greg Lin 2022-09-09 09:38:19 -06:00 committed by GitHub
commit cc4b40a6df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View file

@ -44,10 +44,10 @@ docker-build-$(platform):
@cd builder && docker-compose build $(platform) @cd builder && docker-compose build $(platform)
build-r-$(platform): build-r-$(platform):
@cd builder && R_VERSION=$(R_VERSION) docker-compose up $(platform) @cd builder && R_VERSION=$(R_VERSION) docker-compose run --rm $(platform)
test-r-$(platform): test-r-$(platform):
@cd test && R_VERSION=$(R_VERSION) docker-compose up $(platform) @cd test && R_VERSION=$(R_VERSION) docker-compose run --rm $(platform)
bash-$(platform): bash-$(platform):
docker run -it --rm --entrypoint /bin/bash -v $(CURDIR):/r-builds r-builds:$(platform) docker run -it --rm --entrypoint /bin/bash -v $(CURDIR):/r-builds r-builds:$(platform)

View file

@ -97,7 +97,7 @@ compile_r() {
# #
# The INCLUDE_PCRE2_IN_R_3 environment variable can be set to include PCRE2 # 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 R 3.x builds, for distributions where PCRE2 is always required.
# In Debian 11/Ubuntu 22, Pango now depends on PCRE2, so R 3.x will not be compiled with # In Debian 11/Ubuntu 22/RHEL 9, Pango now depends on PCRE2, so R 3.x will not be compiled with
# Pango support if the PCRE2 pkg-config file is missing. # Pango support if the PCRE2 pkg-config file is missing.
if [[ "${1}" =~ ^3 ]] && pkg-config --exists libpcre2-8 && [ -z "$INCLUDE_PCRE2_IN_R_3" ]; then if [[ "${1}" =~ ^3 ]] && pkg-config --exists libpcre2-8 && [ -z "$INCLUDE_PCRE2_IN_R_3" ]; then
mkdir -p /tmp/pcre2 mkdir -p /tmp/pcre2

View file

@ -4,10 +4,11 @@ if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}" mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi fi
# R 3.x requires PCRE1 # R 3.x requires PCRE1. On RHEL 9, R 3.x also requires PCRE2 for Pango support.
pcre_lib='pcre2-devel' pcre_libs='- pcre2-devel'
if [[ "${R_VERSION}" =~ ^3 ]]; then if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='pcre-devel' pcre_libs='- pcre2-devel
- pcre-devel'
fi fi
# Create post-install script required for OpenBLAS. # Create post-install script required for OpenBLAS.
@ -64,7 +65,7 @@ depends:
- make - make
- openblas-devel - openblas-devel
- pango - pango
- ${pcre_lib} ${pcre_libs}
- tcl - tcl
- tk - tk
- unzip - unzip