Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ac44fca
Add LoongArch64 build support
4Darmygeometry Mar 23, 2025
18ee00f
Delete binding/HarfBuzzSharp.NativeAssets.Linux/HarfBuzzSharp.NativeA…
4Darmygeometry Mar 23, 2025
ffc55e6
Create HarfBuzzSharp.NativeAssets.Linux.csproj
4Darmygeometry Mar 23, 2025
245e08d
Delete binding/SkiaSharp.NativeAssets.Linux.NoDependencies/SkiaSharp.…
4Darmygeometry Mar 23, 2025
ee617c9
Create SkiaSharp.NativeAssets.Linux.NoDependencies.csproj
4Darmygeometry Mar 23, 2025
451375c
Delete binding/SkiaSharp.NativeAssets.Linux/SkiaSharp.NativeAssets.Li…
4Darmygeometry Mar 23, 2025
144e3dc
Create SkiaSharp.NativeAssets.Linux.csproj
4Darmygeometry Mar 23, 2025
018d6b4
Update _clang-cross-common.sh
4Darmygeometry Mar 23, 2025
e0fac5c
Update Dockerfile
4Darmygeometry Mar 23, 2025
5bc0ec7
Update build-local.sh
4Darmygeometry Mar 23, 2025
7812abd
Update build-local.sh
4Darmygeometry Mar 23, 2025
28b79a0
azure-templates-stages.yml:updated to add loong
4Darmygeometry Mar 23, 2025
2d786be
azure-templates-stages.yml:LoongArch64
4Darmygeometry Mar 23, 2025
6a4e95e
Dockerfile:Changed to trixie docker and back to gcc13
4Darmygeometry Mar 24, 2025
f534899
build-local.sh:update instruction
4Darmygeometry Mar 24, 2025
a4c53a1
azure-templates-stages.yml:Fix loongarch64 build
4Darmygeometry Mar 24, 2025
cf0a58a
azure-templates-stages.yml:Fix loongarch64 build 2
4Darmygeometry Mar 24, 2025
7f8dcd8
Create startup.sh
4Darmygeometry Mar 24, 2025
012f3dd
Dockerfile:changes libpthread.so to libpthread.so.0
4Darmygeometry Mar 24, 2025
4072be5
azure-templates-stages.yml:Revert because alpine official support loong
4Darmygeometry Mar 24, 2025
49bcb75
Dockerfile:Back to GCC 14 to compat libc6-loong64-cross
4Darmygeometry Mar 24, 2025
2abe60c
Update scripts/azure-templates-stages.yml
mattleibow Mar 24, 2025
7c12896
azure-templates-stages.yml:https://packages.debian.org/trixie/binutil…
4Darmygeometry Mar 24, 2025
73b62c7
Update scripts/Docker/debian/clang-cross/13/Dockerfile
mattleibow Mar 24, 2025
74b64c0
Merge branch 'main' into main
mattleibow Mar 24, 2025
bab37ab
Create deepin 23 Dockerfile for backup purposes
4Darmygeometry Mar 24, 2025
0b5c745
Dockerfile:Use stable version LLVM 18
4Darmygeometry Mar 24, 2025
7ea22af
Create startup.sh
4Darmygeometry Mar 24, 2025
3eaea33
Create .dockerignore
4Darmygeometry Mar 24, 2025
43e52aa
Create Deepin 23 build-local.sh
4Darmygeometry Mar 24, 2025
eed9a94
azure-templates-stages.yml:Try to use deepin 23 to build
4Darmygeometry Mar 24, 2025
df36e43
azure-templates-stages.yml:Revert to debian trixie
4Darmygeometry Mar 24, 2025
281389f
Delete scripts/Docker/deepin/clang-cross/23/Dockerfile
4Darmygeometry Mar 24, 2025
9c17cd1
Delete scripts/Docker/deepin/clang-cross/23/startup.sh
4Darmygeometry Mar 24, 2025
2dc5921
Delete scripts/Docker/deepin/clang-cross/.dockerignore
4Darmygeometry Mar 24, 2025
7303ccb
Delete scripts/Docker/deepin/clang-cross/build-local.sh
4Darmygeometry Mar 24, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
<PackageFile Include="..\..\output\native\linux\arm64\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-arm64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linux\arm\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-arm\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linux\riscv64\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-riscv64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linux\loongarch64\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-loongarch64\native\%(Filename)%(Extension)" />
<!-- Musl -->
<PackageFile Include="..\..\output\native\alpine\x64\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-musl-x64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\x86\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-musl-x86\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\arm64\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-musl-arm64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\arm\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-musl-arm\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\riscv64\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-musl-riscv64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\loongarch64\libHarfBuzzSharp*.so" PackagePath="runtimes\linux-musl-loongarch64\native\%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="IncludeAdditionalTfmSpecificPackageFiles">
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<_NativeHarfBuzzSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-riscv64\native\libHarfBuzzSharp*.so">
<Dir>riscv64\</Dir>
</_NativeHarfBuzzSharpFile>
<_NativeHarfBuzzSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-loongarch64\native\libHarfBuzzSharp*.so">
<Dir>loongarch64\</Dir>
</_NativeHarfBuzzSharpFile>

<!-- Musl -->
<_NativeHarfBuzzSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-x86\native\libHarfBuzzSharp*.so">
Expand All @@ -42,6 +45,9 @@
<_NativeHarfBuzzSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-riscv64\native\libHarfBuzzSharp*.so">
<Dir>musl-riscv64\</Dir>
</_NativeHarfBuzzSharpFile>
<_NativeHarfBuzzSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-loongarch64\native\libHarfBuzzSharp*.so">
<Dir>musl-loongarch64\</Dir>
</_NativeHarfBuzzSharpFile>

<!-- include everything -->
<Content Include="@(_NativeHarfBuzzSharpFile)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ The excluded dependencies are:
<PackageFile Include="..\..\output\native\linuxnodeps\arm64\libSkiaSharp*.so" PackagePath="runtimes\linux-arm64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linuxnodeps\arm\libSkiaSharp*.so" PackagePath="runtimes\linux-arm\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linuxnodeps\riscv64\libSkiaSharp*.so" PackagePath="runtimes\linux-riscv64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linuxnodeps\loongarch64\libSkiaSharp*.so" PackagePath="runtimes\linux-loongarch64\native\%(Filename)%(Extension)" />
<!-- Musl -->
<PackageFile Include="..\..\output\native\alpinenodeps\x64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-x64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpinenodeps\x86\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-x86\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpinenodeps\arm64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-arm64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpinenodeps\arm\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-arm\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpinenodeps\riscv64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-riscv64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpinenodeps\loongarch64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-loongarch64\native\%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="IncludeAdditionalTfmSpecificPackageFiles">
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<TfmSpecificPackageFile Include="buildTransitive\net4\SkiaSharp.targets" PackagePath="buildTransitive\$(NuGetShortFolderName)\$(PackageId).targets" />
<TfmSpecificPackageFile Include="buildTransitive\net4\SkiaSharp.targets" PackagePath="build\$(NuGetShortFolderName)\$(PackageId).targets" />
</ItemGroup>
</Target>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-riscv64\native\libSkiaSharp*.so">
<Dir>riscv64\</Dir>
</_NativeSkiaSharpFile>
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-loongarch64\native\libSkiaSharp*.so">
<Dir>loongarch64\</Dir>
</_NativeSkiaSharpFile>

<!-- Musl -->
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-x86\native\libSkiaSharp*.so">
Expand All @@ -42,6 +45,9 @@
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-riscv64\native\libSkiaSharp*.so">
<Dir>musl-riscv64\</Dir>
</_NativeSkiaSharpFile>
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-loongarch64\native\libSkiaSharp*.so">
<Dir>musl-loongarch64\</Dir>
</_NativeSkiaSharpFile>

<!-- include everything -->
<Content Include="@(_NativeSkiaSharpFile)">
Expand All @@ -52,4 +58,4 @@

</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
<PackageFile Include="..\..\output\native\linux\arm64\libSkiaSharp*.so" PackagePath="runtimes\linux-arm64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linux\arm\libSkiaSharp*.so" PackagePath="runtimes\linux-arm\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linux\riscv64\libSkiaSharp*.so" PackagePath="runtimes\linux-riscv64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\linux\loongarch64\libSkiaSharp*.so" PackagePath="runtimes\linux-loongarch64\native\%(Filename)%(Extension)" />
<!-- Musl -->
<PackageFile Include="..\..\output\native\alpine\x64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-x64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\x86\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-x86\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\arm64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-arm64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\arm\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-arm\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\riscv64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-riscv64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\alpine\loongarch64\libSkiaSharp*.so" PackagePath="runtimes\linux-musl-loongarch64\native\%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="IncludeAdditionalTfmSpecificPackageFiles">
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-riscv64\native\libSkiaSharp*.so">
<Dir>riscv64\</Dir>
</_NativeSkiaSharpFile>
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-loongarch64\native\libSkiaSharp*.so">
<Dir>loongarch64\</Dir>
</_NativeSkiaSharpFile>

<!-- Musl -->
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-x86\native\libSkiaSharp*.so">
Expand All @@ -42,6 +45,9 @@
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-riscv64\native\libSkiaSharp*.so">
<Dir>musl-riscv64\</Dir>
</_NativeSkiaSharpFile>
<_NativeSkiaSharpFile Include="$(MSBuildThisFileDirectory)..\..\runtimes\linux-musl-loongarch64\native\libSkiaSharp*.so">
<Dir>musl-loongarch64\</Dir>
</_NativeSkiaSharpFile>

<!-- include everything -->
<Content Include="@(_NativeSkiaSharpFile)">
Expand Down
2 changes: 1 addition & 1 deletion scripts/Docker/_clang-cross-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -ex

# Parameters:
# $1 - The directory containing the Dockerfile [ clang-cross/10 | clang-cross ]
# $2 - The target architecture to build for [ arm | arm64 | riscv64 | x86 | x64 ]
# $2 - The target architecture to build for [ arm | arm64 | riscv64 | x86 | x64 | loongarch64 ]
# $3 - The ABI [ gnu | musl ]
# $4 - The variant [ "" | alpine ]

Expand Down
33 changes: 18 additions & 15 deletions scripts/Docker/alpine/clang-cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# Arguments:
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 ]
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 | loongarch64 ]
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ]
# LLVM_VERSION - the version of the LLVM compiler [ 13 | * ]
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 9 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-alpine-linux-musleabihf | aarch64-alpine-linux-musl | riscv64-alpine-linux-musl ]
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 14 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-alpine-linux-musleabihf | aarch64-alpine-linux-musl | riscv64-alpine-linux-musl | loongarch64-alpine-linux-musl ]

ARG IMAGE_ARCH=amd64
FROM ${IMAGE_ARCH}/debian:12

# Set the architecture-specific variables based on the value of the BUILD_ARCH argument
ARG BUILD_ARCH=arm64
RUN case ${BUILD_ARCH} in \
arm) TOOLCHAIN_ARCH=armv7-alpine-linux-musleabihf ; TOOLCHAIN_ARCH_TARGET=armv7-alpine-linux-musleabihf ;; \
arm64) TOOLCHAIN_ARCH=aarch64-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=aarch64-alpine-linux-musl ;; \
riscv64) TOOLCHAIN_ARCH=riscv64-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=riscv64-alpine-linux-musl ;; \
x86) TOOLCHAIN_ARCH=i586-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=i586-alpine-linux-musl ;; \
x64) TOOLCHAIN_ARCH=x86_64-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=x86_64-alpine-linux-musl ;; \
arm) TOOLCHAIN_ARCH=armv7-alpine-linux-musleabihf ; TOOLCHAIN_ARCH_TARGET=armv7-alpine-linux-musleabihf ;; \
arm64) TOOLCHAIN_ARCH=aarch64-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=aarch64-alpine-linux-musl ;; \
loongarch64) TOOLCHAIN_ARCH=loongarch64-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=loongarch64-alpine-linux-musl ;; \
riscv64) TOOLCHAIN_ARCH=riscv64-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=riscv64-alpine-linux-musl ;; \
x86) TOOLCHAIN_ARCH=i586-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=i586-alpine-linux-musl ;; \
x64) TOOLCHAIN_ARCH=x86_64-alpine-linux-musl ; TOOLCHAIN_ARCH_TARGET=x86_64-alpine-linux-musl ;; \
*) echo "Unsupported architecture: ${BUILD_ARCH}" && exit 1 ;; \
esac \
&& echo "export TOOLCHAIN_ARCH=${TOOLCHAIN_ARCH}" > /etc/skia-env \
Expand All @@ -33,16 +34,18 @@ RUN apt-get update \
ARG MACHINE_ARCH=x86_64
RUN . /etc/skia-env \
&& case "${BUILD_ARCH}" in \
arm) APK_ARCH=armv7 ;; \
arm64) APK_ARCH=aarch64 ;; \
riscv64) APK_ARCH=riscv64 ;; \
x86) APK_ARCH=x86 ;; \
x64) APK_ARCH=x86_64 ;; \
arm) APK_ARCH=armv7 ;; \
arm64) APK_ARCH=aarch64 ;; \
loongarch64) APK_ARCH=loongarch64 ;; \
riscv64) APK_ARCH=riscv64 ;; \
x86) APK_ARCH=x86 ;; \
x64) APK_ARCH=x86_64 ;; \
*) echo "Unsupported architecture: ${BUILD_ARCH}" && exit 1 ;; \
esac \
&& case "${BUILD_ARCH}" in \
riscv64) DISTRO_VERSION=3.20 ;; \
*) DISTRO_VERSION=3.17 ;; \
loongarch64) DISTRO_VERSION=3.21 ;; \
riscv64) DISTRO_VERSION=3.20 ;; \
*) DISTRO_VERSION=3.17 ;; \
esac \
&& APK_DIR="$(mktemp -d)" \
&& curl -SLO --create-dirs --output-dir "$APK_DIR" "https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.12.14/$MACHINE_ARCH/apk.static" \
Expand Down
2 changes: 1 addition & 1 deletion scripts/Docker/alpine/clang-cross/build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -ex

# Parameters:
# $1 - The target architecture to build for [ arm | arm64 | riscv64 | x86 | x64 ]
# $1 - The target architecture to build for [ arm | arm64 | riscv64 | x86 | x64 | loongarch64 ]

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

Expand Down
88 changes: 88 additions & 0 deletions scripts/Docker/debian/clang-cross/13/Dockerfile
Comment thread
mattleibow marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Arguments:
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 | loongarch64 ]
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ]
# LLVM_VERSION - the version of the LLVM compiler [ 19 | * ]
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 14 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu | riscv64-linux-gnu | loongarch64-linux-gnu ]
# TOOLCHAIN_ARCH_SHORT - the short form architecture of the GCC toolchain [ armhf | arm64 | riscv64 | loong64 ]

ARG IMAGE_ARCH=amd64
FROM ${IMAGE_ARCH}/debian:trixie

# Set the architecture-specific variables based on the value of the BUILD_ARCH argument
ARG BUILD_ARCH=arm64
RUN case ${BUILD_ARCH} in \
arm) TOOLCHAIN_ARCH=arm-linux-gnueabihf ; TOOLCHAIN_ARCH_SHORT=armhf ; TOOLCHAIN_ARCH_TARGET=armv7a-linux-gnueabihf ;; \
arm64) TOOLCHAIN_ARCH=aarch64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=arm64 ; TOOLCHAIN_ARCH_TARGET=aarch64-linux-gnu ;; \
loongarch64) TOOLCHAIN_ARCH=loongarch64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=loong64 ; TOOLCHAIN_ARCH_TARGET=loongarch64-linux-gnu ;; \
riscv64) TOOLCHAIN_ARCH=riscv64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=riscv64 ; TOOLCHAIN_ARCH_TARGET=riscv64-linux-gnu ;; \
x86) TOOLCHAIN_ARCH=i686-linux-gnu ; TOOLCHAIN_ARCH_SHORT=i386 ; TOOLCHAIN_ARCH_TARGET=i686-linux-gnu ;; \
x64) TOOLCHAIN_ARCH=x86-64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=amd64 ; TOOLCHAIN_ARCH_TARGET=x86_64-linux-gnu ;; \
*) echo "Unsupported architecture: ${BUILD_ARCH}" && exit 1 ;; \
esac \
&& echo "export TOOLCHAIN_ARCH=${TOOLCHAIN_ARCH}" > /etc/skia-env \
&& echo "export TOOLCHAIN_ARCH_SHORT=${TOOLCHAIN_ARCH_SHORT}" >> /etc/skia-env \
&& echo "export TOOLCHAIN_ARCH_TARGET=${TOOLCHAIN_ARCH_TARGET}" >> /etc/skia-env

# Install the required packages
ARG LLVM_VERSION=19
RUN apt-get update \
&& apt-get install -y \
curl python3 git clang-${LLVM_VERSION} ninja-build xz-utils \
&& rm -rf /var/lib/apt/lists/*

# Install the cross-compilation GCC toolchain
ARG TOOLCHAIN_VERSION=14
RUN . /etc/skia-env \
&& apt-get update \
&& apt-get install -y \
libc6-dev-${TOOLCHAIN_ARCH_SHORT}-cross \
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
# libpthread.so.0 for loong64 is in https://packages.debian.org/trixie/all/libc6-loong64-cross/filelist that use GCC 14 and Glibc 2.41 to programmed
RUN . /etc/skia-env \
&& TOOLCHAIN_ARCH=$(echo ${TOOLCHAIN_ARCH} | sed 's/x86-64/x86_64/g') \
&& 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.0 \
&& sed -i "s/\/usr\/${TOOLCHAIN_ARCH}\/lib\///g" /usr/${TOOLCHAIN_ARCH}/lib/libc.so

# Install the cross-compilation skia build dependencies (fontconfig)
# In order to compat Loongnix 25, LoongArch APT_REPO use loongnix 25 mirrors.
RUN . /etc/skia-env \
&& mkdir -p /skia-utils/libfontconfig-dev \
&& cd /skia-utils/libfontconfig-dev \
&& APT_REPO=http://deb.debian.org/debian \
&& case "${TOOLCHAIN_ARCH_SHORT}" in \
loong64) FC_VERSION=2.15.0-1.1 ; FC_PKG=libfontconfig-dev ; APT_REPO=https://pkg.loongnix.cn/loongnix/25 ;; \
riscv64) FC_VERSION=2.15.0-2.1 ; FC_PKG=libfontconfig-dev ;; \
*) FC_VERSION=2.13.1-2 ; FC_PKG=libfontconfig1-dev ;; \
esac \
&& curl ${APT_REPO}/pool/main/f/fontconfig/${FC_PKG}_${FC_VERSION}_${TOOLCHAIN_ARCH_SHORT}.deb -L -o libfontconfig-dev.deb \
&& ar vx libfontconfig-dev.deb \
&& tar -xJvf data.tar.xz \
&& rm libfontconfig-dev.deb \
&& TOOLCHAIN_ARCH=$(echo ${TOOLCHAIN_ARCH} | sed 's/x86-64/x86_64/g') \
&& cp -R usr/lib/*/* /usr/${TOOLCHAIN_ARCH}/lib/ \
&& cp -R usr/include/* /usr/${TOOLCHAIN_ARCH}/include/

# Install the .NET SDK
ARG DOTNET_SDK_VERSION=8.0
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
RUN curl https://builds.dotnet.microsoft.com/dotnet/scripts/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 \
&& dotnet --info

ENV CC=clang-${LLVM_VERSION} CXX=clang++-${LLVM_VERSION}

WORKDIR /work

COPY ./startup.sh /
RUN chmod +x /startup.sh
ENTRYPOINT [ "/startup.sh" ]
Comment thread
mattleibow marked this conversation as resolved.
6 changes: 6 additions & 0 deletions scripts/Docker/debian/clang-cross/13/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e

source /etc/skia-env

exec "$@"
5 changes: 3 additions & 2 deletions scripts/Docker/debian/clang-cross/build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
set -ex

# Parameters:
# $1 - The target architecture to build for [ arm | arm64 | riscv64 | x86 | x64 ]
# $2 - The Debian distro version [ 10 | 12 ]
# $1 - The target architecture to build for [ arm | arm64 | riscv64 | x86 | x64 | loongarch64 ]
# $2 - The Debian distro version [ 10 | 12 | 13 ]
# LoongArch needs to get the packages from loongnix25

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

Expand Down
Loading