diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index bb4ee54d..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2.1 -orbs: - github-cli: circleci/github-cli@2.0 - -workflows: - build: - jobs: - - linux-arm64v8: - filters: - tags: - only: /^v.*/ - -jobs: - linux-arm64v8: - resource_class: arm.medium - machine: - image: ubuntu-2204:current - steps: - - checkout - - github-cli/setup - - run: ./build.sh $(cat LIBVIPS_VERSION) linux-arm64v8 - - run: ./integrity.sh - - when: - condition: <> - steps: - - run: gh release upload --repo "$(git config --get remote.origin.url)" $CIRCLE_TAG *.tar.gz *.integrity diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml deleted file mode 100644 index 66ad55d9..00000000 --- a/.github/workflows/build-release.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Build Release -on: [ push, pull_request ] -jobs: - create-release: - runs-on: 'ubuntu-22.04' - outputs: - upload_url: ${{ steps.create-release.outputs.upload_url }} - steps: - - name: Create Release - id: create-release - if: startsWith(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - omitBody: true - prerelease: true - token: ${{ secrets.GITHUB_TOKEN }} - build: - runs-on: ${{ matrix.os }} - needs: create-release - strategy: - fail-fast: false - matrix: - os: [ ubuntu-22.04 ] - platform: - - 'linux-x64' - - 'linux-armv6' - - 'linux-armv7' - - 'linuxmusl-x64' - - 'linuxmusl-arm64v8' - - 'linux-s390x' - - 'wasm32' - - 'win32-ia32' - - 'win32-x64' - - 'win32-arm64v8' - include: - - os: macos-11 - platform: 'darwin-x64' - - os: macos-11 - platform: 'darwin-arm64v8' - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies (macOS) - if: runner.os == 'macOS' - run: | - pip3 install meson ninja packaging - brew install automake nasm pkg-config - - name: Build ${{ matrix.platform }} - id: build-release - run: ./build.sh $(cat LIBVIPS_VERSION) ${{ matrix.platform }} - - name: Generate integrity checksums - id: integrity - run: ./integrity.sh - - name: Upload Release Asset (.tar.gz) - id: upload-release-asset-gz - if: startsWith(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: libvips-*-${{ matrix.platform }}.tar.gz - artifactContentType: application/gzip - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Release Asset (.integrity) - id: upload-release-asset-integrity - if: startsWith(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: "*.integrity" - artifactContentType: text/plain - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b535e913 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,95 @@ +name: CI +on: + - push + - pull_request +permissions: {} +jobs: + check-latest-versions: + permissions: + contents: read + runs-on: 'ubuntu-24.04' + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Check latest versions + run: ./check-latest-versions.sh + build: + permissions: + contents: read + name: build-${{ matrix.platform }} + runs-on: ${{ matrix.os }} + needs: check-latest-versions + strategy: + fail-fast: false + matrix: + include: + - os: 'ubuntu-24.04' + platform: 'linux-x64' + - os: 'ubuntu-24.04' + platform: 'linux-armv6' + - os: 'ubuntu-24.04' + platform: 'linuxmusl-x64' + - os: 'ubuntu-24.04' + platform: 'linux-ppc64le' + - os: 'ubuntu-24.04' + platform: 'linux-riscv64' + - os: 'ubuntu-24.04' + platform: 'linux-s390x' + - os: 'ubuntu-24.04' + platform: 'dev-wasm32' + - os: 'ubuntu-24.04' + platform: 'win32-ia32' + - os: 'ubuntu-24.04' + platform: 'win32-x64' + - os: 'ubuntu-24.04' + platform: 'win32-arm64v8' + - os: 'macos-13' + platform: 'darwin-x64' + - os: 'macos-14' + platform: 'darwin-arm64v8' + - os: 'ubuntu-24.04-arm' + platform: 'linux-arm64v8' + - os: 'ubuntu-24.04-arm' + platform: 'linuxmusl-arm64v8' + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: | + pipx install meson==1.7.2 + brew install automake nasm python-packaging + - name: Build ${{ matrix.platform }} + run: ./build.sh ${{ matrix.platform }} + - name: Upload ${{ matrix.platform }} artifact + uses: actions/upload-artifact@v4 + with: + name: build-${{ matrix.platform }} + path: '*.tar.gz' + compression-level: 0 + retention-days: 1 + if-no-files-found: error + populate-and-publish-npm-workspace: + permissions: + contents: write + needs: build + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + - name: Populate npm workspace + run: ./populate-npm-workspace.sh + - name: Create npm workspace tarball + run: tar -vcaf npm-workspace.tar.xz -C npm . + - name: Create GitHub release for tag + if: startsWith(github.ref, 'refs/tags/v') + uses: ncipollo/release-action@v1 + with: + artifacts: npm-workspace.tar.xz + artifactContentType: application/x-xz + prerelease: ${{ contains(github.ref, '-rc') }} + makeLatest: ${{ !contains(github.ref, '-rc') }} diff --git a/.gitignore b/.gitignore index 4d630da0..0ba826ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ libvips* +sharp-libvips* *.log build/wasm-vips-* deps/ diff --git a/LIBVIPS_VERSION b/LIBVIPS_VERSION deleted file mode 100644 index e7ab33dc..00000000 --- a/LIBVIPS_VERSION +++ /dev/null @@ -1 +0,0 @@ -8.15.2 diff --git a/README.md b/README.md index a9743ed3..c98274ee 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,16 @@ Run the top-level [build script](build.sh) without parameters for help. ### Linux -One [build script](build/lin.sh) is used to (cross-)compile +One [build script](build/posix.sh) is used to (cross-)compile the same shared libraries within multiple containers. * [x64 glibc](platforms/linux-x64/Dockerfile) * [x64 musl](platforms/linuxmusl-x64/Dockerfile) * [ARMv6 glibc](platforms/linux-armv6/Dockerfile) -* [ARMv7-A glibc](platforms/linux-armv7/Dockerfile) * [ARM64v8-A glibc](platforms/linux-arm64v8/Dockerfile) * [ARM64v8-A musl](platforms/linuxmusl-arm64v8/Dockerfile) +* [ppc64le glibc](platforms/linux-ppc64le/Dockerfile) +* [RISC-V 64-bit glibc](platforms/linux-riscv64/Dockerfile) * [s390x glibc](platforms/linux-s390x/Dockerfile) ### Windows diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md index 79e5bfc5..7b794812 100644 --- a/THIRD-PARTY-NOTICES.md +++ b/THIRD-PARTY-NOTICES.md @@ -12,7 +12,6 @@ used under the terms of the following licences: | fontconfig | [fontconfig Licence](https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/main/COPYING) (BSD-like) | | freetype | [freetype Licence](https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT) (BSD-like) | | fribidi | LGPLv3 | -| gdk-pixbuf | LGPLv3 | | glib | LGPLv3 | | harfbuzz | MIT Licence | | highway | Apache-2.0 License, BSD 3-Clause | @@ -23,7 +22,7 @@ used under the terms of the following licences: | libheif | LGPLv3 | | libimagequant | [BSD 2-Clause](https://github.com/lovell/libimagequant/blob/main/COPYRIGHT) | | libnsgif | MIT Licence | -| libpng | [libpng License](https://github.com/glennrp/libpng/blob/master/LICENSE) | +| libpng | [libpng License](https://github.com/pnggroup/libpng/blob/master/LICENSE) | | librsvg | LGPLv3 | | libspng | [BSD 2-Clause, libpng License](https://github.com/randy408/libspng/blob/master/LICENSE) | | libtiff | [libtiff License](https://gitlab.com/libtiff/libtiff/blob/master/LICENSE.md) (BSD-like) | diff --git a/build.sh b/build.sh index d32817a9..6d5cb271 100755 --- a/build.sh +++ b/build.sh @@ -1,14 +1,13 @@ #!/usr/bin/env bash set -e +# Dependency version numbers +source ./versions.properties + if [ $# -lt 1 ]; then echo - echo "Usage: $0 VERSION [PLATFORM]" - echo "Build shared libraries for libvips and its dependencies via containers" - echo - echo "Please specify the libvips VERSION, e.g. 8.9.2" - echo - echo "Optionally build for only one PLATFORM, defaults to building for all" + echo "Usage: $0 PLATFORM" + echo "Build shared libraries for libvips and its dependencies" echo echo "Possible values for PLATFORM are:" echo "- win32-ia32" @@ -17,17 +16,18 @@ if [ $# -lt 1 ]; then echo "- linux-x64" echo "- linuxmusl-x64" echo "- linux-armv6" - echo "- linux-armv7" echo "- linux-arm64v8" echo "- linuxmusl-arm64v8" + echo "- linux-ppc64le" + echo "- linux-riscv64" echo "- linux-s390x" echo "- darwin-x64" echo "- darwin-arm64v8" + echo "- dev-wasm32" echo exit 1 fi -VERSION_VIPS="$1" -PLATFORM="${2:-all}" +PLATFORM="$1" # macOS # Note: we intentionally don't build these binaries inside a Docker container @@ -39,14 +39,17 @@ for flavour in darwin-x64 darwin-arm64v8; do export CC="clang" export CXX="clang++" - export VERSION_VIPS export PLATFORM # Use pkg-config provided by Homebrew export PKG_CONFIG="$(brew --prefix)/bin/pkg-config --static" # Earliest supported version of macOS - export MACOSX_DEPLOYMENT_TARGET="10.13" + if [ $PLATFORM = "darwin-arm64v8" ]; then + export MACOSX_DEPLOYMENT_TARGET="11.0" + else + export MACOSX_DEPLOYMENT_TARGET="10.15" + fi # Added -fno-stack-check to workaround a stack misalignment bug on macOS 10.15 # See: @@ -57,17 +60,8 @@ for flavour in darwin-x64 darwin-arm64v8; do export FLAGS+=" -Werror=unguarded-availability-new" export MESON="--cross-file=$PWD/platforms/$PLATFORM/meson.ini" - if [ $PLATFORM = "darwin-arm64v8" ]; then - # ARM64 builds work via cross compilation from an x86_64 machine - export CHOST="aarch64-apple-darwin" - export FLAGS+=" -target arm64-apple-macos11" - # macOS 11 Big Sur is the first version to support ARM-based macs - export MACOSX_DEPLOYMENT_TARGET="11.0" - # Set SDKROOT to the latest SDK available - export SDKROOT=$(xcrun -sdk macosx --show-sdk-path) - fi - - . $PWD/build/mac.sh + source $PWD/versions.properties + source $PWD/build/posix.sh exit 0 fi @@ -80,30 +74,25 @@ if ! [ -x "$(command -v docker)" ]; then fi # WebAssembly -if [ "$PLATFORM" == "wasm32" ]; then - ./build/wasm.sh "${VERSION_VIPS}" +if [ "$PLATFORM" == "dev-wasm32" ]; then + ./build/wasm.sh exit 0 fi -# Update base images -for baseimage in alpine:3.15 amazonlinux:2 debian:bullseye debian:buster; do - docker pull $baseimage -done - # Windows for flavour in win32-ia32 win32-x64 win32-arm64v8; do if [ $PLATFORM = "all" ] || [ $PLATFORM = $flavour ]; then echo "Building $flavour..." - docker build -t vips-dev-win32 platforms/win32 - docker run --rm -e "VERSION_VIPS=${VERSION_VIPS}" -e "PLATFORM=${flavour}" -v $PWD:/packaging vips-dev-win32 sh -c "/packaging/build/win.sh" + docker build --pull -t vips-dev-win32 platforms/win32 + docker run --rm -e "PLATFORM=${flavour}" -v $PWD:/packaging vips-dev-win32 sh -c "/packaging/build/win.sh" fi done -# Linux (x64, ARMv6, ARMv7, ARM64v8) -for flavour in linux-x64 linuxmusl-x64 linux-armv6 linux-armv7 linux-arm64v8 linuxmusl-arm64v8 linux-s390x; do +# Linux (x64, ARMv6, ARM64v8) +for flavour in linux-x64 linuxmusl-x64 linux-armv6 linux-arm64v8 linuxmusl-arm64v8 linux-ppc64le linux-riscv64 linux-s390x; do if [ $PLATFORM = "all" ] || [ $PLATFORM = $flavour ]; then echo "Building $flavour..." - docker build -t vips-dev-$flavour platforms/$flavour - docker run --rm -e "VERSION_VIPS=${VERSION_VIPS}" -e VERSION_LATEST_REQUIRED -v $PWD:/packaging vips-dev-$flavour sh -c "/packaging/build/lin.sh" + docker build --pull -t vips-dev-$flavour platforms/$flavour + docker run --rm -v $PWD:/packaging vips-dev-$flavour sh -c "/packaging/build/posix.sh" fi done diff --git a/build/mac.sh b/build/mac.sh deleted file mode 120000 index 5dbad0d3..00000000 --- a/build/mac.sh +++ /dev/null @@ -1 +0,0 @@ -lin.sh \ No newline at end of file diff --git a/build/lin.sh b/build/posix.sh similarity index 69% rename from build/lin.sh rename to build/posix.sh index 998e8e89..41f1cace 100755 --- a/build/lin.sh +++ b/build/posix.sh @@ -1,6 +1,20 @@ #!/usr/bin/env bash set -e +# Dependency version numbers +if [ -f /packaging/versions.properties ]; then + source /packaging/versions.properties +fi + +# Remove patch version component +without_patch() { + echo "${1%.[[:digit:]]*}" +} +# Remove prerelease suffix +without_prerelease() { + echo "${1%-[[:alnum:]]*}" +} + # Environment / working directories case ${PLATFORM} in linux*) @@ -9,7 +23,7 @@ case ${PLATFORM} in TARGET=/target PACKAGE=/packaging ROOT=/root - VIPS_CPP_DEP=libvips-cpp.so.42 + VIPS_CPP_DEP=libvips-cpp.so.$(without_prerelease $VERSION_VIPS) ;; darwin*) DARWIN=true @@ -17,7 +31,7 @@ case ${PLATFORM} in TARGET=$PWD/target PACKAGE=$PWD ROOT=$PWD/platforms/$PLATFORM - VIPS_CPP_DEP=libvips-cpp.42.dylib + VIPS_CPP_DEP=libvips-cpp.$(without_prerelease $VERSION_VIPS).dylib ;; esac @@ -61,9 +75,6 @@ if [ "$DARWIN" = true ]; then mkdir -p $CARGO_HOME mkdir -p $RUSTUP_HOME export PATH="${CARGO_HOME}/bin:${PATH}" - if [ "$PLATFORM" == "darwin-arm64v8" ]; then - export DARWIN_ARM=true - fi fi # Run as many parallel jobs as there are available CPU cores @@ -91,104 +102,12 @@ unset PKG_CONFIG_PATH # Common options for curl CURL="curl --silent --location --retry 3 --retry-max-time 30" -# Dependency version numbers -VERSION_ZLIB_NG=2.1.6 -VERSION_FFI=3.4.6 -VERSION_GLIB=2.80.0 -VERSION_XML2=2.12.6 -VERSION_EXIF=0.6.24 -VERSION_LCMS2=2.16 -VERSION_MOZJPEG=4.1.5 -VERSION_PNG16=1.6.43 -VERSION_SPNG=0.7.4 -VERSION_IMAGEQUANT=2.4.1 -VERSION_WEBP=1.3.2 -VERSION_TIFF=4.6.0 -VERSION_HWY=1.1.0 -VERSION_PROXY_LIBINTL=0.4 -VERSION_GDKPIXBUF=2.42.10 -VERSION_FREETYPE=2.13.2 -VERSION_EXPAT=2.6.2 -VERSION_ARCHIVE=3.7.2 -VERSION_FONTCONFIG=2.15.0 -VERSION_HARFBUZZ=8.3.0 -VERSION_PIXMAN=0.43.4 -VERSION_CAIRO=1.18.0 -VERSION_FRIBIDI=1.0.13 -VERSION_PANGO=1.52.1 -VERSION_RSVG=2.57.2 -VERSION_AOM=3.8.2 -VERSION_HEIF=1.17.6 -VERSION_CGIF=0.3.2 - -# Remove patch version component -without_patch() { - echo "${1%.[[:digit:]]*}" -} -# Remove prerelease suffix -without_prerelease() { - echo "${1%-[[:alnum:]]*}" -} - -# Check for newer versions -# Skip by setting the VERSION_LATEST_REQUIRED environment variable to "false" -ALL_AT_VERSION_LATEST=true -version_latest() { - if [ "$VERSION_LATEST_REQUIRED" == "false" ]; then - echo "Skipping latest version check for $1" - return - fi - VERSION_SELECTOR="stable_versions" - if [[ "$4" == *"unstable"* ]]; then - VERSION_SELECTOR="versions" - fi - if [[ "$3" == *"/"* ]]; then - VERSION_LATEST=$(git ls-remote --tags --refs https://github.com/$3.git | sort -t'/' -k3 -V | awk -F'/' 'END{print $3}' | tr -d 'vV') - else - VERSION_LATEST=$($CURL "https://release-monitoring.org/api/v2/versions/?project_id=$3" | jq -j ".$VERSION_SELECTOR[0]" | tr '_' '.') - fi - if [ "$VERSION_LATEST" != "$2" ]; then - ALL_AT_VERSION_LATEST=false - echo "$1 version $2 has been superseded by $VERSION_LATEST" - fi -} -version_latest "zlib-ng" "$VERSION_ZLIB_NG" "115592" -version_latest "ffi" "$VERSION_FFI" "1611" -version_latest "glib" "$VERSION_GLIB" "10024" "unstable" -version_latest "xml2" "$VERSION_XML2" "1783" -version_latest "exif" "$VERSION_EXIF" "1607" -version_latest "lcms2" "$VERSION_LCMS2" "9815" -version_latest "mozjpeg" "$VERSION_MOZJPEG" "mozilla/mozjpeg" -version_latest "png" "$VERSION_PNG16" "1705" -version_latest "spng" "$VERSION_SPNG" "24289" -version_latest "webp" "$VERSION_WEBP" "webmproject/libwebp" -version_latest "tiff" "$VERSION_TIFF" "1738" -version_latest "highway" "$VERSION_HWY" "205809" -version_latest "proxy-libintl" "$VERSION_PROXY_LIBINTL" "frida/proxy-libintl" -version_latest "gdkpixbuf" "$VERSION_GDKPIXBUF" "9533" -version_latest "freetype" "$VERSION_FREETYPE" "854" -version_latest "expat" "$VERSION_EXPAT" "770" -version_latest "archive" "$VERSION_ARCHIVE" "1558" -version_latest "fontconfig" "$VERSION_FONTCONFIG" "827" -version_latest "harfbuzz" "$VERSION_HARFBUZZ" "1299" -version_latest "pixman" "$VERSION_PIXMAN" "3648" -version_latest "cairo" "$VERSION_CAIRO" "247" -version_latest "fribidi" "$VERSION_FRIBIDI" "857" -version_latest "pango" "$VERSION_PANGO" "11783" -#version_latest "rsvg" "$VERSION_RSVG" "5420" # https://github.com/lovell/sharp-libvips/issues/226 -version_latest "aom" "$VERSION_AOM" "17628" -version_latest "heif" "$VERSION_HEIF" "strukturag/libheif" -version_latest "cgif" "$VERSION_CGIF" "dloebl/cgif" -if [ "$ALL_AT_VERSION_LATEST" = "false" ]; then exit 1; fi - # Download and build dependencies from source if [ "$DARWIN" = true ]; then curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | sh -s -- -y --no-modify-path --profile minimal - if [ "$DARWIN_ARM" = true ]; then - ${CARGO_HOME}/bin/rustup target add aarch64-apple-darwin - fi + CFLAGS= cargo install cargo-c --locked fi if [ "${PLATFORM%-*}" == "linuxmusl" ] || [ "$DARWIN" = true ]; then @@ -213,53 +132,53 @@ mkdir ${DEPS}/ffi $CURL https://github.com/libffi/libffi/releases/download/v${VERSION_FFI}/libffi-${VERSION_FFI}.tar.gz | tar xzC ${DEPS}/ffi --strip-components=1 cd ${DEPS}/ffi ./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ - --disable-builddir --disable-multi-os-directory --disable-raw-api --disable-structs + --disable-builddir --disable-multi-os-directory --disable-raw-api --disable-structs --disable-docs make install-strip mkdir ${DEPS}/glib $CURL https://download.gnome.org/sources/glib/$(without_patch $VERSION_GLIB)/glib-${VERSION_GLIB}.tar.xz | tar xJC ${DEPS}/glib --strip-components=1 cd ${DEPS}/glib -$CURL https://gist.github.com/kleisauke/284d685efa00908da99ea6afbaaf39ae/raw/36e32c79e7962c5ea96cbb3f9c629e9145253e30/glib-without-gregex.patch | patch -p1 -meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - --force-fallback-for=gvdb -Dintrospection=disabled -Dnls=disabled -Dlibmount=disabled -Dlibelf=disabled \ - -Dtests=false -Dglib_assert=false -Dglib_checks=false ${DARWIN:+-Dbsymbolic_functions=false} -# bin-devel is needed for glib-compile-resources, as required by gdk-pixbuf +$CURL https://gist.github.com/kleisauke/284d685efa00908da99ea6afbaaf39ae/raw/936a6b8013d07d358c6944cc5b5f0e27db707ace/glib-without-gregex.patch | patch -p1 +$CURL https://gitlab.gnome.org/GNOME/glib/-/commit/5cc32c35f96bbafde6b6f0dc5011e6be2b69c49e.patch | patch -R -p1 +meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} --datadir=${TARGET}/share ${MESON} \ + --force-fallback-for=gvdb -Dintrospection=disabled -Dnls=disabled -Dlibmount=disabled -Dsysprof=disabled -Dlibelf=disabled \ + -Dtests=false -Dglib_assert=false -Dglib_checks=false -Dglib_debug=disabled ${DARWIN:+-Dbsymbolic_functions=false} +# bin-devel is needed for glib-mkenums meson install -C _build --tag bin-devel,devel mkdir ${DEPS}/xml2 $CURL https://download.gnome.org/sources/libxml2/$(without_patch $VERSION_XML2)/libxml2-${VERSION_XML2}.tar.xz | tar xJC ${DEPS}/xml2 --strip-components=1 cd ${DEPS}/xml2 -./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ - --with-minimum --with-reader --with-writer --with-valid --with-http --with-tree --with-zlib --without-python --without-lzma -make install-strip +meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ + -Dminimum=true +meson install -C _build --tag devel mkdir ${DEPS}/exif -$CURL https://github.com/libexif/libexif/releases/download/v${VERSION_EXIF}/libexif-${VERSION_EXIF}.tar.bz2 | tar xjC ${DEPS}/exif --strip-components=1 +$CURL https://github.com/libexif/libexif/releases/download/v${VERSION_EXIF}/libexif-${VERSION_EXIF}.tar.xz | tar xJC ${DEPS}/exif --strip-components=1 cd ${DEPS}/exif ./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ - --disable-nls --without-libiconv-prefix --without-libintl-prefix \ + --disable-nls --disable-docs --without-libiconv-prefix --without-libintl-prefix \ CPPFLAGS="${CPPFLAGS} -DNO_VERBOSE_TAG_DATA" -make install-strip +make install-strip doc_DATA= -mkdir ${DEPS}/lcms2 -$CURL https://github.com/mm2/Little-CMS/releases/download/lcms${VERSION_LCMS2}/lcms2-${VERSION_LCMS2}.tar.gz | tar xzC ${DEPS}/lcms2 --strip-components=1 -cd ${DEPS}/lcms2 -CFLAGS="${CFLAGS} -O3" meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} +mkdir ${DEPS}/lcms +$CURL https://github.com/mm2/Little-CMS/releases/download/lcms${VERSION_LCMS}/lcms2-${VERSION_LCMS}.tar.gz | tar xzC ${DEPS}/lcms --strip-components=1 +cd ${DEPS}/lcms +CFLAGS="${CFLAGS} -O3" meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ + -Dtests=disabled meson install -C _build --tag devel mkdir ${DEPS}/aom $CURL https://storage.googleapis.com/aom-releases/libaom-${VERSION_AOM}.tar.gz | tar xzC ${DEPS}/aom --strip-components=1 cd ${DEPS}/aom -if [ "${PLATFORM%-*}" == "linuxmusl" ]; then - # https://bugs.chromium.org/p/aomedia/issues/detail?id=2754 - $CURL https://gist.github.com/lovell/3e70b51079af2c9b78e5a0e6f6ad0e59/raw/92864bf57345f57cf32307dd3b399a6bd430b78e/aom-ensure-thread-stack-size-is-at-least-256-KB.patch | patch -p1 -fi +# Downgrade minimum required CMake version to 3.13 - https://aomedia.googlesource.com/aom/+/597a35fbc9837e33366a1108631d9c72ee7a49e7 +find . -name 'CMakeLists.txt' -o -name '*.cmake' | xargs sed -i'.bak' "/^cmake_minimum_required/s/3.16/3.13/" mkdir aom_build cd aom_build AOM_AS_FLAGS="${FLAGS}" cmake -G"Unix Makefiles" \ -DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=MinSizeRel \ -DBUILD_SHARED_LIBS=FALSE -DENABLE_DOCS=0 -DENABLE_TESTS=0 -DENABLE_TESTDATA=0 -DENABLE_TOOLS=0 -DENABLE_EXAMPLES=0 \ - -DCONFIG_PIC=1 -DENABLE_NASM=1 ${WITHOUT_NEON:+-DENABLE_NEON=0} ${DARWIN_ARM:+-DCONFIG_RUNTIME_CPU_DETECT=0} \ + -DCONFIG_PIC=1 -DENABLE_NASM=1 ${WITHOUT_NEON:+-DENABLE_NEON=0} \ -DCONFIG_AV1_HIGHBITDEPTH=0 -DCONFIG_WEBM_IO=0 \ .. make install/strip @@ -271,7 +190,7 @@ cd ${DEPS}/heif sed -i'.bak' "/^cmake_minimum_required/s/3.16.3/3.12/" CMakeLists.txt CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" cmake -G"Unix Makefiles" \ -DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=FALSE -DENABLE_PLUGIN_LOADING=0 -DWITH_EXAMPLES=0 -DWITH_LIBDE265=0 -DWITH_X265=0 + -DBUILD_SHARED_LIBS=FALSE -DBUILD_TESTING=0 -DENABLE_PLUGIN_LOADING=0 -DWITH_EXAMPLES=0 -DWITH_LIBDE265=0 -DWITH_X265=0 make install/strip mkdir ${DEPS}/jpeg @@ -282,17 +201,18 @@ cmake -G"Unix Makefiles" \ -DENABLE_STATIC=TRUE -DENABLE_SHARED=FALSE -DWITH_JPEG8=1 -DWITH_TURBOJPEG=FALSE -DPNG_SUPPORTED=FALSE make install/strip -mkdir ${DEPS}/png16 -$CURL https://downloads.sourceforge.net/project/libpng/libpng16/${VERSION_PNG16}/libpng-${VERSION_PNG16}.tar.xz | tar xJC ${DEPS}/png16 --strip-components=1 -cd ${DEPS}/png16 -./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking -make install-strip +mkdir ${DEPS}/png +$CURL https://downloads.sourceforge.net/project/libpng/libpng16/${VERSION_PNG}/libpng-${VERSION_PNG}.tar.xz | tar xJC ${DEPS}/png --strip-components=1 +cd ${DEPS}/png +./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ + --disable-tools --without-binconfigs --disable-unversioned-libpng-config --disable-riscv-rvv +make install-strip dist_man_MANS= mkdir ${DEPS}/spng $CURL https://github.com/randy408/libspng/archive/v${VERSION_SPNG}.tar.gz | tar xzC ${DEPS}/spng --strip-components=1 cd ${DEPS}/spng CFLAGS="${CFLAGS} -O3 -DSPNG_SSE=4" meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - -Dstatic_zlib=true + -Dstatic_zlib=true -Dbuild_examples=false meson install -C _build --tag devel mkdir ${DEPS}/imagequant @@ -306,15 +226,15 @@ $CURL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/lib cd ${DEPS}/webp ./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ --enable-libwebpmux --enable-libwebpdemux ${WITHOUT_NEON:+--disable-neon} -make install-strip +make install-strip bin_PROGRAMS= noinst_PROGRAMS= man_MANS= mkdir ${DEPS}/tiff $CURL https://download.osgeo.org/libtiff/tiff-${VERSION_TIFF}.tar.gz | tar xzC ${DEPS}/tiff --strip-components=1 cd ${DEPS}/tiff # Propagate -pthread into CFLAGS to ensure WebP support CFLAGS="${CFLAGS} -pthread" ./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ - --disable-tools --disable-tests --disable-contrib --disable-docs --disable-mdi --disable-pixarlog --disable-old-jpeg --disable-cxx --disable-lzma --disable-zstd -make install-strip + --disable-tools --disable-tests --disable-contrib --disable-docs --disable-mdi --disable-pixarlog --disable-old-jpeg --disable-cxx --disable-lzma --disable-zstd --disable-libdeflate +make install-strip noinst_PROGRAMS= dist_doc_DATA= if [ -z "$WITHOUT_HIGHWAY" ]; then mkdir ${DEPS}/hwy @@ -326,34 +246,13 @@ if [ -z "$WITHOUT_HIGHWAY" ]; then make install/strip fi -mkdir ${DEPS}/gdkpixbuf -$CURL https://download.gnome.org/sources/gdk-pixbuf/$(without_patch $VERSION_GDKPIXBUF)/gdk-pixbuf-${VERSION_GDKPIXBUF}.tar.xz | tar xJC ${DEPS}/gdkpixbuf --strip-components=1 -cd ${DEPS}/gdkpixbuf -# Skip thumbnailer -sed -i'.bak' "/subdir('thumbnailer')/d" meson.build -sed -i'.bak' "/post-install/{N;N;N;N;d;}" meson.build -# Skip the built-in loaders for BMP, GIF, ICO, PNM, XPM, XBM, TGA, ICNS and QTIF -sed -i'.bak' "/'bmp':/{N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;d;}" gdk-pixbuf/meson.build -sed -i'.bak' "/'pnm':/{N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;N;d;}" gdk-pixbuf/meson.build -# Skip executables -sed -i'.bak' "/gdk-pixbuf-csource/{N;N;d;}" gdk-pixbuf/meson.build -sed -i'.bak' "/loaders_cache = custom/{N;N;N;N;N;N;N;N;N;c\\ - loaders_cache = []\\ - loaders_dep = declare_dependency() -}" gdk-pixbuf/meson.build -meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - -Dtiff=disabled -Dintrospection=disabled -Dtests=false -Dinstalled_tests=false -Dgio_sniffing=false -Dman=false -Dbuiltin_loaders=png,jpeg -meson install -C _build --tag devel -# Include libjpeg and libpng as a dependency of gdk-pixbuf, see: https://gitlab.gnome.org/GNOME/gdk-pixbuf/merge_requests/50 -sed -i'.bak' "/^Requires:/s/$/ libjpeg, libpng16/" ${TARGET}/lib/pkgconfig/gdk-pixbuf-2.0.pc - build_freetype() { rm -rf ${DEPS}/freetype mkdir ${DEPS}/freetype $CURL https://github.com/freetype/freetype/archive/VER-${VERSION_FREETYPE//./-}.tar.gz | tar xzC ${DEPS}/freetype --strip-components=1 cd ${DEPS}/freetype meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - -Dzlib=enabled -Dpng=disabled -Dbrotli=disabled -Dbzip2=disabled "$@" + -Dzlib=enabled -Dpng=enabled -Dbrotli=disabled -Dbzip2=disabled "$@" meson install -C _build --tag devel } build_freetype -Dharfbuzz=disabled @@ -364,7 +263,7 @@ cd ${DEPS}/expat ./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared \ --disable-dependency-tracking --without-xmlwf --without-docbook --without-getrandom --without-sys-getrandom \ --without-libbsd --without-examples --without-tests -make install-strip +make install-strip dist_cmake_DATA= nodist_cmake_DATA= mkdir ${DEPS}/archive $CURL https://github.com/libarchive/libarchive/releases/download/v${VERSION_ARCHIVE}/libarchive-${VERSION_ARCHIVE}.tar.xz | tar xJC ${DEPS}/archive --strip-components=1 @@ -373,14 +272,15 @@ cd ${DEPS}/archive --disable-bsdtar --disable-bsdcat --disable-bsdcpio --disable-bsdunzip --disable-posix-regex-lib --disable-xattr --disable-acl \ --without-bz2lib --without-libb2 --without-iconv --without-lz4 --without-zstd --without-lzma \ --without-lzo2 --without-cng --without-openssl --without-xml2 --without-expat -make install-strip +make install-strip libarchive_man_MANS= mkdir ${DEPS}/fontconfig -$CURL https://www.freedesktop.org/software/fontconfig/release/fontconfig-${VERSION_FONTCONFIG}.tar.xz | tar xJC ${DEPS}/fontconfig --strip-components=1 +$CURL https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/${VERSION_FONTCONFIG}/fontconfig-${VERSION_FONTCONFIG}.tar.gz | tar xzC ${DEPS}/fontconfig --strip-components=1 cd ${DEPS}/fontconfig +# Disable install of gettext files +sed -i'.bak' "/subdir('its')/d" meson.build meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - -Dcache-build=disabled -Ddoc=disabled -Dnls=disabled -Dtests=disabled -Dtools=disabled \ - ${LINUX:+--sysconfdir=/etc} ${DARWIN:+--sysconfdir=/usr/local/etc} + -Dcache-build=disabled -Ddoc=disabled -Dnls=disabled -Dtests=disabled -Dtools=disabled meson install -C _build --tag devel mkdir ${DEPS}/harfbuzz @@ -396,7 +296,7 @@ meson install -C _build --tag devel # https://bugs.freedesktop.org/show_bug.cgi?id=7331 # https://gitlab.freedesktop.org/pkg-config/pkg-config/-/commit/6d6dd43e75e2bc82cfe6544f8631b1bef6e1cf45 # TODO(kleisauke): Remove when Amazon Linux 2 reaches EOL. -sed -i'.bak' "/^Requires:/s/ freetype2,//" ${TARGET}/lib/pkgconfig/harfbuzz.pc +sed -i'.bak' "/^Requires:/s/ freetype2.*,//" ${TARGET}/lib/pkgconfig/harfbuzz.pc sed -i'.bak' "/^Libs:/s/$/ -lfreetype/" ${TARGET}/lib/pkgconfig/harfbuzz.pc build_freetype -Dharfbuzz=enabled @@ -405,15 +305,15 @@ mkdir ${DEPS}/pixman $CURL https://cairographics.org/releases/pixman-${VERSION_PIXMAN}.tar.gz | tar xzC ${DEPS}/pixman --strip-components=1 cd ${DEPS}/pixman meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - -Dlibpng=disabled -Diwmmxt=disabled -Dgtk=disabled -Dopenmp=disabled -Dtests=disabled \ - ${DARWIN_ARM:+-Da64-neon=disabled} + -Dlibpng=disabled -Dgtk=disabled -Dopenmp=disabled -Dtests=disabled -Ddemos=disabled \ + ${WITHOUT_NEON:+-Da64-neon=disabled} meson install -C _build --tag devel mkdir ${DEPS}/cairo $CURL https://cairographics.org/releases/cairo-${VERSION_CAIRO}.tar.xz | tar xJC ${DEPS}/cairo --strip-components=1 cd ${DEPS}/cairo meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - ${LINUX:+-Dquartz=disabled} ${DARWIN:+-Dquartz=enabled} -Dtee=disabled -Dxcb=disabled -Dxlib=disabled -Dzlib=disabled \ + ${LINUX:+-Dquartz=disabled} ${DARWIN:+-Dquartz=enabled} -Dfreetype=enabled -Dfontconfig=enabled -Dtee=disabled -Dxcb=disabled -Dxlib=disabled -Dzlib=disabled \ -Dtests=disabled -Dspectre=disabled -Dsymbol-lookup=disabled meson install -C _build --tag devel @@ -427,43 +327,57 @@ meson install -C _build --tag devel mkdir ${DEPS}/pango $CURL https://download.gnome.org/sources/pango/$(without_patch $VERSION_PANGO)/pango-${VERSION_PANGO}.tar.xz | tar xJC ${DEPS}/pango --strip-components=1 cd ${DEPS}/pango -# Disable utils, examples, tests and tools -sed -i'.bak' "/subdir('utils')/{N;N;N;d;}" meson.build +# Disable utils and tools +sed -i'.bak' "/subdir('utils')/{N;d;}" meson.build meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - -Dgtk_doc=false -Dintrospection=disabled -Dfontconfig=enabled + -Ddocumentation=false -Dbuild-testsuite=false -Dbuild-examples=false -Dintrospection=disabled -Dfontconfig=enabled meson install -C _build --tag devel mkdir ${DEPS}/rsvg $CURL https://download.gnome.org/sources/librsvg/$(without_patch $VERSION_RSVG)/librsvg-${VERSION_RSVG}.tar.xz | tar xJC ${DEPS}/rsvg --strip-components=1 cd ${DEPS}/rsvg -# Add missing pkg-config deps -sed -i'.bak' "/^Requires:/s/$/ cairo-gobject pangocairo libxml-2.0/" librsvg.pc.in -# LTO optimization does not work for staticlib+rlib compilation -sed -i'.bak' "/crate-type = /s/, \"rlib\"//" librsvg-c/Cargo.toml +# Disallow GIF and WebP embedded in SVG images +sed -i'.bak' "/image = /s/, \"gif\", \"webp\"//" rsvg/Cargo.toml # We build Cairo with `-Dzlib=disabled`, which implicitly disables the PDF/PostScript surface backends sed -i'.bak' "/cairo-rs = /s/, \"pdf\", \"ps\"//" {librsvg-c,rsvg}/Cargo.toml -# Remove the --static flag from the PKG_CONFIG env since Rust does not -# support that. Build with PKG_CONFIG_ALL_STATIC=1 instead. -PKG_CONFIG=${PKG_CONFIG/ --static/} ./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ - --disable-introspection --disable-pixbuf-loader ${DARWIN:+--disable-Bsymbolic} # Skip build of rsvg-convert -PKG_CONFIG_ALL_STATIC=1 make install-strip bin_SCRIPTS= +sed -i'.bak' "/subdir('rsvg_convert')/d" meson.build +# https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/1066#note_2356762 +sed -i'.bak' "/^if host_system in \['windows'/s/, 'linux'//" meson.build +# [PATCH] text: verify pango/fontconfig found a suitable font +$CURL https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/1106.patch | patch -p1 +# Regenerate the lockfile after making the above changes +cargo update --workspace +# Remove the --static flag from the PKG_CONFIG env since Rust does not +# parse that correctly. +PKG_CONFIG=${PKG_CONFIG/ --static/} meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ + -Dintrospection=disabled -Dpixbuf{,-loader}=disabled -Ddocs=disabled -Dvala=disabled -Dtests=false \ + ${RUST_TARGET:+-Dtriplet=$RUST_TARGET} +meson install -C _build --tag devel mkdir ${DEPS}/cgif -$CURL https://github.com/dloebl/cgif/archive/V${VERSION_CGIF}.tar.gz | tar xzC ${DEPS}/cgif --strip-components=1 +$CURL https://github.com/dloebl/cgif/archive/v${VERSION_CGIF}.tar.gz | tar xzC ${DEPS}/cgif --strip-components=1 cd ${DEPS}/cgif CFLAGS="${CFLAGS} -O3" meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \ - -Dtests=false + -Dexamples=false -Dtests=false meson install -C _build --tag devel mkdir ${DEPS}/vips -$CURL https://github.com/libvips/libvips/releases/download/v${VERSION_VIPS}/vips-$(without_prerelease $VERSION_VIPS).tar.xz | tar xJC ${DEPS}/vips --strip-components=1 +$CURL https://github.com/libvips/libvips/releases/download/v${VERSION_VIPS}/vips-${VERSION_VIPS}.tar.xz | tar xJC ${DEPS}/vips --strip-components=1 cd ${DEPS}/vips -# Link libvips.so.42 statically into libvips-cpp.so.42 +# Use version number in SONAME +$CURL https://gist.githubusercontent.com/lovell/313a6901e9db1bf285f2a1f1180499e4/raw/3988223c7dfa4d22745d9392034b0117abef1446/libvips-cpp-soversion.patch | patch -p1 +# Disable HBR support in heifsave +$CURL https://github.com/libvips/build-win64-mxe/raw/v${VERSION_VIPS}/build/patches/vips-8-heifsave-disable-hbr-support.patch | patch -p1 +# [PATCH] Meson: improve reliability of function checks +$CURL https://gist.github.com/kleisauke/85912d7fd8b779f2b60690de9b7c565a/raw/88ae86382f24b1aa8c7b8908edafa44d1e503b2b/libvips-improve-reliability-of-function-checks.patch | patch -p1 +# [PATCH] text: prevent use of rgba subpixel anti-aliasing +$CURL https://gist.githubusercontent.com/lovell/97ac1fc68aa25dd7c11b6c148847d480/raw/05b97d1bf16902b7fa9575df72457ed65be71916/gistfile1.txt | patch -p1 +# Link libvips.so statically into libvips-cpp.so sed -i'.bak' "s/library('vips'/static_&/" libvips/meson.build sed -i'.bak' "/version: library_version/{N;d;}" libvips/meson.build if [ "$LINUX" = true ]; then - # Ensure libvips-cpp.so.42 is linked with -z nodelete + # Ensure libvips-cpp.so is linked with -z nodelete sed -i'.bak' "/gnu_symbol_visibility: 'hidden',/a link_args: nodelete_link_args," cplusplus/meson.build # Ensure symbols from external libs (except for libglib-2.0.a and libgobject-2.0.a) are not exposed EXCLUDE_LIBS=$(find ${TARGET}/lib -maxdepth 1 -name '*.a' ! -name 'libglib-2.0.a' ! -name 'libgobject-2.0.a' -printf "-Wl,--exclude-libs=%f ") @@ -543,29 +457,26 @@ printf "{\n\ \"fontconfig\": \"${VERSION_FONTCONFIG}\",\n\ \"freetype\": \"${VERSION_FREETYPE}\",\n\ \"fribidi\": \"${VERSION_FRIBIDI}\",\n\ - \"gdkpixbuf\": \"${VERSION_GDKPIXBUF}\",\n\ \"glib\": \"${VERSION_GLIB}\",\n\ \"harfbuzz\": \"${VERSION_HARFBUZZ}\",\n\ \"heif\": \"${VERSION_HEIF}\",\n\ \"highway\": \"${VERSION_HWY}\",\n\ \"imagequant\": \"${VERSION_IMAGEQUANT}\",\n\ - \"lcms\": \"${VERSION_LCMS2}\",\n\ + \"lcms\": \"${VERSION_LCMS}\",\n\ \"mozjpeg\": \"${VERSION_MOZJPEG}\",\n\ \"pango\": \"${VERSION_PANGO}\",\n\ \"pixman\": \"${VERSION_PIXMAN}\",\n\ - \"png\": \"${VERSION_PNG16}\",\n\ + \"png\": \"${VERSION_PNG}\",\n\ \"proxy-libintl\": \"${VERSION_PROXY_LIBINTL}\",\n\ \"rsvg\": \"${VERSION_RSVG}\",\n\ \"spng\": \"${VERSION_SPNG}\",\n\ \"tiff\": \"${VERSION_TIFF}\",\n\ \"vips\": \"${VERSION_VIPS}\",\n\ \"webp\": \"${VERSION_WEBP}\",\n\ - \"xml\": \"${VERSION_XML2}\",\n\ + \"xml2\": \"${VERSION_XML2}\",\n\ \"zlib-ng\": \"${VERSION_ZLIB_NG}\"\n\ }" >versions.json -printf "\"${PLATFORM}\"" >platform.json - # Add third-party notices $CURL -O https://raw.githubusercontent.com/lovell/sharp-libvips/main/THIRD-PARTY-NOTICES.md @@ -573,11 +484,11 @@ $CURL -O https://raw.githubusercontent.com/lovell/sharp-libvips/main/THIRD-PARTY ls -al lib rm -rf lib mv lib-filtered lib -tar chzf ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \ +tar chzf ${PACKAGE}/sharp-libvips-${PLATFORM}.tar.gz \ include \ lib \ *.json \ THIRD-PARTY-NOTICES.md # Allow tarballs to be read outside container -chmod 644 ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.* +chmod 644 ${PACKAGE}/sharp-libvips-${PLATFORM}.tar.* diff --git a/build/wasm.sh b/build/wasm.sh index 5cb4f201..f4a72861 100755 --- a/build/wasm.sh +++ b/build/wasm.sh @@ -1,18 +1,8 @@ #!/usr/bin/env bash set -e -if [ $# -lt 1 ]; then - echo - echo "Usage: $0 VERSION_VIPS [VERSION_WASM_VIPS]" - echo "Use wasm-vips to build wasm32 static libraries for libvips and its dependencies" - echo - echo "Please specify the libvips VERSION_VIPS, e.g. 8.15.0" - echo "Optionally provide a specific VERSION_WASM_VIPS commit, e.g. abc1234" - echo - exit 1 -fi -VERSION_VIPS="$1" -VERSION_WASM_VIPS="${2:-HEAD}" +source ./versions.properties +VERSION_WASM_VIPS="${1:-HEAD}" DIR="wasm-vips-${VERSION_WASM_VIPS}" TAG="wasm-vips:${VERSION_WASM_VIPS}" @@ -34,17 +24,20 @@ if [ "$VERSION_VIPS" != "$VERSION_VIPS_UPSTREAM" ]; then fi # Create container with emscripten -if [ -z "$(docker images -q ${TAG})" ]; then - pushd "${DIR}" - docker build -t "${TAG}" . - popd -fi +pushd "${DIR}" +docker build -t "${TAG}" . +popd # Build libvips and dependencies as static Wasm libraries via emscripten if [ ! -d "$DIR/build/target/lib" ]; then docker run --rm -v "$PWD/${DIR}":/src "${TAG}" -c "./build.sh --disable-bindings --disable-modules --disable-jxl --enable-libvips-cpp" +else + echo "Skipping build: found existing files in $DIR/build/target" fi -# Copy only the files we need -cp -r --no-preserve=mode,ownership ${DIR}/build/target/{include,lib,versions.json} ../npm/dev-wasm32 -rm -r ../npm/dev-wasm32/lib/cmake +echo "Creating tarball" +tar chzf \ + ../sharp-libvips-dev-wasm32.tar.gz \ + --directory="${DIR}/build/target" \ + --exclude="cmake/*" \ + {include,lib,versions.json} diff --git a/build/win.sh b/build/win.sh index cb6c85a4..56126c6e 100755 --- a/build/win.sh +++ b/build/win.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash set -e +# Dependency version numbers +source /packaging/versions.properties + VERSION_VIPS_SHORT=${VERSION_VIPS%.[[:digit:]]*} # Common options for curl @@ -33,14 +36,11 @@ cd /vips/vips-dev-${VERSION_VIPS_SHORT} rm bin/libvips-cpp-42.dll cp bin/*.dll lib/ -# Create platform.json -printf "\"${PLATFORM}\"" >platform.json - # Add third-party notices $CURL -O https://raw.githubusercontent.com/lovell/sharp-libvips/main/THIRD-PARTY-NOTICES.md echo "Creating tarball" -tar czf /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \ +tar czf /packaging/sharp-libvips-${PLATFORM}.tar.gz \ include \ lib/glib-2.0 \ lib/libvips.lib \ @@ -49,7 +49,7 @@ tar czf /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \ THIRD-PARTY-NOTICES.md # Allow tarballs to be read outside container -chmod 644 /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.* +chmod 644 /packaging/sharp-libvips-${PLATFORM}.tar.* # Remove working directories rm -rf lib include *.json THIRD-PARTY-NOTICES.md diff --git a/check-latest-versions.sh b/check-latest-versions.sh new file mode 100755 index 00000000..321aebcc --- /dev/null +++ b/check-latest-versions.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +set -e + +# Dependency version numbers +source ./versions.properties + +# Common options for curl +CURL="curl --silent --location --retry 3 --retry-max-time 30" + +# Check for newer versions +ALL_AT_VERSION_LATEST=true +version_latest() { + VERSION_SELECTOR="stable_versions" + if [[ "$4" == *"unstable"* ]]; then + VERSION_SELECTOR="versions" + fi + if [[ "$3" == *"/"* ]]; then + VERSION_LATEST=$(git -c 'versionsort.suffix=-' ls-remote --tags --refs --sort='v:refname' https://github.com/$3.git | awk -F'/' 'END{print $3}' | tr -d 'v') + else + VERSION_LATEST=$($CURL "https://release-monitoring.org/api/v2/versions/?project_id=$3" | jq -j ".$VERSION_SELECTOR[0]" | tr '_' '.') + fi + if [ "$VERSION_LATEST" != "$2" ]; then + ALL_AT_VERSION_LATEST=false + echo "$1 version $2 has been superseded by $VERSION_LATEST" + fi +} + +version_latest "aom" "$VERSION_AOM" "17628" +version_latest "archive" "$VERSION_ARCHIVE" "1558" +version_latest "cairo" "$VERSION_CAIRO" "247" +version_latest "cgif" "$VERSION_CGIF" "dloebl/cgif" +version_latest "exif" "$VERSION_EXIF" "1607" +version_latest "expat" "$VERSION_EXPAT" "770" +version_latest "ffi" "$VERSION_FFI" "1611" +version_latest "fontconfig" "$VERSION_FONTCONFIG" "827" +version_latest "freetype" "$VERSION_FREETYPE" "854" +version_latest "fribidi" "$VERSION_FRIBIDI" "857" +version_latest "glib" "$VERSION_GLIB" "10024" "unstable" +version_latest "harfbuzz" "$VERSION_HARFBUZZ" "1299" +version_latest "heif" "$VERSION_HEIF" "64439" +version_latest "highway" "$VERSION_HWY" "205809" +version_latest "lcms" "$VERSION_LCMS" "9815" +version_latest "mozjpeg" "$VERSION_MOZJPEG" "mozilla/mozjpeg" +version_latest "pango" "$VERSION_PANGO" "11783" "unstable" +version_latest "pixman" "$VERSION_PIXMAN" "3648" +version_latest "png" "$VERSION_PNG" "1705" +version_latest "proxy-libintl" "$VERSION_PROXY_LIBINTL" "frida/proxy-libintl" +version_latest "rsvg" "$VERSION_RSVG" "5420" "unstable" +version_latest "spng" "$VERSION_SPNG" "24289" +version_latest "tiff" "$VERSION_TIFF" "1738" +version_latest "vips" "$VERSION_VIPS" "5097" +version_latest "webp" "$VERSION_WEBP" "1761" +version_latest "xml2" "$VERSION_XML2" "1783" +version_latest "zlib-ng" "$VERSION_ZLIB_NG" "115592" + +if [ "$ALL_AT_VERSION_LATEST" = "false" ]; then exit 1; fi diff --git a/integrity.sh b/integrity.sh deleted file mode 100755 index 70543c14..00000000 --- a/integrity.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Calculate sha512-based checksum -integrity() { - CHECKSUM="sha512-$(shasum -a 512 $1 | cut -f1 -d' ' | xxd -r -p | base64 | tr -d '\n')" - printf "$CHECKSUM $1\n" - printf "$CHECKSUM" > $1.integrity -} - -for tarball in *.tar.gz; do - integrity $tarball -done diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json index f64dae8d..013438ca 100644 --- a/npm/darwin-arm64/package.json +++ b/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-darwin-arm64", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on macOS 64-bit ARM", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,12 +27,6 @@ "./package": "./package.json", "./versions": "./versions.json" }, - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", - "macos": ">=11" - }, "os": [ "darwin" ], diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json index a26fd817..7a90bb6b 100644 --- a/npm/darwin-x64/package.json +++ b/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-darwin-x64", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on macOS x64", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,12 +27,6 @@ "./package": "./package.json", "./versions": "./versions.json" }, - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", - "macos": ">=10.13" - }, "os": [ "darwin" ], diff --git a/npm/dev-wasm32/THIRD-PARTY-NOTICES.md b/npm/dev-wasm32/THIRD-PARTY-NOTICES.md index b5ad47c8..c42babb8 100644 --- a/npm/dev-wasm32/THIRD-PARTY-NOTICES.md +++ b/npm/dev-wasm32/THIRD-PARTY-NOTICES.md @@ -22,7 +22,7 @@ used under the terms of the following licences: | libtiff | [libtiff License](https://gitlab.com/libtiff/libtiff/blob/master/LICENSE.md) (BSD-like) | | libvips | LGPLv3 | | libwebp | New BSD License | -| resvg | MPL-2.0 License | +| resvg | MIT Licence | | zlib-ng | [zlib Licence](https://github.com/zlib-ng/zlib-ng/blob/develop/LICENSE.md) | Use of libraries under the terms of the LGPLv3 is via the diff --git a/npm/dev-wasm32/package.json b/npm/dev-wasm32/package.json index be68c190..87a70d5f 100644 --- a/npm/dev-wasm32/package.json +++ b/npm/dev-wasm32/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-dev-wasm32", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Header files and static wasm32 libraries for libvips and dependencies to build sharp as wasm32", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", diff --git a/npm/dev/package.json b/npm/dev/package.json index a493295d..65df8ff6 100644 --- a/npm/dev/package.json +++ b/npm/dev/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-dev", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Header files and C++ sources for libvips and dependencies required when compiling sharp from source", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", diff --git a/npm/linux-arm/package.json b/npm/linux-arm/package.json index 6bb39c5d..6e69342b 100644 --- a/npm/linux-arm/package.json +++ b/npm/linux-arm/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-linux-arm", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) 32-bit ARM", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,11 +27,8 @@ "./versions": "./versions.json" }, "type": "commonjs", - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", - "glibc": ">=2.28" + "config": { + "glibc": ">=2.31" }, "os": [ "linux" diff --git a/npm/linux-arm64/package.json b/npm/linux-arm64/package.json index 06ad6ff7..ba4f7283 100644 --- a/npm/linux-arm64/package.json +++ b/npm/linux-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-linux-arm64", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) 64-bit ARM", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,10 +27,7 @@ "./package": "./package.json", "./versions": "./versions.json" }, - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", + "config": { "glibc": ">=2.26" }, "os": [ diff --git a/npm/linux-ppc64/package.json b/npm/linux-ppc64/package.json new file mode 100644 index 00000000..5fff710a --- /dev/null +++ b/npm/linux-ppc64/package.json @@ -0,0 +1,42 @@ +{ + "name": "@img/sharp-libvips-linux-ppc64", + "version": "1.2.0-rc.3", + "description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) ppc64le", + "author": "Lovell Fuller ", + "homepage": "https://sharp.pixelplumbing.com", + "repository": { + "type": "git", + "url": "git+https://github.com/lovell/sharp-libvips.git", + "directory": "npm/linux-ppc64" + }, + "license": "LGPL-3.0-or-later", + "funding": { + "url": "https://opencollective.com/libvips" + }, + "preferUnplugged": true, + "publishConfig": { + "access": "public" + }, + "files": [ + "lib", + "versions.json" + ], + "exports": { + "./lib": "./lib/index.js", + "./package": "./package.json", + "./versions": "./versions.json" + }, + "type": "commonjs", + "config": { + "glibc": ">=2.31" + }, + "os": [ + "linux" + ], + "libc": [ + "glibc" + ], + "cpu": [ + "ppc64" + ] +} diff --git a/npm/linux-riscv64/package.json b/npm/linux-riscv64/package.json new file mode 100644 index 00000000..d04e462a --- /dev/null +++ b/npm/linux-riscv64/package.json @@ -0,0 +1,42 @@ +{ + "name": "@img/sharp-libvips-linux-riscv64", + "version": "1.2.0-rc.3", + "description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) RISC-V 64-bit", + "author": "Lovell Fuller ", + "homepage": "https://sharp.pixelplumbing.com", + "repository": { + "type": "git", + "url": "git+https://github.com/lovell/sharp-libvips.git", + "directory": "npm/linux-riscv64" + }, + "license": "LGPL-3.0-or-later", + "funding": { + "url": "https://opencollective.com/libvips" + }, + "preferUnplugged": true, + "publishConfig": { + "access": "public" + }, + "files": [ + "lib", + "versions.json" + ], + "exports": { + "./lib": "./lib/index.js", + "./package": "./package.json", + "./versions": "./versions.json" + }, + "type": "commonjs", + "config": { + "glibc": ">=2.41" + }, + "os": [ + "linux" + ], + "libc": [ + "glibc" + ], + "cpu": [ + "riscv64" + ] +} diff --git a/npm/linux-s390x/package.json b/npm/linux-s390x/package.json index cbb8ec1c..a3e07c5b 100644 --- a/npm/linux-s390x/package.json +++ b/npm/linux-s390x/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-linux-s390x", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) s390x", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,11 +27,8 @@ "./versions": "./versions.json" }, "type": "commonjs", - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", - "glibc": ">=2.28" + "config": { + "glibc": ">=2.31" }, "os": [ "linux" diff --git a/npm/linux-x64/package.json b/npm/linux-x64/package.json index 0d317c81..6a2caea8 100644 --- a/npm/linux-x64/package.json +++ b/npm/linux-x64/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-linux-x64", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Linux (glibc) x64", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,10 +27,7 @@ "./package": "./package.json", "./versions": "./versions.json" }, - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", + "config": { "glibc": ">=2.26" }, "os": [ diff --git a/npm/linuxmusl-arm64/package.json b/npm/linuxmusl-arm64/package.json index 4c743b10..95d601af 100644 --- a/npm/linuxmusl-arm64/package.json +++ b/npm/linuxmusl-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-linuxmusl-arm64", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Linux (musl) 64-bit ARM", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,10 +27,7 @@ "./package": "./package.json", "./versions": "./versions.json" }, - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", + "config": { "musl": ">=1.2.2" }, "os": [ diff --git a/npm/linuxmusl-x64/package.json b/npm/linuxmusl-x64/package.json index 62a5cead..f28c3654 100644 --- a/npm/linuxmusl-x64/package.json +++ b/npm/linuxmusl-x64/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-linuxmusl-x64", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Linux (musl) x64", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", @@ -27,10 +27,7 @@ "./package": "./package.json", "./versions": "./versions.json" }, - "engines": { - "npm": ">=9.6.5", - "yarn": ">=3.2.0", - "pnpm": ">=7.1.0", + "config": { "musl": ">=1.2.2" }, "os": [ diff --git a/npm/package.json b/npm/package.json index 68e97dc8..af9ed0e2 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips", - "version": "1.0.1", + "version": "1.2.0-rc.3", "private": "true", "workspaces": [ "dev", @@ -11,8 +11,11 @@ "linux-arm64", "linuxmusl-arm64", "linuxmusl-x64", + "linux-ppc64", + "linux-riscv64", "linux-s390x", "linux-x64", + "win32-arm64", "win32-ia32", "win32-x64" ] diff --git a/npm/win32-arm64/package.json b/npm/win32-arm64/package.json new file mode 100644 index 00000000..c3b61e4a --- /dev/null +++ b/npm/win32-arm64/package.json @@ -0,0 +1,30 @@ +{ + "name": "@img/sharp-libvips-win32-arm64", + "version": "1.2.0-rc.3", + "description": "Prebuilt libvips and dependencies for use with sharp on Windows 64-bit ARM", + "author": "Lovell Fuller ", + "homepage": "https://sharp.pixelplumbing.com", + "repository": { + "type": "git", + "url": "git+https://github.com/lovell/sharp-libvips.git", + "directory": "npm/win32-arm64" + }, + "license": "LGPL-3.0-or-later", + "funding": { + "url": "https://opencollective.com/libvips" + }, + "preferUnplugged": true, + "publishConfig": { + "access": "public" + }, + "files": [ + "lib", + "versions.json" + ], + "type": "commonjs", + "exports": { + "./lib": "./lib/index.js", + "./package": "./package.json", + "./versions": "./versions.json" + } +} diff --git a/npm/win32-ia32/package.json b/npm/win32-ia32/package.json index 835b70c4..24e47d71 100644 --- a/npm/win32-ia32/package.json +++ b/npm/win32-ia32/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-win32-ia32", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Windows x86", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", diff --git a/npm/win32-x64/package.json b/npm/win32-x64/package.json index 6a75b113..e8e7b8a5 100644 --- a/npm/win32-x64/package.json +++ b/npm/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips-win32-x64", - "version": "1.0.1", + "version": "1.2.0-rc.3", "description": "Prebuilt libvips and dependencies for use with sharp on Windows x64", "author": "Lovell Fuller ", "homepage": "https://sharp.pixelplumbing.com", diff --git a/platforms/darwin-arm64v8/Toolchain.cmake b/platforms/darwin-arm64v8/Toolchain.cmake index 713510f5..7f60fa71 100644 --- a/platforms/darwin-arm64v8/Toolchain.cmake +++ b/platforms/darwin-arm64v8/Toolchain.cmake @@ -1,11 +1,5 @@ -set(CMAKE_SYSTEM_NAME "Darwin") -set(CMAKE_SYSTEM_PROCESSOR "arm64") -set(CMAKE_OSX_ARCHITECTURES "arm64") - SET(CMAKE_C_COMPILER clang) -set(CMAKE_C_COMPILER_ARG1 "-target arm64-apple-macos11") SET(CMAKE_CXX_COMPILER clang++) -set(CMAKE_CXX_COMPILER_ARG1 "-target arm64-apple-macos11") # macOS 11 Big Sur is the first version to support ARM-based macs SET(CMAKE_OSX_DEPLOYMENT_TARGET 11.0) diff --git a/platforms/darwin-arm64v8/meson.ini b/platforms/darwin-arm64v8/meson.ini index de108582..527b0705 100644 --- a/platforms/darwin-arm64v8/meson.ini +++ b/platforms/darwin-arm64v8/meson.ini @@ -1,15 +1,9 @@ -[host_machine] -system = 'darwin' -cpu_family = 'aarch64' -cpu = 'arm64' -endian = 'little' - [binaries] -c = 'clang' -cpp = 'clang++' -objc = 'clang' -objcpp = 'clang++' strip = ['strip', '-x'] [built-in options] +datadir = '/usr/local/share' +localedir = '/usr/local/share/locale' +sysconfdir = '/usr/local/etc' +localstatedir = '/usr/local/var' wrap_mode = 'nofallback' diff --git a/platforms/darwin-x64/Toolchain.cmake b/platforms/darwin-x64/Toolchain.cmake index 08be8ab0..e1c513f7 100644 --- a/platforms/darwin-x64/Toolchain.cmake +++ b/platforms/darwin-x64/Toolchain.cmake @@ -2,7 +2,7 @@ SET(CMAKE_C_COMPILER clang) SET(CMAKE_CXX_COMPILER clang++) # Earliest supported version of macOS -SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.13) +SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/platforms/darwin-x64/meson.ini b/platforms/darwin-x64/meson.ini index e7e7f1cb..527b0705 100644 --- a/platforms/darwin-x64/meson.ini +++ b/platforms/darwin-x64/meson.ini @@ -2,4 +2,8 @@ strip = ['strip', '-x'] [built-in options] +datadir = '/usr/local/share' +localedir = '/usr/local/share/locale' +sysconfdir = '/usr/local/etc' +localstatedir = '/usr/local/var' wrap_mode = 'nofallback' diff --git a/platforms/linux-arm64v8/Dockerfile b/platforms/linux-arm64v8/Dockerfile index 5d845107..10edbb50 100644 --- a/platforms/linux-arm64v8/Dockerfile +++ b/platforms/linux-arm64v8/Dockerfile @@ -28,6 +28,7 @@ RUN \ gperf \ jq \ make \ + openssl-devel \ patch \ pkgconfig \ python3 \ @@ -48,8 +49,9 @@ RUN \ --profile minimal \ --default-host aarch64-unknown-linux-gnu \ && \ + cargo install cargo-c --locked && \ ln -s /usr/bin/cmake3 /usr/bin/cmake && \ - pip3 install meson ninja packaging + pip3 install meson==1.7.2 ninja packaging tomli # Compiler settings ENV \ diff --git a/platforms/linux-arm64v8/meson.ini b/platforms/linux-arm64v8/meson.ini index 981d25d0..2f9d2ad0 100644 --- a/platforms/linux-arm64v8/meson.ini +++ b/platforms/linux-arm64v8/meson.ini @@ -1,7 +1,10 @@ [binaries] strip = 'strip' -pkg-config = ['pkg-config', '--static'] [built-in options] libdir = 'lib' +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' wrap_mode = 'nofallback' diff --git a/platforms/linux-armv6/Dockerfile b/platforms/linux-armv6/Dockerfile index a28d057d..05d32e64 100644 --- a/platforms/linux-armv6/Dockerfile +++ b/platforms/linux-armv6/Dockerfile @@ -1,13 +1,13 @@ FROM debian:buster LABEL maintainer="Lovell Fuller " -# Create Debian 10 (glibc 2.28) container suitable for cross-compiling Linux ARMv6 binaries +# Create Debian 11 (glibc 2.31) container suitable for cross-compiling Linux ARMv6 binaries # Path settings ENV \ RUSTUP_HOME="/usr/local/rustup" \ CARGO_HOME="/usr/local/cargo" \ - PATH="/usr/local/cargo/bin:/root/tools/x64-gcc-6.5.0/arm-rpi-linux-gnueabihf/bin:$PATH" + PATH="/usr/local/cargo/bin:/root/tools/x64-gcc-10.3.0-glibc-2.28/arm-rpi-linux-gnueabihf/bin:$PATH" # Build dependencies RUN \ @@ -23,6 +23,7 @@ RUN \ git \ gperf \ jq \ + libssl-dev \ libtool \ ninja-build \ pkg-config \ @@ -36,7 +37,8 @@ RUN \ --profile minimal \ && \ rustup target add arm-unknown-linux-gnueabihf && \ - pip3 install meson + cargo install cargo-c --locked && \ + pip3 install meson==1.7.2 tomli # Compiler settings ENV \ diff --git a/platforms/linux-armv6/meson.ini b/platforms/linux-armv6/meson.ini index d8583a7b..1371dea5 100644 --- a/platforms/linux-armv6/meson.ini +++ b/platforms/linux-armv6/meson.ini @@ -12,8 +12,17 @@ nm = 'arm-rpi-linux-gnueabihf-gcc-nm' ld = 'arm-rpi-linux-gnueabihf-gcc-ld' strip = 'arm-rpi-linux-gnueabihf-strip' ranlib = 'arm-rpi-linux-gnueabihf-gcc-ranlib' -pkg-config = ['arm-linux-gnueabihf-pkg-config', '--static'] + +[properties] +# https://docs.gtk.org/glib/cross-compiling.html#cross-properties +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true [built-in options] libdir = 'lib' +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' wrap_mode = 'nofallback' diff --git a/platforms/linux-armv7/Toolchain.cmake b/platforms/linux-armv7/Toolchain.cmake deleted file mode 100644 index 2acdf704..00000000 --- a/platforms/linux-armv7/Toolchain.cmake +++ /dev/null @@ -1,13 +0,0 @@ -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_VERSION 1) -set(CMAKE_SYSTEM_PROCESSOR armv7-a) - -SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) -SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) -SET(CMAKE_AR arm-linux-gnueabihf-gcc-ar) -SET(CMAKE_STRIP arm-linux-gnueabihf-gcc-strip) -SET(CMAKE_RANLIB arm-linux-gnueabihf-gcc-ranlib) - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/platforms/linux-armv7/meson.ini b/platforms/linux-armv7/meson.ini deleted file mode 100644 index ab9c086a..00000000 --- a/platforms/linux-armv7/meson.ini +++ /dev/null @@ -1,19 +0,0 @@ -[host_machine] -system = 'linux' -cpu_family = 'arm' -cpu = 'armv7-a' -endian = 'little' - -[binaries] -c = 'arm-linux-gnueabihf-gcc' -cpp = 'arm-linux-gnueabihf-g++' -ar = 'arm-linux-gnueabihf-gcc-ar' -nm = 'arm-linux-gnueabihf-gcc-nm' -ld = 'arm-linux-gnueabihf-gcc-ld' -strip = 'arm-linux-gnueabihf-strip' -ranlib = 'arm-linux-gnueabihf-gcc-ranlib' -pkg-config = ['arm-linux-gnueabihf-pkg-config', '--static'] - -[built-in options] -libdir = 'lib' -wrap_mode = 'nofallback' diff --git a/platforms/linux-armv7/Dockerfile b/platforms/linux-ppc64le/Dockerfile similarity index 50% rename from platforms/linux-armv7/Dockerfile rename to platforms/linux-ppc64le/Dockerfile index f5c3b1e0..af4f9ed3 100644 --- a/platforms/linux-armv7/Dockerfile +++ b/platforms/linux-ppc64le/Dockerfile @@ -1,7 +1,7 @@ -FROM debian:buster +FROM debian:bullseye LABEL maintainer="Lovell Fuller " -# Create Debian 10 (glibc 2.28) container suitable for cross-compiling Linux ARMv7-A binaries +# Create Debian 11 (glibc 2.31) container suitable for cross-compiling Linux ppc64le binaries # Path settings ENV \ @@ -13,17 +13,17 @@ ENV \ RUN \ apt-get update && \ apt-get install -y curl && \ - dpkg --add-architecture armhf && \ - apt-get update && \ + dpkg --add-architecture ppc64el && \ apt-get install -y \ autoconf \ autopoint \ cmake \ - crossbuild-essential-armhf \ + crossbuild-essential-ppc64el \ gettext \ git \ gperf \ jq \ + libssl-dev \ libtool \ ninja-build \ pkg-config \ @@ -34,16 +34,21 @@ RUN \ --no-modify-path \ --profile minimal \ && \ - rustup target add arm-unknown-linux-gnueabihf && \ - pip3 install meson + rustup target add powerpc64le-unknown-linux-gnu && \ + cargo install cargo-c --locked && \ + pip3 install meson==1.7.2 tomli + +# Handy for debugging the compiled targets in Highway (hwy_list_targets) +#RUN apt-get install -y qemu-user-static +#ENV QEMU_LD_PREFIX="/usr/powerpc64le-linux-gnu" # Compiler settings ENV \ - PKG_CONFIG="arm-linux-gnueabihf-pkg-config --static" \ - PLATFORM="linux-armv7" \ - CHOST="arm-linux-gnueabihf" \ - RUST_TARGET="arm-unknown-linux-gnueabihf" \ - FLAGS="-marm -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard" \ + PKG_CONFIG="powerpc64le-linux-gnu-pkg-config --static" \ + PLATFORM="linux-ppc64le" \ + CHOST="powerpc64le-linux-gnu" \ + RUST_TARGET="powerpc64le-unknown-linux-gnu" \ + FLAGS="" \ MESON="--cross-file=/root/meson.ini" COPY Toolchain.cmake /root/ diff --git a/platforms/linux-ppc64le/Toolchain.cmake b/platforms/linux-ppc64le/Toolchain.cmake new file mode 100644 index 00000000..3440b0be --- /dev/null +++ b/platforms/linux-ppc64le/Toolchain.cmake @@ -0,0 +1,15 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR ppc64le) + +SET(CMAKE_C_COMPILER powerpc64le-linux-gnu-gcc) +SET(CMAKE_CXX_COMPILER powerpc64le-linux-gnu-g++) +SET(CMAKE_AR powerpc64le-linux-gnu-gcc-ar) +SET(CMAKE_STRIP powerpc64le-linux-gnu-gcc-strip) +SET(CMAKE_RANLIB powerpc64le-linux-gnu-gcc-ranlib) + +#SET(CMAKE_CROSSCOMPILING_EMULATOR qemu-ppc64le-static) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/platforms/linux-ppc64le/meson.ini b/platforms/linux-ppc64le/meson.ini new file mode 100644 index 00000000..fcb2c1a9 --- /dev/null +++ b/platforms/linux-ppc64le/meson.ini @@ -0,0 +1,29 @@ +[host_machine] +system = 'linux' +cpu_family = 'ppc64' +cpu = 'powerpc64le' +endian = 'little' + +[binaries] +c = 'powerpc64le-linux-gnu-gcc' +cpp = 'powerpc64le-linux-gnu-g++' +ar = 'powerpc64le-linux-gnu-gcc-ar' +nm = 'powerpc64le-linux-gnu-gcc-nm' +ld = 'powerpc64le-linux-gnu-gcc-ld' +strip = 'powerpc64le-linux-gnu-strip' +ranlib = 'powerpc64le-linux-gnu-gcc-ranlib' +#exe_wrapper = 'qemu-ppc64le-static' + +[properties] +# https://docs.gtk.org/glib/cross-compiling.html#cross-properties +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true + +[built-in options] +libdir = 'lib' +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' +wrap_mode = 'nofallback' diff --git a/platforms/linux-riscv64/Dockerfile b/platforms/linux-riscv64/Dockerfile new file mode 100644 index 00000000..adcce596 --- /dev/null +++ b/platforms/linux-riscv64/Dockerfile @@ -0,0 +1,54 @@ +FROM debian:trixie +LABEL maintainer="Lovell Fuller " + +# Create Debian 13 (glibc 2.41) container suitable for cross-compiling Linux RISC-V 64-bit binaries + +# Path settings +ENV \ + RUSTUP_HOME="/usr/local/rustup" \ + CARGO_HOME="/usr/local/cargo" \ + PATH="/usr/local/cargo/bin:/root/.local/bin:$PATH" + +# Build dependencies +RUN \ + apt-get update && \ + apt-get install -y curl && \ + dpkg --add-architecture riscv64 && \ + apt-get update && \ + apt-get install -y \ + autoconf \ + autopoint \ + cmake \ + crossbuild-essential-riscv64 \ + gettext \ + git \ + gperf \ + jq \ + libssl-dev \ + libtool \ + ninja-build \ + pipx \ + pkgconf \ + pkgconf:riscv64 \ + python3-tomli \ + && \ + curl https://sh.rustup.rs -sSf | sh -s -- -y \ + --no-modify-path \ + --profile minimal \ + && \ + rustup target add riscv64gc-unknown-linux-gnu && \ + cargo install cargo-c --locked && \ + pipx install meson==1.7.2 + +# Compiler settings +ENV \ + PKG_CONFIG="riscv64-linux-gnu-pkg-config --static" \ + PLATFORM="linux-riscv64" \ + CHOST="riscv64-linux-gnu" \ + RUST_TARGET="riscv64gc-unknown-linux-gnu" \ + FLAGS="-march=rv64gc" \ + WITHOUT_HIGHWAY="true" \ + MESON="--cross-file=/root/meson.ini" + +COPY Toolchain.cmake /root/ +COPY meson.ini /root/ diff --git a/platforms/linux-riscv64/Toolchain.cmake b/platforms/linux-riscv64/Toolchain.cmake new file mode 100644 index 00000000..fcf97b2d --- /dev/null +++ b/platforms/linux-riscv64/Toolchain.cmake @@ -0,0 +1,13 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR riscv64) + +SET(CMAKE_C_COMPILER riscv64-linux-gnu-gcc) +SET(CMAKE_CXX_COMPILER riscv64-linux-gnu-g++) +SET(CMAKE_AR riscv64-linux-gnu-gcc-ar) +SET(CMAKE_STRIP riscv64-linux-gnu-gcc-strip) +SET(CMAKE_RANLIB riscv64-linux-gnu-gcc-ranlib) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/platforms/linux-riscv64/meson.ini b/platforms/linux-riscv64/meson.ini new file mode 100644 index 00000000..44df5198 --- /dev/null +++ b/platforms/linux-riscv64/meson.ini @@ -0,0 +1,28 @@ +[host_machine] +system = 'linux' +cpu_family = 'riscv64' +cpu = 'riscv64' +endian = 'little' + +[binaries] +c = 'riscv64-linux-gnu-gcc' +cpp = 'riscv64-linux-gnu-g++' +ar = 'riscv64-linux-gnu-gcc-ar' +nm = 'riscv64-linux-gnu-gcc-nm' +ld = 'riscv64-linux-gnu-gcc-ld' +strip = 'riscv64-linux-gnu-strip' +ranlib = 'riscv64-linux-gnu-gcc-ranlib' + +[properties] +# https://docs.gtk.org/glib/cross-compiling.html#cross-properties +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true + +[built-in options] +libdir = 'lib' +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' +wrap_mode = 'nofallback' diff --git a/platforms/linux-s390x/Dockerfile b/platforms/linux-s390x/Dockerfile index 8720d832..c14bf5f7 100644 --- a/platforms/linux-s390x/Dockerfile +++ b/platforms/linux-s390x/Dockerfile @@ -1,7 +1,7 @@ -FROM debian:buster +FROM debian:bullseye LABEL maintainer="Lovell Fuller " -# Create Debian 10 (glibc 2.28) container suitable for cross-compiling Linux s390x binaries +# Create Debian 11 (glibc 2.31) container suitable for cross-compiling Linux s390x binaries # Path settings ENV \ @@ -24,6 +24,7 @@ RUN \ git \ gperf \ jq \ + libssl-dev \ libtool \ ninja-build \ pkg-config \ @@ -35,7 +36,8 @@ RUN \ --profile minimal \ && \ rustup target add s390x-unknown-linux-gnu && \ - pip3 install meson + cargo install cargo-c --locked && \ + pip3 install meson==1.7.2 tomli # Handy for debugging the compiled targets in Highway (hwy_list_targets) #RUN apt-get install -y qemu-user-static diff --git a/platforms/linux-s390x/meson.ini b/platforms/linux-s390x/meson.ini index b02a748b..0b1cfb15 100644 --- a/platforms/linux-s390x/meson.ini +++ b/platforms/linux-s390x/meson.ini @@ -12,9 +12,18 @@ nm = 's390x-linux-gnu-gcc-nm' ld = 's390x-linux-gnu-gcc-ld' strip = 's390x-linux-gnu-strip' ranlib = 's390x-linux-gnu-gcc-ranlib' -pkg-config = ['s390x-linux-gnu-pkg-config', '--static'] #exe_wrapper = 'qemu-s390x-static' +[properties] +# https://docs.gtk.org/glib/cross-compiling.html#cross-properties +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true + [built-in options] libdir = 'lib' +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' wrap_mode = 'nofallback' diff --git a/platforms/linux-x64/Dockerfile b/platforms/linux-x64/Dockerfile index 141328c1..bc92daac 100644 --- a/platforms/linux-x64/Dockerfile +++ b/platforms/linux-x64/Dockerfile @@ -29,6 +29,7 @@ RUN \ jq \ make \ nasm \ + openssl-devel \ patch \ pkgconfig \ python3 \ @@ -47,8 +48,9 @@ RUN \ --no-modify-path \ --profile minimal \ && \ + cargo install cargo-c --locked && \ ln -s /usr/bin/cmake3 /usr/bin/cmake && \ - pip3 install meson ninja packaging + pip3 install meson==1.7.2 ninja packaging tomli # Compiler settings ENV \ diff --git a/platforms/linux-x64/meson.ini b/platforms/linux-x64/meson.ini index 981d25d0..2f9d2ad0 100644 --- a/platforms/linux-x64/meson.ini +++ b/platforms/linux-x64/meson.ini @@ -1,7 +1,10 @@ [binaries] strip = 'strip' -pkg-config = ['pkg-config', '--static'] [built-in options] libdir = 'lib' +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' wrap_mode = 'nofallback' diff --git a/platforms/linuxmusl-arm64v8/Dockerfile b/platforms/linuxmusl-arm64v8/Dockerfile index 0b6721c2..b450c4e9 100644 --- a/platforms/linuxmusl-arm64v8/Dockerfile +++ b/platforms/linuxmusl-arm64v8/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.15 LABEL maintainer="Lovell Fuller " -# Create Alpine 3.15 (musl 1.2.2) container suitable for cross-compiling musl-based Linux ARM64v8-A binaries +# Create Alpine 3.15 (musl 1.2.2) container suitable for building musl-based Linux ARM64v8-A binaries # Path settings ENV \ @@ -9,6 +9,11 @@ ENV \ CARGO_HOME="/usr/local/cargo" \ PATH="/usr/local/cargo/bin:$PATH" +# 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="-Ctarget-feature=-crt-static" + # Build dependencies RUN \ apk update && apk upgrade && \ @@ -27,34 +32,26 @@ RUN \ libtool \ linux-headers \ ninja \ + openssl-dev \ pkgconf \ py3-packaging \ py3-pip \ python3 \ && \ - curl -Ls https://github.com/lovell/aarch64-linux-musl-crosstools/archive/main.tar.gz | tar -hxzC / --strip-components=2 && \ - ln -s /usr/bin/pkg-config /bin/aarch64-linux-musl-pkg-config && \ curl https://sh.rustup.rs -sSf | sh -s -- -y \ --no-modify-path \ --profile minimal \ + --default-host aarch64-unknown-linux-musl \ && \ - rustup target add aarch64-unknown-linux-musl && \ - pip3 install meson + cargo install cargo-c --locked && \ + pip3 install meson==1.7.2 # Compiler settings ENV \ - PKG_CONFIG="aarch64-linux-musl-pkg-config --static" \ + PKG_CONFIG="pkg-config --static" \ PLATFORM="linuxmusl-arm64v8" \ - CHOST="aarch64-linux-musl" \ - RUST_TARGET="aarch64-unknown-linux-musl" \ FLAGS="-march=armv8-a" \ MESON="--cross-file=/root/meson.ini" -# Musl defaults to static libs but we need them to be dynamic for host toolchain. -# The toolchain will produce static libs by default. -# We also need to add the directory containing libc.a to the library search path. -ENV \ - RUSTFLAGS="-Ctarget-feature=-crt-static -Lnative=/aarch64-linux-musl/lib" - COPY Toolchain.cmake /root/ COPY meson.ini /root/ diff --git a/platforms/linuxmusl-arm64v8/Toolchain.cmake b/platforms/linuxmusl-arm64v8/Toolchain.cmake index 14e7b85c..d98fafd2 100644 --- a/platforms/linuxmusl-arm64v8/Toolchain.cmake +++ b/platforms/linuxmusl-arm64v8/Toolchain.cmake @@ -1,13 +1,3 @@ -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_VERSION 1) -set(CMAKE_SYSTEM_PROCESSOR aarch64) - -SET(CMAKE_C_COMPILER aarch64-linux-musl-gcc) -set(CMAKE_CXX_COMPILER aarch64-linux-musl-g++) -SET(CMAKE_AR aarch64-linux-musl-ar) -SET(CMAKE_STRIP aarch64-linux-musl-strip) -SET(CMAKE_RANLIB aarch64-linux-musl-ranlib) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/platforms/linuxmusl-arm64v8/meson.ini b/platforms/linuxmusl-arm64v8/meson.ini index c8418115..86c70e82 100644 --- a/platforms/linuxmusl-arm64v8/meson.ini +++ b/platforms/linuxmusl-arm64v8/meson.ini @@ -1,24 +1,14 @@ -[host_machine] -system = 'linux' -cpu_family = 'aarch64' -cpu = 'armv8-a' -endian = 'little' - [binaries] -c = 'aarch64-linux-musl-gcc' -cpp = 'aarch64-linux-musl-g++' -ar = 'aarch64-linux-musl-ar' -nm = 'aarch64-linux-musl-nm' -ld = 'aarch64-linux-musl-ld' -strip = 'aarch64-linux-musl-strip' -ranlib = 'aarch64-linux-musl-ranlib' -pkg-config = ['aarch64-linux-musl-pkg-config', '--static'] +strip = 'strip' +[properties] # Ensure we disable the inotify backend in GIO # See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2991#note_1592863 -[properties] has_function_inotify_init1 = false [built-in options] -libdir = 'lib' +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' wrap_mode = 'nofallback' diff --git a/platforms/linuxmusl-x64/Dockerfile b/platforms/linuxmusl-x64/Dockerfile index b8dfd6df..3c42cf50 100644 --- a/platforms/linuxmusl-x64/Dockerfile +++ b/platforms/linuxmusl-x64/Dockerfile @@ -9,6 +9,11 @@ ENV \ CARGO_HOME="/usr/local/cargo" \ PATH="/usr/local/cargo/bin:$PATH" +# 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="-Ctarget-feature=-crt-static" + # Build dependencies RUN \ apk update && apk upgrade && \ @@ -28,6 +33,7 @@ RUN \ linux-headers \ nasm \ ninja \ + openssl-dev \ pkgconf \ py3-packaging \ py3-pip \ @@ -37,7 +43,8 @@ RUN \ --no-modify-path \ --profile minimal \ && \ - pip3 install meson + cargo install cargo-c --locked && \ + pip3 install meson==1.7.2 # Compiler settings ENV \ @@ -46,10 +53,5 @@ ENV \ FLAGS="-march=nehalem" \ MESON="--cross-file=/root/meson.ini" -# 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="-Ctarget-feature=-crt-static" - COPY Toolchain.cmake /root/ COPY meson.ini /root/ diff --git a/platforms/linuxmusl-x64/meson.ini b/platforms/linuxmusl-x64/meson.ini index 12d1fec7..86c70e82 100644 --- a/platforms/linuxmusl-x64/meson.ini +++ b/platforms/linuxmusl-x64/meson.ini @@ -1,11 +1,14 @@ [binaries] strip = 'strip' -pkg-config = ['pkg-config', '--static'] +[properties] # Ensure we disable the inotify backend in GIO # See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2991#note_1592863 -[properties] has_function_inotify_init1 = false [built-in options] +datadir = '/usr/share' +localedir = '/usr/share/locale' +sysconfdir = '/etc' +localstatedir = '/var' wrap_mode = 'nofallback' diff --git a/npm/populate.sh b/populate-npm-workspace.sh similarity index 67% rename from npm/populate.sh rename to populate-npm-workspace.sh index 8f91a3a7..071cd89f 100755 --- a/npm/populate.sh +++ b/populate-npm-workspace.sh @@ -1,23 +1,31 @@ #!/usr/bin/env bash set -e -LIBVIPS_VERSION=$(cat LIBVIPS_VERSION) -CURL="curl --silent --location" +# Dependency version numbers +source ./versions.properties -download_extract() { +# Common options for curl +CURL="curl --silent --location --retry 3 --retry-max-time 30" + +extract() { PLATFORM="$1" - PACKAGE="${1%v[68]}" # remove ARM version + case $1 in + *ppc64le) + PACKAGE="${1%??}" # package directory is named as npm/linux-ppc64 + ;; + *) + PACKAGE="${1%v[68]}" # remove ARM version + ;; + esac echo "$PLATFORM -> $PACKAGE" rm -rf "npm/$PACKAGE/include" "npm/$PACKAGE/lib" - $CURL \ - "https://github.com/lovell/sharp-libvips/releases/download/v$LIBVIPS_VERSION/libvips-$LIBVIPS_VERSION-$PLATFORM.tar.gz" | \ - tar xzC "npm/$PACKAGE" --exclude="platform.json" + tar xzf sharp-libvips-$PLATFORM.tar.gz -C "npm/$PACKAGE" } download_cpp() { $CURL \ --remote-name --output-dir "npm/dev/cplusplus" --create-dirs \ - "https://raw.githubusercontent.com/libvips/libvips/v$LIBVIPS_VERSION/cplusplus/$1.cpp" + "https://raw.githubusercontent.com/libvips/libvips/v$VERSION_VIPS/cplusplus/$1.cpp" } generate_readme() { @@ -45,15 +53,18 @@ remove_unused() { } # Download and extract per-platform binaries -PLATFORMS=$(ls platforms --ignore=*armv7 --ignore=win32*) +PLATFORMS=$(ls platforms --ignore=win32*) for platform in $PLATFORMS; do - download_extract "$platform" + extract "$platform" +done +for platform in arm64v8 ia32 x64; do + extract "win32-$platform" done -download_extract "win32-ia32" -download_extract "win32-x64" +extract "dev-wasm32" # Common header and source files cp -r npm/linux-x64/{include,versions.json,THIRD-PARTY-NOTICES.md} npm/dev/ +cp -r npm/win32-x64/include npm/dev/ find npm/dev/include/ -maxdepth 1 -type f -links +1 -delete for source in VConnection VError VImage VInterpolate VRegion vips-operators; do download_cpp "$source" diff --git a/versions.properties b/versions.properties new file mode 100644 index 00000000..da585d05 --- /dev/null +++ b/versions.properties @@ -0,0 +1,28 @@ +VERSION_AOM=3.12.1 +VERSION_ARCHIVE=3.8.1 +VERSION_CAIRO=1.18.4 +VERSION_CGIF=0.5.0 +VERSION_EXIF=0.6.25 +VERSION_EXPAT=2.7.1 +VERSION_FFI=3.5.1 +VERSION_FONTCONFIG=2.17.0 +VERSION_FREETYPE=2.13.3 +VERSION_FRIBIDI=1.0.16 +VERSION_GLIB=2.85.1 +VERSION_HARFBUZZ=11.2.1 +VERSION_HEIF=1.20.0 +VERSION_HWY=1.2.0 +VERSION_IMAGEQUANT=2.4.1 +VERSION_LCMS=2.17 +VERSION_MOZJPEG=4.1.5 +VERSION_PANGO=1.56.4 +VERSION_PIXMAN=0.46.2 +VERSION_PNG=1.6.49 +VERSION_PROXY_LIBINTL=0.4 +VERSION_RSVG=2.60.0 +VERSION_SPNG=0.7.4 +VERSION_TIFF=4.7.0 +VERSION_VIPS=8.17.0 +VERSION_WEBP=1.5.0 +VERSION_XML2=2.14.4 +VERSION_ZLIB_NG=2.2.4