Remove unnecessary PCRE2 dependency on R 3.x

For more details on PCRE2 usage in R 3.x, see:
7d25524f8b/m4/R.m4 (L3056-L3058)
7d25524f8b/m4/R.m4 (L3139-L3155)
This commit is contained in:
Greg Lin 2020-04-29 14:44:16 -05:00
commit 048f2ca063
11 changed files with 84 additions and 20 deletions

View file

@ -65,6 +65,20 @@ compile_r() {
build_flag='' build_flag=''
fi fi
# Avoid a PCRE2 dependency for R 3.5 and 3.6. R 3.x uses PCRE1, but R 3.5+
# will link against PCRE2 if present, although it is not actually used.
# Since there's no way to disable this in the configure script, and we need
# PCRE2 for R 4.x, we hide PCRE2 from the configure script by temporarily
# removing the pkg-config file and pcre2-config script.
if [[ "${1}" =~ ^3 ]] && pkg-config --exists libpcre2-8; then
mkdir -p /tmp/pcre2
pc_dir=$(pkg-config --variable pcfiledir libpcre2-8)
mv ${pc_dir}/libpcre2-8.pc /tmp/pcre2
config_bin=$(which pcre2-config)
mv ${config_bin} /tmp/pcre2
trap "{ mv /tmp/pcre2/libpcre2-8.pc ${pc_dir}; mv /tmp/pcre2/pcre2-config ${config_bin}; }" EXIT
fi
# Default configure options. Some Dockerfiles override this with an ENV directive. # Default configure options. Some Dockerfiles override this with an ENV directive.
default_configure_options="\ default_configure_options="\
--enable-R-shlib \ --enable-R-shlib \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/centos-6 ]]; then
mkdir -p /tmp/output/centos-6 mkdir -p /tmp/output/centos-6
fi fi
# R 3.x requires PCRE1
pcre_lib='pcre2-devel'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='pcre-devel'
fi
# create post-install script required for openblas # create post-install script required for openblas
cat <<EOF >> /post-install.sh cat <<EOF >> /post-install.sh
mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep
@ -60,8 +66,7 @@ fpm \
-d make \ -d make \
-d openblas-devel \ -d openblas-devel \
-d pango \ -d pango \
-d pcre-devel \ -d ${pcre_lib} \
-d pcre2-devel \
-d tcl \ -d tcl \
-d tk \ -d tk \
-d unzip \ -d unzip \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/centos-7 ]]; then
mkdir -p /tmp/output/centos-7 mkdir -p /tmp/output/centos-7
fi fi
# R 3.x requires PCRE1
pcre_lib='pcre2-devel'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='pcre-devel'
fi
# create post-install script required for openblas # create post-install script required for openblas
cat <<EOF >> /post-install.sh cat <<EOF >> /post-install.sh
mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep
@ -45,8 +51,7 @@ fpm \
-d make \ -d make \
-d openblas-devel \ -d openblas-devel \
-d pango \ -d pango \
-d pcre-devel \ -d ${pcre_lib} \
-d pcre2-devel \
-d tcl \ -d tcl \
-d tk \ -d tk \
-d unzip \ -d unzip \

View file

@ -2,6 +2,12 @@ if [[ ! -d /tmp/output/centos-8 ]]; then
mkdir -p /tmp/output/centos-8 mkdir -p /tmp/output/centos-8
fi fi
# R 3.x requires PCRE1
pcre_lib='pcre2-devel'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='pcre-devel'
fi
# create post-install script required for openblas # create post-install script required for openblas
cat <<EOF >> /post-install.sh cat <<EOF >> /post-install.sh
mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep
@ -43,8 +49,7 @@ fpm \
-d make \ -d make \
-d openblas-threads \ -d openblas-threads \
-d pango \ -d pango \
-d pcre-devel \ -d ${pcre_lib} \
-d pcre2-devel \
-d tcl \ -d tcl \
-d tk \ -d tk \
-d unzip \ -d unzip \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/debian-10 ]]; then
mkdir -p /tmp/output/debian-10 mkdir -p /tmp/output/debian-10
fi fi
# R 3.x requires PCRE1
pcre_lib='libpcre2-8-0'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='libpcre3'
fi
fpm \ fpm \
-s dir \ -s dir \
-t deb \ -t deb \
@ -33,8 +39,7 @@ fpm \
-d libpango-1.0-0 \ -d libpango-1.0-0 \
-d libpangocairo-1.0-0 \ -d libpangocairo-1.0-0 \
-d libpaper-utils \ -d libpaper-utils \
-d libpcre2-8-0 \ -d ${pcre_lib} \
-d libpcre3 \
-d libpng16-16 \ -d libpng16-16 \
-d libreadline7 \ -d libreadline7 \
-d libtcl8.6 \ -d libtcl8.6 \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/debian-9 ]]; then
mkdir -p /tmp/output/debian-9 mkdir -p /tmp/output/debian-9
fi fi
# R 3.x requires PCRE1
pcre_lib='libpcre2-8-0'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='libpcre3'
fi
fpm \ fpm \
-s dir \ -s dir \
-t deb \ -t deb \
@ -33,8 +39,7 @@ fpm \
-d libpango-1.0-0 \ -d libpango-1.0-0 \
-d libpangocairo-1.0-0 \ -d libpangocairo-1.0-0 \
-d libpaper-utils \ -d libpaper-utils \
-d libpcre2-8-0 \ -d ${pcre_lib} \
-d libpcre3 \
-d libpng16-16 \ -d libpng16-16 \
-d libreadline7 \ -d libreadline7 \
-d libtcl8.6 \ -d libtcl8.6 \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/opensuse-15 ]]; then
mkdir -p /tmp/output/opensuse-15 mkdir -p /tmp/output/opensuse-15
fi fi
# R 3.x requires PCRE1
pcre_lib='pcre2-devel'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='pcre-devel'
fi
# create post-install script required for openblas # create post-install script required for openblas
cat <<EOF >> /post-install.sh cat <<EOF >> /post-install.sh
mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep
@ -50,8 +56,7 @@ fpm \
-d libtiff5 \ -d libtiff5 \
-d make \ -d make \
-d openblas-devel \ -d openblas-devel \
-d pcre-devel \ -d ${pcre_lib} \
-d pcre2-devel \
-d tar \ -d tar \
-d tcl \ -d tcl \
-d tk \ -d tk \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/opensuse-42 ]]; then
mkdir -p /tmp/output/opensuse-42 mkdir -p /tmp/output/opensuse-42
fi fi
# R 3.x requires PCRE1
pcre_lib='pcre2-devel'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='pcre-devel'
fi
# create post-install script required for openblas # create post-install script required for openblas
cat <<EOF >> /post-install.sh cat <<EOF >> /post-install.sh
mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep
@ -48,8 +54,7 @@ fpm \
-d libtiff5 \ -d libtiff5 \
-d make \ -d make \
-d openblas-devel \ -d openblas-devel \
-d pcre-devel \ -d ${pcre_lib} \
-d pcre2-devel \
-d tar \ -d tar \
-d tcl \ -d tcl \
-d tk \ -d tk \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/ubuntu-1604 ]]; then
mkdir -p /tmp/output/ubuntu-1604 mkdir -p /tmp/output/ubuntu-1604
fi fi
# R 3.x requires PCRE1
pcre_lib='libpcre2-8-0'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='libpcre3'
fi
fpm \ fpm \
-s dir \ -s dir \
-t deb \ -t deb \
@ -33,8 +39,7 @@ fpm \
-d libpango-1.0-0 \ -d libpango-1.0-0 \
-d libpangocairo-1.0-0 \ -d libpangocairo-1.0-0 \
-d libpaper-utils \ -d libpaper-utils \
-d libpcre2-8-0 \ -d ${pcre_lib} \
-d libpcre3 \
-d libpng16-16 \ -d libpng16-16 \
-d libreadline6 \ -d libreadline6 \
-d libtcl8.6 \ -d libtcl8.6 \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/ubuntu-1804 ]]; then
mkdir -p /tmp/output/ubuntu-1804 mkdir -p /tmp/output/ubuntu-1804
fi fi
# R 3.x requires PCRE1
pcre_lib='libpcre2-8-0'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='libpcre3'
fi
fpm \ fpm \
-s dir \ -s dir \
-t deb \ -t deb \
@ -33,8 +39,7 @@ fpm \
-d libpango-1.0-0 \ -d libpango-1.0-0 \
-d libpangocairo-1.0-0 \ -d libpangocairo-1.0-0 \
-d libpaper-utils \ -d libpaper-utils \
-d libpcre2-8-0 \ -d ${pcre_lib} \
-d libpcre3 \
-d libpng16-16 \ -d libpng16-16 \
-d libreadline7 \ -d libreadline7 \
-d libtcl8.6 \ -d libtcl8.6 \

View file

@ -4,6 +4,12 @@ if [[ ! -d /tmp/output/ubuntu-2004 ]]; then
mkdir -p /tmp/output/ubuntu-2004 mkdir -p /tmp/output/ubuntu-2004
fi fi
# R 3.x requires PCRE1
pcre_lib='libpcre2-8-0'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib='libpcre3'
fi
fpm \ fpm \
-s dir \ -s dir \
-t deb \ -t deb \
@ -34,8 +40,7 @@ fpm \
-d libpango-1.0-0 \ -d libpango-1.0-0 \
-d libpangocairo-1.0-0 \ -d libpangocairo-1.0-0 \
-d libpaper-utils \ -d libpaper-utils \
-d libpcre2-8-0 \ -d ${pcre_lib} \
-d libpcre3 \
-d libpng16-16 \ -d libpng16-16 \
-d libreadline8 \ -d libreadline8 \
-d libtcl8.6 \ -d libtcl8.6 \