diff --git a/.github/docker/linux/Dockerfile b/.github/docker/linux/Dockerfile index b99d470a..f2b43776 100644 --- a/.github/docker/linux/Dockerfile +++ b/.github/docker/linux/Dockerfile @@ -42,10 +42,10 @@ RUN yum install ${YUM_OPTIONS} \ mpfr-devel \ gmp-devel \ libmpc-devel \ - pango-devel \ gtk-doc \ gobject-introspection gobject-introspection-devel \ glib2.x86_64 glib2-devel.x86_64 \ + fontconfig-devel \ java-1.8.0-openjdk RUN ln -s /usr/bin/cmake3 /usr/bin/cmake diff --git a/.github/docker/windows/Dockerfile b/.github/docker/windows/Dockerfile index 21675ec9..267dac62 100644 --- a/.github/docker/windows/Dockerfile +++ b/.github/docker/windows/Dockerfile @@ -51,7 +51,7 @@ RUN yum install ${YUM_OPTIONS} \ mingw64-glib2 \ mingw64-win-iconv \ mingw64-expat \ - mingw64-pango + mingw-w64-x86_64 # Link the system version of libmpfr, which is more recent than expected, but works fine. RUN ln -s /lib64/libmpfr.so.6 /lib64/libmpfr.so.4 diff --git a/README.md b/README.md index 609259c9..86271bd6 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ For Fedora and CentOS: sudo yum install vips ``` -However, note that `JVips.jar` embeds `libvips.so` and its dependencies (expected pango used for `vips_text`). The `jar` file is self-sufficient for Linux. Look the `--minimal` flag documented below if you don't want this behavior and prefer to rely on system-wide libraries. +However, note that `JVips.jar` embeds `libvips.so` and its dependencies. The `jar` file is self-sufficient for Linux. Look the `--minimal` flag documented below if you don't want this behavior and prefer to rely on system-wide libraries. ### 🏁 Windows @@ -211,7 +211,7 @@ $ docker run --rm -v $(pwd):/app -w /app -u root -it builder bash - [ ] Add the missing operations - [ ] Adapt the binding design for calling function by operation name (see also: https://libvips.github.io/libvips/API/current/binding.md.html) - [ ] Publish artifacts to Maven Central -- [ ] Build pango and its dependencies from scratch (check how to deal with meson and ninja with cmake `ExternalProject_Add` function) +- [ ] Build Fontconfig for pango (fc-cache segfault during the installation) # Contact diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index e58d889d..4a0a9dd4 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -265,7 +265,7 @@ if(NOT CAIRO) --disable-static --disable-docs --disable-gl - --disable-xlib + --enable-xlib --disable-xcb --without-x --disable-ps @@ -276,6 +276,23 @@ else() add_custom_target(cairo "") endif() +find_library(PANGO pango PATHS "${EXT_INSTALL_DIR}/lib" NO_DEFAULT_PATH) +if(NOT PANGO) + ExternalProject_Add(pango + URL "https://gitlab.gnome.org/GNOME/pango/-/archive/${PANGO_VERSION}/pango-${PANGO_VERSION}.tar.gz" + PREFIX "${CMAKE_CURRENT_BINARY_DIR}/pango" + CONFIGURE_COMMAND meson ${CMAKE_CURRENT_BINARY_DIR}/pango/buildir + ${MESON_VARS} + -Dintrospection=disabled + BUILD_COMMAND ninja -C ${CMAKE_CURRENT_BINARY_DIR}/pango/buildir + INSTALL_COMMAND ninja -C ${CMAKE_CURRENT_BINARY_DIR}/pango/buildir install + BUILD_IN_SOURCE 1 + DEPENDS cairo freetype harfbuzz fribidi + ) +else() + add_custom_target(pango "") +endif() + find_library(GIFLIB gif PATHS "${EXT_INSTALL_DIR}/lib" NO_DEFAULT_PATH) if (NOT GIFLIB) # giflib hasn't a standard build system, don't append CONFIGURE_VARS @@ -410,7 +427,7 @@ if(NOT VIPS) --without-rsvg ${LIBSPNG_FLAGS} ${LIBHEIF_FLAGS} - DEPENDS libjpeg libpng libspng giflib libwebp libimagequant lcms2 libheif tiff + DEPENDS libjpeg libpng libspng giflib libwebp libimagequant lcms2 libheif tiff pango BUILD_IN_SOURCE 1 ) else() diff --git a/lib/VERSIONS b/lib/VERSIONS index 16845434..64d9d4df 100644 --- a/lib/VERSIONS +++ b/lib/VERSIONS @@ -17,5 +17,6 @@ VIPS_VERSION=8.12.2 FRIBIDI_VERSION=1.0.10 PIXMAN_VERSION=0.40.0 CAIRO_VERSION=1.16.0 +PANGO_VERSION=1.48.0 VIPS_VERSION=8.12.1 >>>>>>> 📦 Add Fribidi dependency diff --git a/src/main/java/com/criteo/vips/Vips.java b/src/main/java/com/criteo/vips/Vips.java index 94d51eb6..cdbbcbdb 100644 --- a/src/main/java/com/criteo/vips/Vips.java +++ b/src/main/java/com/criteo/vips/Vips.java @@ -34,6 +34,7 @@ public class Vips { "png16", "spng", "cairo", + "pango", "gif", "jpeg", "turbojpeg",