Support arm64 builds

This commit is contained in:
Gábor Csárdi 2023-01-05 11:30:10 +01:00
commit 3b3a13513d
11 changed files with 62 additions and 39 deletions

View file

@ -49,9 +49,11 @@ RUN yum -y update \
RUN pip3 install awscli --upgrade --user && \
ln -s /root/.local/bin/aws /usr/bin/aws
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.rpm && \
yum install -y nfpm_amd64.rpm && \
rm nfpm_amd64.rpm
RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \
yum install -y "nfpm_$(cat /tmp/arch).rpm" && \
rm "nfpm_$(cat /tmp/arch).rpm"
RUN chmod 0777 /opt

View file

@ -50,9 +50,11 @@ RUN dnf -y upgrade \
RUN pip3 install awscli --upgrade --user \
&& ln -s /root/.local/bin/aws /usr/bin/aws
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.rpm && \
dnf install -y nfpm_amd64.rpm && \
rm nfpm_amd64.rpm
RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \
dnf install -y "nfpm_$(cat /tmp/arch).rpm" && \
rm "nfpm_$(cat /tmp/arch).rpm"
RUN chmod 0777 /opt

View file

@ -14,9 +14,9 @@ RUN pip3 install awscli
RUN chmod 0777 /opt
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb && \
apt install -y ./nfpm_amd64.deb && \
rm nfpm_amd64.deb
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(dpkg --print-architecture).deb" && \
apt install -y "./nfpm_$(dpkg --print-architecture).deb" && \
rm "nfpm_$(dpkg --print-architecture).deb"
# Override the default pager used by R
ENV PAGER /usr/bin/pager

View file

@ -14,9 +14,9 @@ RUN pip3 install awscli
RUN chmod 0777 /opt
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb && \
apt install -y ./nfpm_amd64.deb && \
rm nfpm_amd64.deb
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(dpkg --print-architecture).deb" && \
apt install -y "./nfpm_$(dpkg --print-architecture).deb" && \
rm "nfpm_$(dpkg --print-architecture).deb"
# Override the default pager used by R
ENV PAGER /usr/bin/pager

View file

@ -70,9 +70,11 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \
RUN pip install awscli
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.rpm && \
zypper --non-interactive --no-gpg-checks install nfpm_amd64.rpm && \
rm nfpm_amd64.rpm
RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \
zypper --non-interactive --no-gpg-checks install "nfpm_$(cat /tmp/arch).rpm" && \
rm "nfpm_$(cat /tmp/arch).rpm"
RUN chmod 0777 /opt

View file

@ -67,14 +67,16 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \
&& zypper clean
# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -p).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.18.1/nfpm_amd64.rpm && \
zypper --non-interactive --no-gpg-checks install nfpm_amd64.rpm && \
rm nfpm_amd64.rpm
RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \
zypper --non-interactive --no-gpg-checks install "nfpm_$(cat /tmp/arch).rpm" && \
rm "nfpm_$(cat /tmp/arch).rpm"
RUN chmod 0777 /opt

View file

@ -46,14 +46,16 @@ RUN dnf -y upgrade \
&& dnf clean all
# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -p).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.18.1/nfpm_amd64.rpm && \
dnf install -y nfpm_amd64.rpm && \
rm nfpm_amd64.rpm
RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \
dnf install -y "nfpm_$(cat /tmp/arch).rpm" && \
rm "nfpm_$(cat /tmp/arch).rpm"
RUN chmod 0777 /opt

View file

@ -11,9 +11,9 @@ RUN set -x \
RUN pip install awscli
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb && \
apt install -y ./nfpm_amd64.deb && \
rm nfpm_amd64.deb
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(dpkg --print-architecture).deb" && \
apt install -y "./nfpm_$(dpkg --print-architecture).deb" && \
rm "nfpm_$(dpkg --print-architecture).deb"
RUN chmod 0777 /opt

View file

@ -11,9 +11,9 @@ RUN set -x \
RUN pip3 install awscli
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb && \
apt install -y ./nfpm_amd64.deb && \
rm nfpm_amd64.deb
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(dpkg --print-architecture).deb" && \
apt install -y "./nfpm_$(dpkg --print-architecture).deb" && \
rm "nfpm_$(dpkg --print-architecture).deb"
RUN chmod 0777 /opt

View file

@ -11,9 +11,9 @@ RUN set -x \
RUN pip3 install awscli
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb && \
apt install -y ./nfpm_amd64.deb && \
rm nfpm_amd64.deb
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(dpkg --print-architecture).deb" && \
apt install -y "./nfpm_$(dpkg --print-architecture).deb" && \
rm "nfpm_$(dpkg --print-architecture).deb"
RUN chmod 0777 /opt

View file

@ -67,7 +67,7 @@ compile_r() {
# tools/config.guess in R versions older than 3.2.2 guess 'unknown' instead of 'pc'
# test the version and properly set the flag.
build_flag='--build=x86_64-pc-linux-gnu'
build_flag="--build=$(uname -p)-pc-linux-gnu"
if _version_is_greater_than ${R_VERSION} 3.2.2; then
build_flag=''
fi