Compare commits

..
4 changed files with 74 additions and 49 deletions

View file

@ -82,7 +82,7 @@ matrix:
steps: steps:
# Ensures that we're always using the latest available upstream build chain # Ensures that we're always using the latest available upstream build chain
# - name: Pull upstream # - name: Pull upstream
# image: reg.devxy.io/proxy_cache/library/alpine:3.20 # image: alpine:3.20
# commands: # commands:
# - apk add -q --no-cache git # - apk add -q --no-cache git
# - git remote add upstream https://github.com/cynkra/r-builds.git # - git remote add upstream https://github.com/cynkra/r-builds.git
@ -94,11 +94,11 @@ steps:
#. #.
- name: Get latest R version - name: Get latest R version
image: reg.devxy.io/proxy_cache/library/alpine:3.22 image: alpine:3.22
commands: commands:
- apk add -q --no-cache curl - apk add -q --no-cache curl
- curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/r/r.rb | grep -o 'R-[0-9]*\.[0-9]*\.[0-9]*' | tr -d 'R-' | tr -d '"' | head -n 1 > r-version-to-build.txt - curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/r/r.rb | grep -o 'R-[0-9]*\.[0-9]*\.[0-9]*' | tr -d 'R-' | tr -d '"' | head -n 1 > r-version-to-build.txt
# - echo "4.1.3" > r-version-to-build.txt - echo "4.1.3" > r-version-to-build.txt
- cat r-version-to-build.txt - cat r-version-to-build.txt
backend_options: backend_options:
kubernetes: kubernetes:
@ -125,7 +125,7 @@ steps:
AWS_SECRET_ACCESS_KEY: AWS_SECRET_ACCESS_KEY:
from_secret: HETZNER_S3_SECRET_KEY_K3S from_secret: HETZNER_S3_SECRET_KEY_K3S
AWS_ENDPOINT_URL: https://fsn1.your-objectstorage.com AWS_ENDPOINT_URL: https://fsn1.your-objectstorage.com
image: reg.devxy.io/proxy_cache/library/alpine:3.22 image: alpine:3.22
commands: commands:
- apk add -q --no-cache aws-cli - apk add -q --no-cache aws-cli
- | - |
@ -147,7 +147,7 @@ steps:
# ref: https://github.com/woodpecker-ci/woodpecker/discussions/2721 # ref: https://github.com/woodpecker-ci/woodpecker/discussions/2721
- name: Build - name: Build
image: reg.devxy.io/proxy_cache/library/alpine:3.22 image: alpine:3.22
privileged: true privileged: true
environment: environment:
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
@ -177,7 +177,7 @@ steps:
effect: "NoSchedule" effect: "NoSchedule"
- name: Upload to Hetzner S3 - name: Upload to Hetzner S3
image: reg.devxy.io/proxy_cache/woodpeckerci/plugin-s3:1.5.2 image: woodpeckerci/plugin-s3:1.3.0
pull: true pull: true
settings: settings:
bucket: devxy-r-builds bucket: devxy-r-builds
@ -217,7 +217,7 @@ services:
docker: docker:
environment: environment:
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ""
image: reg.devxy.io/proxy_cache/library/docker:28-dind image: docker:28-dind
commands: commands:
- mkdir -p /tmp/${PLATFORM}/${ARCH} - mkdir -p /tmp/${PLATFORM}/${ARCH}
- dockerd --tls=false --mtu 1420 --host=tcp://0.0.0.0:2375 - dockerd --tls=false --mtu 1420 --host=tcp://0.0.0.0:2375

View file

@ -1,4 +1,4 @@
FROM rockylinux/rockylinux:10 FROM almalinux:10
ENV OS_IDENTIFIER rhel-10 ENV OS_IDENTIFIER rhel-10
@ -59,9 +59,7 @@ RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_
RUN chmod 0777 /opt RUN chmod 0777 /opt
# Configure flags for RHEL 10 that don't use the defaults in build.sh # Configure flags for RHEL 9 that don't use the defaults in build.sh
# Since RHEL 9 with the R 4.3.0 release, RHEL/Fedora now uses FlexiBLAS as the
# default BLAS/LAPACK, which provides a native BLAS switching mechanism and matches EPEL.
ENV CONFIGURE_OPTIONS="\ ENV CONFIGURE_OPTIONS="\
--enable-R-shlib \ --enable-R-shlib \
--with-tcltk \ --with-tcltk \
@ -70,25 +68,26 @@ ENV CONFIGURE_OPTIONS="\
--with-system-valgrind-headers \ --with-system-valgrind-headers \
--with-tcl-config=/usr/lib64/tclConfig.sh \ --with-tcl-config=/usr/lib64/tclConfig.sh \
--with-tk-config=/usr/lib64/tkConfig.sh \ --with-tk-config=/usr/lib64/tkConfig.sh \
--enable-prebuilt-html \ --enable-prebuilt-html"
--with-blas=flexiblas \
--with-lapack=flexiblas"
# RHEL 10 doesn't have the inconsolata font, so override the defaults. # RHEL 9 doesn't have the inconsolata font, so override the defaults.
# This may be removed if RHEL ever adds the texlive-inconsolata package from Fedora. # This may be removed if RHEL ever adds the texlive-inconsolata package from Fedora.
# Or check `dnf provides '*/inconsolata.sty'` for a package that provides it. # Or check `dnf provides '*/inconsolata.sty'` for a package that provides it.
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Making-the-manuals # https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Making-the-manuals
ENV R_RD4PDF="times,hyper" ENV R_RD4PDF="times,hyper"
# Make sure that patching Java does not break R. # Make sure that patching Java does not break R.
# R's default JAVA_HOME path includes the exact Java version on RHEL, which # R's default JAVA_HOME path includes the exact Java version on CentOS/RHEL, which
# requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the # requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the
# major version symlink to avoid this. # major version symlink to avoid this.
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support # https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support
# https://solutions.posit.co/envs-pkgs/using-rjava/ # https://solutions.posit.co/envs-pkgs/using-rjava/
ENV JAVA_HOME=/usr/lib/jvm/jre-21-openjdk ENV JAVA_HOME=/usr/lib/jvm/jre-11-openjdk
COPY package.rhel-10 /package.sh # R 3.x requires PCRE2 for Pango support on RHEL 9
ENV INCLUDE_PCRE2_IN_R_3 yes
COPY package.rhel-9 /package.sh
COPY build.sh . COPY build.sh .
COPY patches /patches COPY patches /patches
ENTRYPOINT ./build.sh ENTRYPOINT ./build.sh

View file

@ -4,12 +4,36 @@ if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}" mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi fi
# R 4.5.0 and later require libzstd (with headers to link against libR) # R 3.x requires PCRE1. On RHEL 9, R 3.x also requires PCRE2 for Pango support.
zstd_libs='# - libzstd-devel' pcre_libs='- pcre2-devel'
if grep -q '^LIBS *=.*[-]lzstd' ${R_INSTALL_PATH}/lib/R/etc/Makeconf; then if [[ "${R_VERSION}" =~ ^3 ]]; then
zstd_libs='- libzstd-devel' pcre_libs='- pcre2-devel
- pcre-devel'
fi fi
# On RHEL and SUSE, we link R against the internal shared BLAS to make the
# R binaries more portable and allow users to switch BLAS implementations without
# having to recompile R. We default to OpenBLAS, but users may prefer other implementations.
#
# Binary packages built against the shared BLAS are also more portable and may be used
# with the default R distributed by RHEL/SUSE, or other R installations using
# shared BLAS and configured with a different BLAS (such as Microsoft R Open with MKL).
# This is especially important for Posit Package Manager's binary packages.
#
# However, EPEL 9's R now links externally against FlexiBLAS, which provides a
# native BLAS switching mechanism for Fedora/RHEL. Starting with R 4.3.0, we also
# link to external FlexiBLAS for compatibility.
# https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager
#
# On Ubuntu/Debian, we link R against the external BLAS instead (--with-blas/--with-lapack),
# as those distributions use the alternatives system to swap BLAS libraries at runtime.
# The default R distributions on Ubuntu/Debian use the external BLAS, so we do as well
# for portability.
#
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Shared-BLAS
if [[ "$("${R_INSTALL_PATH}/bin/R" CMD config BLAS_LIBS)" == "-lflexiblas" ]]; then
blas_lib='flexiblas-devel'
# Create postremove script to remove empty directories, as nFPM doesn't include them in the RPM files. # Create postremove script to remove empty directories, as nFPM doesn't include them in the RPM files.
cat <<EOF >> /after-remove.sh cat <<EOF >> /after-remove.sh
if [ -d ${R_INSTALL_PATH} ]; then if [ -d ${R_INSTALL_PATH} ]; then
@ -20,6 +44,27 @@ EOF
scripts="scripts: scripts="scripts:
postremove: /after-remove.sh postremove: /after-remove.sh
" "
else
blas_lib='openblas-devel'
# Create post-install script required for OpenBLAS.
cat <<EOF >> /post-install.sh
mv ${R_INSTALL_PATH}/lib/R/lib/libRblas.so ${R_INSTALL_PATH}/lib/R/lib/libRblas.so.keep
ln -s /usr/lib64/libopenblasp.so ${R_INSTALL_PATH}/lib/R/lib/libRblas.so
EOF
# Create after-remove script to remove internal BLAS, which won't be cleaned up automatically.
cat <<EOF >> /after-remove.sh
if [ -d ${R_INSTALL_PATH} ]; then
rm -r ${R_INSTALL_PATH}
fi
EOF
scripts="scripts:
postinstall: /post-install.sh
postremove: /after-remove.sh
"
fi
if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
@ -46,11 +91,10 @@ depends:
- libtiff - libtiff
- libXmu - libXmu
- libXt - libXt
${zstd_libs}
- make - make
- flexiblas-devel - ${blas_lib}
- pango - pango
- pcre2-devel ${pcre_libs}
- tcl - tcl
- tk - tk
- unzip - unzip

View file

@ -1,18 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>devxy/renovate-config"],
"automergeType": "branch",
"enabledManagers": ["woodpecker", "custom.regex"],
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": ["/^\\.crow(?:/[^/]+)?\\.ya?ml$/"],
"matchStrings": [
"(?<depName>\\w+):\\s*(?<currentValue>\\S+)\\s*#\\s*renovate:\\s*datasource=(?<datasource>\\S+)\\s*depName=(?<depName2>\\S+)"
],
"datasourceTemplate": "{{{datasource}}}",
"depNameTemplate": "{{{depName2}}}",
"versioningTemplate": "semver"
}
]
}