-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8895d3
commit 6bab23e
Showing
20 changed files
with
218 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,20 @@ | ||
FROM amd64/alpine:3.9 | ||
|
||
# Arguments: | ||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 3.1.412 | * ] | ||
|
||
RUN apk add -X https://dl-cdn.alpinelinux.org/alpine/v3.16/main -u alpine-keys --allow-untrusted | ||
RUN apk add --no-cache bash curl wget python python3 git build-base ninja fontconfig-dev libintl clang | ||
|
||
# use the specific commit before the tool switched to C++20 which is too new for this old alpine | ||
RUN git clone https://gn.googlesource.com/gn /usr/share/gn \ | ||
&& cd /usr/share/gn \ | ||
&& git checkout d4be45bb28fbfc16a41a1e02c86137df6815f2dd \ | ||
&& python build/gen.py --allow-warning \ | ||
&& ninja -C out \ | ||
&& /usr/share/gn/out/gn --version | ||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ] | ||
|
||
ARG DOTNET_SDK_VERSION=3.1.412 | ||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.17 | ||
|
||
RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-musl-x64.tar.gz \ | ||
&& dotnet_sha512='f81ec24d3550bd414fb0fa154007f88a2e2956c73d033c2a82a6cea3402f0a842d1f32e8ffc199c0d9ed86faa8005a76b7c3b130e9cd0c1bea71d0631c9a1bcd' \ | ||
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ | ||
&& mkdir -p /usr/share/dotnet \ | ||
&& tar -C /usr/share/dotnet -xzf dotnet.tar.gz \ | ||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ | ||
&& rm dotnet.tar.gz | ||
# Install the skia build dependencies | ||
RUN apk add --no-cache fontconfig-dev gn ninja | ||
|
||
# Install the .NET SDK | ||
ARG DOTNET_SDK_VERSION=8.0 | ||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1 | ||
RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ | ||
&& bash dotnet-install.sh --channel ${DOTNET_SDK_VERSION} --install-dir /usr/share/dotnet --verbose \ | ||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ | ||
&& rm dotnet-install.sh \ | ||
&& dotnet help | ||
|
||
RUN dotnet help | ||
|
||
ENV GN_EXE=/usr/share/gn/out/gn | ||
ENV CC=clang CXX=clang++ GN_EXE=/usr/bin/gn | ||
|
||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Arguments: | ||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ] | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.17-arm64v8-local | ||
|
||
# Install the skia build dependencies | ||
RUN apk add --no-cache fontconfig-dev gn ninja | ||
|
||
# Install the .NET SDK | ||
ARG DOTNET_SDK_VERSION=8.0 | ||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1 | ||
RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ | ||
&& bash dotnet-install.sh --channel ${DOTNET_SDK_VERSION} --install-dir /usr/share/dotnet --verbose \ | ||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ | ||
&& rm dotnet-install.sh \ | ||
&& dotnet help | ||
|
||
ENV CC=clang CXX=clang++ GN_EXE=/usr/bin/gn | ||
|
||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
(cd $DIR && docker build --tag skiasharp-alpine-arm64 .) | ||
(cd $DIR/../../../../ && \ | ||
docker run --rm --name skiasharp-alpine-arm64 --volume $(pwd):/work skiasharp-alpine-arm64 /bin/bash -c "\ | ||
dotnet tool restore ; \ | ||
dotnet cake --target=externals-linux --configuration=Release --buildarch=arm64 --variant=alpine") |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Arguments: | ||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ] | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-amd64 | ||
|
||
# Install the skia build dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y libfontconfig1-dev ninja-build \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install the .NET SDK | ||
ARG DOTNET_SDK_VERSION=8.0 | ||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1 | ||
RUN curl https://dot.net/v1/dotnet-install.sh -L -o dotnet-install.sh \ | ||
&& bash dotnet-install.sh --channel ${DOTNET_SDK_VERSION} --install-dir /usr/share/dotnet --verbose \ | ||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ | ||
&& rm dotnet-install.sh \ | ||
&& dotnet help | ||
|
||
ENV CC=clang CXX=clang++ | ||
|
||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build-local.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Arguments: | ||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ] | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-arm64v8 | ||
|
||
# Install the skia build dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y libfontconfig1-dev ninja-build \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install the .NET SDK | ||
ARG DOTNET_SDK_VERSION=8.0 | ||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1 | ||
RUN curl https://dot.net/v1/dotnet-install.sh -L -o dotnet-install.sh \ | ||
&& bash dotnet-install.sh --channel ${DOTNET_SDK_VERSION} --install-dir /usr/share/dotnet --verbose \ | ||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ | ||
&& rm dotnet-install.sh \ | ||
&& dotnet help | ||
|
||
ENV CC=clang CXX=clang++ | ||
|
||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
(cd $DIR && docker build --tag skiasharp-linux-arm64 .) | ||
(cd $DIR/../../../../ && \ | ||
docker run --rm --name skiasharp-linux-arm64 --volume $(pwd):/work skiasharp-linux-arm64 /bin/bash -c "\ | ||
dotnet tool restore ; \ | ||
dotnet cake --target=externals-linux --configuration=Release --buildarch=arm64") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build-local.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Arguments: | ||
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 ] | ||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ] | ||
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 9 | * ] | ||
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu] | ||
# TOOLCHAIN_ARCH_SHORT - the short form architecture of the GCC toolchain [ armhf | arm64 ] | ||
# FONTCONFIG_VERSION - the exact version of libfontconfig1 to use [ 2.13.1-2 | * ] | ||
|
||
ARG IMAGE_ARCH=amd64 | ||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-${IMAGE_ARCH} | ||
|
||
# Install the skia build dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y ninja-build \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install the cross-compilation GCC toolchain | ||
ARG TOOLCHAIN_VERSION=9 | ||
ARG TOOLCHAIN_ARCH=arm-linux-gnueabihf | ||
ARG TOOLCHAIN_ARCH_SHORT=armhf | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
libstdc++-${TOOLCHAIN_VERSION}-dev-${TOOLCHAIN_ARCH_SHORT}-cross \ | ||
libgcc-${TOOLCHAIN_VERSION}-dev-${TOOLCHAIN_ARCH_SHORT}-cross \ | ||
binutils-${TOOLCHAIN_ARCH} \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Make the script more flexible and use "current" instead of the actual version | ||
RUN ln -s /usr/${TOOLCHAIN_ARCH}/include/c++/${TOOLCHAIN_VERSION} /usr/${TOOLCHAIN_ARCH}/include/c++/current \ | ||
&& sed -i "s/\/usr\/${TOOLCHAIN_ARCH}\/lib\///g" /usr/${TOOLCHAIN_ARCH}/lib/libpthread.so \ | ||
&& sed -i "s/\/usr\/${TOOLCHAIN_ARCH}\/lib\///g" /usr/${TOOLCHAIN_ARCH}/lib/libc.so | ||
|
||
# Install the cross-compilation skia build dependencies (fontconfig) | ||
ARG FONTCONFIG_VERSION=2.13.1-2 | ||
RUN (mkdir -p /skia-utils/libfontconfig1-dev \ | ||
&& cd /skia-utils/libfontconfig1-dev \ | ||
&& curl http://deb.debian.org/debian/pool/main/f/fontconfig/libfontconfig1-dev_${FONTCONFIG_VERSION}_${TOOLCHAIN_ARCH_SHORT}.deb -L -o libfontconfig1-dev.deb \ | ||
&& ar vx libfontconfig1-dev.deb \ | ||
&& tar -xJvf data.tar.xz \ | ||
&& rm libfontconfig1-dev.deb \ | ||
&& cp -R usr/lib/*/* /usr/${TOOLCHAIN_ARCH}/lib/ \ | ||
&& cp -R usr/include/* /usr/${TOOLCHAIN_ARCH}/include/ ) | ||
RUN (mkdir -p /skia-utils/libfontconfig1 \ | ||
&& cd /skia-utils/libfontconfig1 \ | ||
&& curl http://deb.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_${FONTCONFIG_VERSION}_${TOOLCHAIN_ARCH_SHORT}.deb -L -o libfontconfig1.deb \ | ||
&& ar vx libfontconfig1.deb \ | ||
&& tar -xJvf data.tar.xz \ | ||
&& rm libfontconfig1.deb \ | ||
&& cp -R usr/lib/*/* /usr/${TOOLCHAIN_ARCH}/lib/ ) | ||
|
||
# Install the .NET SDK | ||
ARG DOTNET_SDK_VERSION=8.0 | ||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1 | ||
RUN curl https://dot.net/v1/dotnet-install.sh -L -o dotnet-install.sh \ | ||
&& bash dotnet-install.sh --channel ${DOTNET_SDK_VERSION} --install-dir /usr/share/dotnet --verbose \ | ||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ | ||
&& rm dotnet-install.sh \ | ||
&& dotnet help | ||
|
||
ENV CC=clang CXX=clang++ | ||
|
||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
# the target architecture to build for | ||
ARCH="${1:-arm}" | ||
case $ARCH in | ||
arm) BUILD_ARGS="--build-arg TOOLCHAIN_ARCH=arm-linux-gnueabihf --build-arg TOOLCHAIN_ARCH_SHORT=armhf" ;; | ||
arm64) BUILD_ARGS="--build-arg TOOLCHAIN_ARCH=aarch64-linux-gnu --build-arg TOOLCHAIN_ARCH_SHORT=arm64" ;; | ||
x86) BUILD_ARGS="--build-arg TOOLCHAIN_ARCH=i686-linux-gnu --build-arg TOOLCHAIN_ARCH_SHORT=i386" ;; | ||
x64) BUILD_ARGS="--build-arg TOOLCHAIN_ARCH=x86-64-linux-gnu --build-arg TOOLCHAIN_ARCH_SHORT=amd64" ;; | ||
*) echo "Unsupported architecture: $ARCH" && exit 1 ;; | ||
esac | ||
|
||
# the docker image architecture to use | ||
IMAGE_ARCH="${2:-$([[ "$(uname -m)" == "arm64" ]] && echo "arm64v8" || echo "amd64")}" | ||
|
||
(cd $DIR && docker build --tag skiasharp-linux-cross-$ARCH $BUILD_ARGS --build-arg IMAGE_ARCH=$IMAGE_ARCH .) | ||
(cd $DIR/../../../../ && | ||
docker run --rm --name skiasharp-linux-cross-$ARCH --volume $(pwd):/work skiasharp-linux-cross-$ARCH /bin/bash -c "\ | ||
dotnet tool restore ; \ | ||
dotnet cake --target=externals-linux-clang-cross --configuration=Release --buildarch=$ARCH") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.