Merge pull request #2211 from kleisauke/fix-ci-2

CI: fix failures in macOS runner
This commit is contained in:
John Cupitt 2021-04-21 13:59:03 +01:00 committed by GitHub
commit 57ab63f9f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 12 deletions

View File

@ -61,17 +61,10 @@ jobs:
- name: Install macOS dependencies - name: Install macOS dependencies
if: contains(matrix.os, 'macos') if: contains(matrix.os, 'macos')
run: | run: |
brew update brew update
brew install brew upgrade
autoconf automake libtool brew install autoconf automake libtool fftw fontconfig gtk-doc gobject-introspection glib libexif libgsf little-cms2 orc pango
gtk-doc gobject-introspection brew install cfitsio imagemagick@6 libheif libjpeg-turbo libmatio librsvg libspng libtiff openexr openjpeg openslide poppler webp
cfitsio fftw giflib
glib libexif libgsf
libheif libjpeg-turbo libmatio
librsvg libspng libtiff
little-cms2 openexr openslide
orc pango poppler webp
openjpeg
- name: Install Clang 10 - name: Install Clang 10
env: env:
@ -96,7 +89,7 @@ jobs:
if: contains(matrix.os, 'macos') if: contains(matrix.os, 'macos')
run: | run: |
echo "JOBS=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV echo "JOBS=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/opt/jpeg-turbo/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig" >> $GITHUB_ENV echo "PKG_CONFIG_PATH=/usr/local/opt/jpeg-turbo/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/imagemagick@6/lib/pkgconfig" >> $GITHUB_ENV
- name: Prepare sanitizers - name: Prepare sanitizers
if: matrix.sanitize if: matrix.sanitize

View File

@ -1103,6 +1103,26 @@ fi
VIPS_CFLAGS="$VIPS_CFLAGS $PANGOCAIRO_CFLAGS" VIPS_CFLAGS="$VIPS_CFLAGS $PANGOCAIRO_CFLAGS"
VIPS_LIBS="$VIPS_LIBS $PANGOCAIRO_LIBS" VIPS_LIBS="$VIPS_LIBS $PANGOCAIRO_LIBS"
# font file support with fontconfig
AC_ARG_WITH([fontconfig],
AS_HELP_STRING([--without-fontconfig],
[build without fontconfig (default: test)]))
if test x"$with_pangocairo" != x"no" -a x"$with_fontconfig" != x"no"; then
PKG_CHECK_MODULES(FONTCONFIG, fontconfig,
[AC_DEFINE(HAVE_FONTCONFIG,1,[define if you have fontconfig installed.])
with_fontconfig=yes
PACKAGES_USED="$PACKAGES_USED fontconfig"
],
[AC_MSG_WARN([fontconfig not found; disabling fontconfig support])
with_fontconfig=no
]
)
fi
VIPS_CFLAGS="$VIPS_CFLAGS $FONTCONFIG_CFLAGS"
VIPS_LIBS="$VIPS_LIBS $FONTCONFIG_LIBS"
# look for TIFF with pkg-config ... fall back to our tester # look for TIFF with pkg-config ... fall back to our tester
# pkgconfig support for libtiff starts with libtiff-4 # pkgconfig support for libtiff starts with libtiff-4
AC_ARG_WITH([tiff], AC_ARG_WITH([tiff],
@ -1326,6 +1346,7 @@ accelerate loops with orc: $with_orc, \
ICC profile support with lcms: $with_lcms, \ ICC profile support with lcms: $with_lcms, \
zlib: $with_zlib, \ zlib: $with_zlib, \
text rendering with pangocairo: $with_pangocairo, \ text rendering with pangocairo: $with_pangocairo, \
font file support with fontconfig: $with_fontconfig, \
EXIF metadata support with libexif: $with_libexif, \ EXIF metadata support with libexif: $with_libexif, \
JPEG load/save with libjpeg: $with_jpeg, \ JPEG load/save with libjpeg: $with_jpeg, \
PNG load with libspng: $with_libspng, \ PNG load with libspng: $with_libspng, \
@ -1428,6 +1449,7 @@ accelerate loops with orc: $with_orc
ICC profile support with lcms: $with_lcms ICC profile support with lcms: $with_lcms
zlib: $with_zlib zlib: $with_zlib
text rendering with pangocairo: $with_pangocairo text rendering with pangocairo: $with_pangocairo
font file support with fontconfig: $with_fontconfig
EXIF metadata support with libexif: $with_libexif EXIF metadata support with libexif: $with_libexif
## File format support ## File format support

View File

@ -84,7 +84,10 @@
#include <cairo.h> #include <cairo.h>
#include <pango/pango.h> #include <pango/pango.h>
#include <pango/pangocairo.h> #include <pango/pangocairo.h>
#ifdef HAVE_FONTCONFIG
#include <fontconfig/fontconfig.h> #include <fontconfig/fontconfig.h>
#endif
#include "pcreate.h" #include "pcreate.h"
@ -123,10 +126,12 @@ static GMutex *vips_text_lock = NULL;
*/ */
static PangoFontMap *vips_text_fontmap = NULL; static PangoFontMap *vips_text_fontmap = NULL;
#ifdef HAVE_FONTCONFIG
/* All the fontfiles we've loaded. fontconfig lets you add a fontfile /* All the fontfiles we've loaded. fontconfig lets you add a fontfile
* repeatedly, and we obviously don't want that. * repeatedly, and we obviously don't want that.
*/ */
static GHashTable *vips_text_fontfiles = NULL; static GHashTable *vips_text_fontfiles = NULL;
#endif
static void static void
vips_text_dispose( GObject *gobject ) vips_text_dispose( GObject *gobject )
@ -365,13 +370,17 @@ vips_text_build( VipsObject *object )
if( !vips_text_fontmap ) if( !vips_text_fontmap )
vips_text_fontmap = pango_cairo_font_map_new(); vips_text_fontmap = pango_cairo_font_map_new();
#ifdef HAVE_FONTCONFIG
if( !vips_text_fontfiles ) if( !vips_text_fontfiles )
vips_text_fontfiles = vips_text_fontfiles =
g_hash_table_new( g_str_hash, g_str_equal ); g_hash_table_new( g_str_hash, g_str_equal );
#endif
text->context = pango_font_map_create_context( text->context = pango_font_map_create_context(
PANGO_FONT_MAP( vips_text_fontmap ) ); PANGO_FONT_MAP( vips_text_fontmap ) );
#ifdef HAVE_FONTCONFIG
if( text->fontfile && if( text->fontfile &&
!g_hash_table_lookup( vips_text_fontfiles, text->fontfile ) ) { !g_hash_table_lookup( vips_text_fontfiles, text->fontfile ) ) {
if( !FcConfigAppFontAddFile( NULL, if( !FcConfigAppFontAddFile( NULL,
@ -386,6 +395,11 @@ vips_text_build( VipsObject *object )
text->fontfile, text->fontfile,
g_strdup( text->fontfile ) ); g_strdup( text->fontfile ) );
} }
#else
if( text->fontfile )
g_warning( "%s",
_( "ignoring fontfile (no fontconfig support)" ) );
#endif
/* If our caller set height and not dpi, we adjust dpi until /* If our caller set height and not dpi, we adjust dpi until
* we get a fit. * we get a fit.