diff --git a/.woodpecker/build.yaml b/.crow/build.yaml similarity index 96% rename from .woodpecker/build.yaml rename to .crow/build.yaml index ed9fde1..3424da9 100644 --- a/.woodpecker/build.yaml +++ b/.crow/build.yaml @@ -48,11 +48,6 @@ matrix: ARCH: arm64 ARCH_ID: aarch64 INSTANCE_TYPE: cax31 - - PLATFORM: alpine-320 - PLATFORM_ID: alpine320 - ARCH: amd64 - ARCH_ID: x86_64 - INSTANCE_TYPE: AX42 - PLATFORM: alpine-321 PLATFORM_ID: alpine321 ARCH: arm64 @@ -63,6 +58,16 @@ matrix: ARCH: amd64 ARCH_ID: x86_64 INSTANCE_TYPE: AX42 + - PLATFORM: alpine-322 + PLATFORM_ID: alpine322 + ARCH: arm64 + ARCH_ID: aarch64 + INSTANCE_TYPE: cax31 + - PLATFORM: alpine-322 + PLATFORM_ID: alpine322 + ARCH: amd64 + ARCH_ID: x86_64 + INSTANCE_TYPE: AX42 steps: # Ensures that we're always using the latest available upstream build chain @@ -82,7 +87,7 @@ steps: image: alpine:3.21 commands: - 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 '"' > r-release-version.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-release-version.txt # - echo "4.2.2" > r-release-version.txt - cat r-release-version.txt backend_options: diff --git a/Justfile b/Justfile index bc2d392..780aaf3 100644 --- a/Justfile +++ b/Justfile @@ -23,12 +23,12 @@ build-r-opensuse-155 R_VERSION: export R_VERSION={{R_VERSION}}; \ make build-r-$PLATFORM -build-r-alpine-320 R_VERSION: - export PLATFORM=alpine-320; \ - export R_VERSION={{R_VERSION}}; \ - make build-r-$PLATFORM - build-r-alpine-321 R_VERSION: export PLATFORM=alpine-321; \ export R_VERSION={{R_VERSION}}; \ make build-r-$PLATFORM + +build-r-alpine-322 R_VERSION: + export PLATFORM=alpine-322; \ + export R_VERSION={{R_VERSION}}; \ + make build-r-$PLATFORM diff --git a/Makefile b/Makefile index 9e53e6a..aeaa94a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PLATFORMS := ubuntu-2004 ubuntu-2204 ubuntu-2404 debian-10 debian-11 debian-12 centos-7 centos-8 rhel-9 opensuse-155 fedora-38 fedora-39 fedora-40 alpine-320 alpine-321 +PLATFORMS := ubuntu-2004 ubuntu-2204 ubuntu-2404 debian-10 debian-11 debian-12 centos-7 centos-8 rhel-9 opensuse-155 fedora-38 fedora-39 fedora-40 alpine-321 alpine-322 SLS_BINARY ?= ./node_modules/serverless/bin/serverless.js deps: diff --git a/builder/Dockerfile.alpine-322 b/builder/Dockerfile.alpine-322 new file mode 100644 index 0000000..2f89019 --- /dev/null +++ b/builder/Dockerfile.alpine-322 @@ -0,0 +1,28 @@ +FROM alpine:3.22 + +ENV OS_IDENTIFIER alpine-322 + +RUN set -x \ + && apk add -q R-dev curl ca-certificates bash g++ tzdata openjdk17 texmf-dist texlive-full tar sed patch tcl tk tk-dev xvfb libdeflate libdeflate-dev + +# Install AWS CLI +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \ + unzip awscliv2.zip && \ + ./aws/install && \ + rm -rf aws awscliv2.zip + +RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.39.0/nfpm_2.39.0_$(arch).apk" && \ + apk add --allow-untrusted "./nfpm_2.39.0_$(arch).apk" && \ + rm "nfpm_2.39.0_$(arch).apk" + +RUN chmod 0777 /opt + +# Override the default pager used by R +ENV PAGER /usr/bin/pager + +ENV CONFIGURE_OPTIONS "--enable-R-shlib --with-tcltk --enable-memory-profiling --with-x=no --with-blas --with-lapack" + +COPY package.alpine-322 /package.sh +COPY build.sh . +COPY patches /patches +ENTRYPOINT ./build.sh diff --git a/builder/docker-compose.yml b/builder/docker-compose.yml index 5022d2d..c63f01a 100644 --- a/builder/docker-compose.yml +++ b/builder/docker-compose.yml @@ -59,6 +59,18 @@ services: image: r-builds:alpine-321 volumes: - /tmp/alpine-321:/tmp/output/alpine-321 + alpine-322: + command: ./build.sh + environment: + - R_VERSION=${R_VERSION} + - R_INSTALL_PATH=${R_INSTALL_PATH} + - LOCAL_STORE=/tmp/output + build: + context: . + dockerfile: Dockerfile.alpine-322 + image: r-builds:alpine-322 + volumes: + - /tmp/alpine-322:/tmp/output/alpine-322 debian-10: command: ./build.sh environment: diff --git a/builder/package.alpine-322 b/builder/package.alpine-322 new file mode 100644 index 0000000..2e0b28e --- /dev/null +++ b/builder/package.alpine-322 @@ -0,0 +1,74 @@ +#!/bin/bash + +if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then + mkdir -p "/tmp/output/${OS_IDENTIFIER}" +fi + +# R 3.x requires PCRE1. On Ubuntu 24, R 3.x also requires PCRE2 for Pango support. +pcre_libs='- pcre2-dev' +if [[ "${R_VERSION}" =~ ^3 ]]; then + pcre_libs='- pcre2-dev +- libpcre3-dev' +fi + +deflate_libs='# - libdeflate-dev' +if grep -q '^LIBS *=.*[-]ldeflate' ${R_INSTALL_PATH}/lib/R/etc/Makeconf; then + deflate_libs='- libdeflate-dev' +fi + +cat < /tmp/nfpm.yml +name: r-${R_VERSION} +version: 1 +version_schema: none +section: universe/math +priority: optional +arch: $(arch) +maintainer: Posit Software, PBC +description: | + GNU R statistical computation and graphics system +vendor: Posit Software, PBC +homepage: https://www.r-project.org +license: GPL-2 +depends: +- g++ +- gcc +- gfortran +- libbz2 +# - libc6 +- cairo +- libcurl +${deflate_libs} +# - libglib2.0-0t64 +# - libgomp1 +- icu-dev +- jpeg-dev +# - liblzma-dev +- openblas-dev +- pango +# - libpangocairo-1.0-0 +- libpaper +${pcre_libs} +- libpng-dev +- readline-dev +- tcl +- tiff-dev +- libtirpc-dev +- tk +# - libx11-6 +# - libxt6t64 +- make +# - ucf +- unzip +- zip +- zlib-ng-dev +contents: +- src: ${R_INSTALL_PATH} + dst: ${R_INSTALL_PATH} +EOF + +nfpm package \ + -f /tmp/nfpm.yml \ + -p apk \ + -t "/tmp/output/${OS_IDENTIFIER}" + +export PKG_FILE=$(ls /tmp/output/${OS_IDENTIFIER}/r-${R_VERSION}*.apk | head -1)