diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 66ad55d9..9bd9becf 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,8 +1,13 @@ name: Build Release -on: [ push, pull_request ] +on: + - push + - pull_request +permissions: {} jobs: create-release: - runs-on: 'ubuntu-22.04' + permissions: + contents: write + runs-on: 'ubuntu-24.04' outputs: upload_url: ${{ steps.create-release.outputs.upload_url }} steps: @@ -15,27 +20,30 @@ jobs: prerelease: true token: ${{ secrets.GITHUB_TOKEN }} build: + permissions: + contents: write runs-on: ${{ matrix.os }} needs: create-release strategy: fail-fast: false matrix: - os: [ ubuntu-22.04 ] + os: + - 'ubuntu-24.04' platform: - 'linux-x64' - 'linux-armv6' - - 'linux-armv7' - 'linuxmusl-x64' - 'linuxmusl-arm64v8' + - 'linux-ppc64le' - 'linux-s390x' - 'wasm32' - 'win32-ia32' - 'win32-x64' - 'win32-arm64v8' include: - - os: macos-11 + - os: macos-13 platform: 'darwin-x64' - - os: macos-11 + - os: macos-13 platform: 'darwin-arm64v8' steps: - name: Checkout @@ -44,7 +52,7 @@ jobs: if: runner.os == 'macOS' run: | pip3 install meson ninja packaging - brew install automake nasm pkg-config + brew install automake nasm - name: Build ${{ matrix.platform }} id: build-release run: ./build.sh $(cat LIBVIPS_VERSION) ${{ matrix.platform }} diff --git a/LIBVIPS_VERSION b/LIBVIPS_VERSION index e7ab33dc..559d6961 100644 --- a/LIBVIPS_VERSION +++ b/LIBVIPS_VERSION @@ -1 +1 @@ -8.15.2 +8.16.1 diff --git a/README.md b/README.md index a9743ed3..fb9c4aca 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ 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) * [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..771eb15a 100755 --- a/build.sh +++ b/build.sh @@ -17,9 +17,9 @@ 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-s390x" echo "- darwin-x64" echo "- darwin-arm64v8" @@ -46,7 +46,7 @@ for flavour in darwin-x64 darwin-arm64v8; do export PKG_CONFIG="$(brew --prefix)/bin/pkg-config --static" # Earliest supported version of macOS - export MACOSX_DEPLOYMENT_TARGET="10.13" + export MACOSX_DEPLOYMENT_TARGET="10.15" # Added -fno-stack-check to workaround a stack misalignment bug on macOS 10.15 # See: @@ -60,6 +60,7 @@ for flavour in darwin-x64 darwin-arm64v8; do if [ $PLATFORM = "darwin-arm64v8" ]; then # ARM64 builds work via cross compilation from an x86_64 machine export CHOST="aarch64-apple-darwin" + export RUST_TARGET="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" @@ -99,8 +100,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 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-s390x; do if [ $PLATFORM = "all" ] || [ $PLATFORM = $flavour ]; then echo "Building $flavour..." docker build -t vips-dev-$flavour platforms/$flavour diff --git a/build/lin.sh b/build/lin.sh index 998e8e89..63563f35 100755 --- a/build/lin.sh +++ b/build/lin.sh @@ -1,6 +1,15 @@ #!/usr/bin/env bash set -e +# 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 +18,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 +26,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 @@ -92,43 +101,33 @@ unset PKG_CONFIG_PATH 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_ZLIB_NG=2.2.4 +VERSION_FFI=3.4.8 +VERSION_GLIB=2.84.1 +VERSION_XML2=2.14.2 +VERSION_EXIF=0.6.25 +VERSION_LCMS2=2.17 VERSION_MOZJPEG=4.1.5 -VERSION_PNG16=1.6.43 +VERSION_PNG16=1.6.47 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_WEBP=1.5.0 +VERSION_TIFF=4.7.0 +VERSION_HWY=1.2.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:]]*}" -} +VERSION_FREETYPE=2.13.3 +VERSION_EXPAT=2.7.1 +VERSION_ARCHIVE=3.7.9 +VERSION_FONTCONFIG=2.16.2 +VERSION_HARFBUZZ=11.1.0 +VERSION_PIXMAN=0.44.2 +VERSION_CAIRO=1.18.4 +VERSION_FRIBIDI=1.0.16 +VERSION_PANGO=1.56.3 +VERSION_RSVG=2.60.0 +VERSION_AOM=3.12.0 +VERSION_HEIF=1.19.7 +VERSION_CGIF=0.5.0 # Check for newer versions # Skip by setting the VERSION_LATEST_REQUIRED environment variable to "false" @@ -143,7 +142,7 @@ version_latest() { 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') + 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 @@ -161,11 +160,10 @@ 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 "webp" "$VERSION_WEBP" "1761" 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" @@ -174,10 +172,10 @@ 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 "pango" "$VERSION_PANGO" "11783" "unstable" +version_latest "rsvg" "$VERSION_RSVG" "5420" "unstable" +#version_latest "aom" "$VERSION_AOM" "17628" # aom 3.12.1 requires cmake 3.16 https://aomedia.googlesource.com/aom/+/597a35fbc9837e33366a1108631d9c72ee7a49e7 +version_latest "heif" "$VERSION_HEIF" "64439" version_latest "cgif" "$VERSION_CGIF" "dloebl/cgif" if [ "$ALL_AT_VERSION_LATEST" = "false" ]; then exit 1; fi @@ -189,6 +187,7 @@ if [ "$DARWIN" = true ]; then 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,47 +212,44 @@ 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 +$CURL https://gist.github.com/kleisauke/284d685efa00908da99ea6afbaaf39ae/raw/936a6b8013d07d358c6944cc5b5f0e27db707ace/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 + --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-compile-resources 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 \ 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} +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 mkdir aom_build cd aom_build AOM_AS_FLAGS="${FLAGS}" cmake -G"Unix Makefiles" \ @@ -271,7 +267,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 @@ -285,14 +281,15 @@ 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 +./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \ + --disable-tools --without-binconfigs --disable-unversioned-libpng-config +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 +303,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 +323,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 +340,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 +349,13 @@ 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 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 +371,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 +380,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 +402,51 @@ 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 +# 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 +# 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,7 +526,6 @@ 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\ diff --git a/build/wasm.sh b/build/wasm.sh index 5cb4f201..5eb70d89 100755 --- a/build/wasm.sh +++ b/build/wasm.sh @@ -34,15 +34,15 @@ 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 diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json index f64dae8d..dca3473d 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.1.0", "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..3a2e38e4 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.1.0", "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..531eda52 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.1.0", "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..fdaf802b 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.1.0", "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..e787c5cf 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.1.0", "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..8896ccc7 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.1.0", "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..84f37067 --- /dev/null +++ b/npm/linux-ppc64/package.json @@ -0,0 +1,42 @@ +{ + "name": "@img/sharp-libvips-linux-ppc64", + "version": "1.1.0", + "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-s390x/package.json b/npm/linux-s390x/package.json index cbb8ec1c..d61d5c6a 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.1.0", "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..549c5458 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.1.0", "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..99e9af75 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.1.0", "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..9529117a 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.1.0", "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..34e8bcb0 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "@img/sharp-libvips", - "version": "1.0.1", + "version": "1.1.0", "private": "true", "workspaces": [ "dev", @@ -11,8 +11,10 @@ "linux-arm64", "linuxmusl-arm64", "linuxmusl-x64", + "linux-ppc64", "linux-s390x", "linux-x64", + "win32-arm64", "win32-ia32", "win32-x64" ] diff --git a/npm/populate.sh b/npm/populate.sh index 8f91a3a7..2ebd477e 100755 --- a/npm/populate.sh +++ b/npm/populate.sh @@ -6,7 +6,14 @@ CURL="curl --silent --location" download_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 \ @@ -45,12 +52,13 @@ 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" done -download_extract "win32-ia32" -download_extract "win32-x64" +for platform in arm64v8 ia32 x64; do + download_extract "win32-$platform" +done # Common header and source files cp -r npm/linux-x64/{include,versions.json,THIRD-PARTY-NOTICES.md} npm/dev/ diff --git a/npm/win32-arm64/package.json b/npm/win32-arm64/package.json new file mode 100644 index 00000000..16942a45 --- /dev/null +++ b/npm/win32-arm64/package.json @@ -0,0 +1,30 @@ +{ + "name": "@img/sharp-libvips-win32-arm64", + "version": "1.1.0", + "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..5a1c411f 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.1.0", "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..575ddf32 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.1.0", "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/meson.ini b/platforms/darwin-arm64v8/meson.ini index de108582..d58ed9ee 100644 --- a/platforms/darwin-arm64v8/meson.ini +++ b/platforms/darwin-arm64v8/meson.ini @@ -12,4 +12,8 @@ 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..14a8e104 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 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..928b367f 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 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..35d69fde 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 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-s390x/Dockerfile b/platforms/linux-s390x/Dockerfile index 8720d832..b5881100 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 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..83e41cb7 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 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..9f7dda6b 100644 --- a/platforms/linuxmusl-arm64v8/Dockerfile +++ b/platforms/linuxmusl-arm64v8/Dockerfile @@ -9,6 +9,12 @@ 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. +# 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" + # Build dependencies RUN \ apk update && apk upgrade && \ @@ -27,6 +33,7 @@ RUN \ libtool \ linux-headers \ ninja \ + openssl-dev \ pkgconf \ py3-packaging \ py3-pip \ @@ -39,6 +46,7 @@ RUN \ --profile minimal \ && \ rustup target add aarch64-unknown-linux-musl && \ + cargo install cargo-c --locked && \ pip3 install meson # Compiler settings @@ -50,11 +58,5 @@ ENV \ 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/meson.ini b/platforms/linuxmusl-arm64v8/meson.ini index c8418115..f291e68d 100644 --- a/platforms/linuxmusl-arm64v8/meson.ini +++ b/platforms/linuxmusl-arm64v8/meson.ini @@ -12,13 +12,20 @@ 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'] +[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 +# 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/linuxmusl-x64/Dockerfile b/platforms/linuxmusl-x64/Dockerfile index b8dfd6df..3fa55eca 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,6 +43,7 @@ RUN \ --no-modify-path \ --profile minimal \ && \ + cargo install cargo-c --locked && \ pip3 install meson # Compiler settings @@ -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'