Merge pull request #2211 from kleisauke/fix-ci-2
CI: fix failures in macOS runner
This commit is contained in:
commit
57ab63f9f1
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@ -61,17 +61,10 @@ jobs:
|
||||
- name: Install macOS dependencies
|
||||
if: contains(matrix.os, 'macos')
|
||||
run: |
|
||||
brew update
|
||||
brew install
|
||||
autoconf automake libtool
|
||||
gtk-doc gobject-introspection
|
||||
cfitsio fftw giflib
|
||||
glib libexif libgsf
|
||||
libheif libjpeg-turbo libmatio
|
||||
librsvg libspng libtiff
|
||||
little-cms2 openexr openslide
|
||||
orc pango poppler webp
|
||||
openjpeg
|
||||
brew update
|
||||
brew upgrade
|
||||
brew install autoconf automake libtool fftw fontconfig gtk-doc gobject-introspection glib libexif libgsf little-cms2 orc pango
|
||||
brew install cfitsio imagemagick@6 libheif libjpeg-turbo libmatio librsvg libspng libtiff openexr openjpeg openslide poppler webp
|
||||
|
||||
- name: Install Clang 10
|
||||
env:
|
||||
@ -96,7 +89,7 @@ jobs:
|
||||
if: contains(matrix.os, 'macos')
|
||||
run: |
|
||||
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
|
||||
if: matrix.sanitize
|
||||
|
22
configure.ac
22
configure.ac
@ -1103,6 +1103,26 @@ fi
|
||||
VIPS_CFLAGS="$VIPS_CFLAGS $PANGOCAIRO_CFLAGS"
|
||||
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
|
||||
# pkgconfig support for libtiff starts with libtiff-4
|
||||
AC_ARG_WITH([tiff],
|
||||
@ -1326,6 +1346,7 @@ accelerate loops with orc: $with_orc, \
|
||||
ICC profile support with lcms: $with_lcms, \
|
||||
zlib: $with_zlib, \
|
||||
text rendering with pangocairo: $with_pangocairo, \
|
||||
font file support with fontconfig: $with_fontconfig, \
|
||||
EXIF metadata support with libexif: $with_libexif, \
|
||||
JPEG load/save with libjpeg: $with_jpeg, \
|
||||
PNG load with libspng: $with_libspng, \
|
||||
@ -1428,6 +1449,7 @@ accelerate loops with orc: $with_orc
|
||||
ICC profile support with lcms: $with_lcms
|
||||
zlib: $with_zlib
|
||||
text rendering with pangocairo: $with_pangocairo
|
||||
font file support with fontconfig: $with_fontconfig
|
||||
EXIF metadata support with libexif: $with_libexif
|
||||
|
||||
## File format support
|
||||
|
@ -84,7 +84,10 @@
|
||||
#include <cairo.h>
|
||||
#include <pango/pango.h>
|
||||
#include <pango/pangocairo.h>
|
||||
|
||||
#ifdef HAVE_FONTCONFIG
|
||||
#include <fontconfig/fontconfig.h>
|
||||
#endif
|
||||
|
||||
#include "pcreate.h"
|
||||
|
||||
@ -123,10 +126,12 @@ static GMutex *vips_text_lock = NULL;
|
||||
*/
|
||||
static PangoFontMap *vips_text_fontmap = NULL;
|
||||
|
||||
#ifdef HAVE_FONTCONFIG
|
||||
/* All the fontfiles we've loaded. fontconfig lets you add a fontfile
|
||||
* repeatedly, and we obviously don't want that.
|
||||
*/
|
||||
static GHashTable *vips_text_fontfiles = NULL;
|
||||
#endif
|
||||
|
||||
static void
|
||||
vips_text_dispose( GObject *gobject )
|
||||
@ -365,13 +370,17 @@ vips_text_build( VipsObject *object )
|
||||
|
||||
if( !vips_text_fontmap )
|
||||
vips_text_fontmap = pango_cairo_font_map_new();
|
||||
|
||||
#ifdef HAVE_FONTCONFIG
|
||||
if( !vips_text_fontfiles )
|
||||
vips_text_fontfiles =
|
||||
g_hash_table_new( g_str_hash, g_str_equal );
|
||||
#endif
|
||||
|
||||
text->context = pango_font_map_create_context(
|
||||
PANGO_FONT_MAP( vips_text_fontmap ) );
|
||||
|
||||
#ifdef HAVE_FONTCONFIG
|
||||
if( text->fontfile &&
|
||||
!g_hash_table_lookup( vips_text_fontfiles, text->fontfile ) ) {
|
||||
if( !FcConfigAppFontAddFile( NULL,
|
||||
@ -386,6 +395,11 @@ vips_text_build( VipsObject *object )
|
||||
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
|
||||
* we get a fit.
|
||||
|
Loading…
Reference in New Issue
Block a user