Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: update dependencies in static build #715

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/build/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ARG R_MAJOR=4.1
FROM ghcr.io/r-lib/pak-libs:latest AS libs
FROM ghcr.io/r-hub/r-minimal/r-minimal:${R_MAJOR}
COPY --from=libs /usr/local /usr/local
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

USER root
WORKDIR /root

Expand Down
11 changes: 6 additions & 5 deletions tools/build/linux/Dockerfile-libs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN apk add linux-headers bash gcc musl-dev g++ pkgconf make

# zlib --------------------------------------------------------------------

RUN wget https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
RUN wget https://zlib.net/zlib-1.3.1.tar.gz
RUN tar xzf zlib-*.tar.gz && rm zlib-*.tar.gz
RUN cd zlib-* && \
CFLAGS=-fPIC ./configure --static && \
Expand All @@ -21,23 +21,24 @@ RUN cd zlib-* && \

# openssl -----------------------------------------------------------------

RUN wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz
RUN wget https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz
RUN tar xzf openssl-*.tar.gz && rm openssl-*.tar.gz
RUN apk add perl linux-headers
RUN cd openssl-* && \
CFLAGS="-fPIC -static -U__GNUC__" ./config -fPIC no-shared && \
./config -fPIC no-shared && \
make && \
make install_sw && \
rm -rf /usr/local/bin/openssl \
/usr/local/share/{man/doc}

# libcurl now -------------------------------------------------------------

RUN wget https://curl.haxx.se/download/curl-7.68.0.tar.gz
RUN wget https://curl.haxx.se/download/curl-8.11.0.tar.gz
RUN tar xzf curl-*.tar.gz && rm curl-*.tar.gz
RUN apk add pkgconfig
RUN cd curl-* && \
./configure --enable-static --disable-shared; \
./configure --enable-static --disable-shared --with-openssl \
--without-libpsl; \
make && \
make install && \
rm -rf /usr/local/bin/curl \
Expand Down
10 changes: 5 additions & 5 deletions tools/build/linux/Dockerfile-libs-aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN apk add --arch aarch64 --root $AARCH64_ROOT \

# zlib --------------------------------------------------------------------

RUN wget https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
RUN wget https://zlib.net/zlib-1.3.1.tar.gz
RUN tar xzf zlib-*.tar.gz && rm zlib-*.tar.gz
RUN cd zlib-* && \
CFLAGS=-fPIC CC=aarch64-alpine-linux-musl-gcc \
Expand All @@ -70,10 +70,9 @@ RUN cd zlib-* && \
# aarch64 libs in qemu on x86_64, the built libs were buggy on real
# aarch64 hardware later without it.

RUN wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz
RUN wget https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz
RUN tar xzf openssl-*.tar.gz && rm openssl-*.tar.gz
RUN cd openssl-* && \
CFLAGS="-fPIC -static -U__GNUC__" \
./Configure linux-aarch64 -fPIC no-shared \
--cross-compile-prefix=aarch64-alpine-linux-musl- && \
make && \
Expand All @@ -87,12 +86,13 @@ RUN cd openssl-* && \
# aarch64 libs in qemu on x86_64, the built libs were buggy on real
# aarch64 hardware later without it.

RUN wget https://curl.haxx.se/download/curl-7.68.0.tar.gz
RUN wget https://curl.haxx.se/download/curl-8.11.0.tar.gz
RUN tar xzf curl-*.tar.gz && rm curl-*.tar.gz
RUN cd curl-* && \
CC=aarch64-alpine-linux-musl-gcc AR=aarch64-alpine-linux-musl-ar \
./configure --host=aarch64-alpine-linux-musl \
--enable-static --disable-shared --enable-debug; \
--enable-static --disable-shared --with-openssl \
--without-libpsl; \
make && \
make install && \
rm -rf /usr/local/bin/curl \
Expand Down
8 changes: 4 additions & 4 deletions tools/build/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# ------------------------------------------------------------------------

RVERSIONS ?= 3.5 3.6 4.0 4.1 4.2 4.3 4.4
RVERSIONS ?= 3.5 3.6 4.0 4.1 4.2 4.3 4.4 4.5
PAKVERSION=$(shell grep "^Version:" ../../../DESCRIPTION | tr -cd '0-9.')
DONE=$(patsubst %,R-%.done,$(RVERSIONS))
DONE_AARCH64=$(patsubst %,R-%-aarch64.done,$(RVERSIONS))
Expand All @@ -31,8 +31,8 @@ R-%-aarch64.done: libs-aarch64.done pak_$(PAKVERSION).tar.gz

R-%.done: libs.done pak_$(PAKVERSION).tar.gz
rm -f $@
docker build -f Dockerfile --build-arg R_MAJOR=$* \
--build-arg TOKEN="${GHCR_TOKEN}" .
docker build --platform linux/amd64 -f Dockerfile --build-arg R_MAJOR=$* \
--build-arg TOKEN="${GHCR_TOKEN}" --progress plain .
touch $@

# ------------------------------------------------------------------------
Expand All @@ -42,7 +42,7 @@ cross-aarch64:
-f Dockerfile-cross-aarch64 .

libs:
docker build -t ghcr.io/r-lib/pak-libs:latest \
docker build --platform linux/amd64 -t ghcr.io/r-lib/pak-libs:latest \
-f Dockerfile-libs .

libs.done:
Expand Down
Loading