diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 378e142a..297fbefe 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -30,6 +30,7 @@ jobs: platform: - 'linux-x64' - 'linuxmusl-x64' + - 'linuxmusl-arm64v8' - 'linux-armv6' - 'linux-armv7' - 'linux-arm64v8' diff --git a/build.sh b/build.sh index 6b2ae0ae..c53dcf4b 100755 --- a/build.sh +++ b/build.sh @@ -16,9 +16,10 @@ if [ $# -lt 1 ]; then echo "- win32-arm64v8" echo "- linux-x64" echo "- linuxmusl-x64" + echo "- linuxmusl-arm64v8/arm64" echo "- linux-armv6" echo "- linux-armv7" - echo "- linux-arm64v8" + echo "- linux-arm64v8/arm64" echo "- darwin-x64" echo exit 1 @@ -26,6 +27,14 @@ fi VERSION_VIPS="$1" PLATFORM="${2:-all}" +# alias arm64 to arm64v8 +if [ $PLATFORM = "linuxmusl-arm64" ]; then + PLATFORM="linuxmusl-arm64v8" +fi +if [ $PLATFORM = "linux-arm64" ]; then + PLATFORM="linux-arm64v8" +fi + # macOS # Note: we intentionally don't build these binaries inside a Docker container if [ $PLATFORM = "darwin-x64" ] && [ "$(uname)" == "Darwin" ]; then @@ -70,8 +79,8 @@ for flavour in win32-ia32 win32-x64 win32-arm64v8; do fi done -# Linux (x64, ARMv6, ARMv7, ARM64v8) -for flavour in linux-x64 linuxmusl-x64 linux-armv6 linux-armv7 linux-arm64v8; do +# Linux (x64 ARMv6, ARMv7, ARM64v8) +for flavour in linux-x64 linuxmusl-x64 linuxmusl-arm64v8 linux-armv6 linux-armv7 linux-arm64v8; do if [ $PLATFORM = "all" ] || [ $PLATFORM = $flavour ]; then echo "Building $flavour..." docker build -t vips-dev-$flavour $flavour diff --git a/build/lin.sh b/build/lin.sh index 98a98fce..f4114caf 100755 --- a/build/lin.sh +++ b/build/lin.sh @@ -1,6 +1,14 @@ #!/usr/bin/env bash set -e +# alias arm64 to arm64v8 +if [ $PLATFORM = "linuxmusl-arm64" ]; then + PLATFORM="linuxmusl-arm64v8" +fi +if [ $PLATFORM = "linux-arm64" ]; then + PLATFORM="linux-arm64v8" +fi + # Environment / working directories case ${PLATFORM} in linux*) @@ -69,7 +77,7 @@ CURL="curl --silent --location --retry 3 --retry-max-time 30" # Dependency version numbers VERSION_ZLIB=1.2.11 VERSION_FFI=3.3 -VERSION_GLIB=2.67.1 +VERSION_GLIB=2.67.2 VERSION_XML2=2.9.10 VERSION_GSF=1.14.47 VERSION_EXIF=0.6.22 @@ -78,14 +86,14 @@ VERSION_JPEG=2.0.6 VERSION_PNG16=1.6.37 VERSION_SPNG=0.6.1 VERSION_WEBP=1.1.0 -VERSION_TIFF=4.1.0 +VERSION_TIFF=4.2.0 VERSION_ORC=0.4.32 VERSION_GETTEXT=0.21 VERSION_GDKPIXBUF=2.42.2 VERSION_FREETYPE=2.10.4 VERSION_EXPAT=2.2.10 VERSION_FONTCONFIG=2.13.93 -VERSION_HARFBUZZ=2.7.2 +VERSION_HARFBUZZ=2.7.4 VERSION_PIXMAN=0.40.0 VERSION_CAIRO=1.17.4 VERSION_FRIBIDI=1.0.10 @@ -316,8 +324,8 @@ cd ${DEPS}/harfbuzz sed -i'.bak' "/subdir('util')/d" meson.build LDFLAGS=${LDFLAGS/\$/} meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ -Dicu=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Dbenchmark=disabled ${DARWIN:+-Dcoretext=enabled} -ninja -C _build -ninja -C _build install +ninja -j1 -C _build +ninja -j1 -C _build install mkdir ${DEPS}/pixman $CURL https://cairographics.org/releases/pixman-${VERSION_PIXMAN}.tar.gz | tar xzC ${DEPS}/pixman --strip-components=1 diff --git a/linuxmusl-arm64v8/Dockerfile b/linuxmusl-arm64v8/Dockerfile new file mode 100644 index 00000000..d3384d01 --- /dev/null +++ b/linuxmusl-arm64v8/Dockerfile @@ -0,0 +1,61 @@ +FROM alpine:3.11 +LABEL maintainer="Lovell Fuller " + +# Create Alpine 3.11 (musl 1.1.24) container suitable for building Linux x64 binaries + +# Path settings +ENV \ + RUSTUP_HOME="/usr/local/rustup" \ + CARGO_HOME="/usr/local/cargo" \ + PATH="/usr/local/cargo/bin:$PATH" + +# Build dependencies +RUN \ + apk update && apk upgrade && \ + apk --update --no-cache add \ + autoconf \ + automake \ + binutils \ + brotli \ + build-base \ + cmake \ + curl \ + findutils \ + git \ + glib-dev \ + gobject-introspection-dev \ + gperf \ + gtk-doc \ + intltool \ + jq \ + libtool \ + linux-headers \ + nasm \ + ninja \ + python3 \ + shared-mime-info \ + texinfo \ + tar \ + && \ + apk --update --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/community/ add advancecomp && \ + curl https://sh.rustup.rs -sSf | sh -s -- -y \ + --no-modify-path \ + --profile minimal \ + && \ + rustup target add aarch64-unknown-linux-musl && \ + pip3 install meson==0.55.3 + +# Compiler settings +ENV \ + PLATFORM="linuxmusl-arm64" \ + RUST_TARGET="aarch64-unknown-linux-musl" \ + FLAGS="-O3 -fPIC" \ + ARFLAGS="cr" \ + AR_FLAGS="cr" + +# Musl defaults to static libs but we need them to be dynamic for host toolchain. +# The toolchain will produce static libs by default. +ENV \ + RUSTFLAGS="-C target-feature=-crt-static" + +COPY Toolchain.cmake /root/ \ No newline at end of file diff --git a/linuxmusl-arm64v8/Toolchain.cmake b/linuxmusl-arm64v8/Toolchain.cmake new file mode 100644 index 00000000..d98fafd2 --- /dev/null +++ b/linuxmusl-arm64v8/Toolchain.cmake @@ -0,0 +1,3 @@ +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)