cairo: just always install cairo-ft. Bump PKGREVISION.

Depend on freetype and fontconfig even if no options are selected, and
take care to explicitly enable or disable meson options. Should fix
pango build error seen on NetBSD sans X11:

    meson.build:429:4: ERROR: Problem encountered: No Cairo font backends found

Build-tested (and `otool -L`-inspected) on macOS with each of 'quartz',
'x11', 'xcb', 'x11 xcb', and no options selected.
This commit is contained in:
schmonz 2023-11-26 18:45:03 +00:00
parent 8529067ef4
commit 74b9ccad1b
4 changed files with 26 additions and 24 deletions

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.159 2023/11/23 10:57:44 jperkin Exp $
# $NetBSD: Makefile,v 1.160 2023/11/26 18:45:03 schmonz Exp $
DISTNAME= cairo-1.18.0
PKGREVISION= 1
CATEGORIES= graphics
MASTER_SITES= https://cairographics.org/releases/
EXTRACT_SUFX= .tar.xz
@ -19,6 +20,9 @@ USE_TOOLS+= pkg-config
CPPFLAGS.SunOS+= -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS
LDFLAGS.SunOS+= -lsocket
MESON_ARGS+= -Dfreetype=enabled
MESON_ARGS+= -Dfontconfig=enabled
PKGCONFIG_OVERRIDE_STAGE= post-build
PKGCONFIG_OVERRIDE+= output/meson-private/*.pc
@ -40,6 +44,8 @@ PLIST.trace= yes
BUILDLINK_API_DEPENDS.glib2+= glib2>=2.14.0
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
# include?
#.include "../../print/libspectre/buildlink3.mk"

View File

@ -1,8 +1,8 @@
@comment $NetBSD: PLIST,v 1.44 2023/11/15 15:11:39 tnn Exp $
@comment $NetBSD: PLIST,v 1.45 2023/11/26 18:45:03 schmonz Exp $
${PLIST.trace}bin/cairo-trace
include/cairo/cairo-deprecated.h
include/cairo/cairo-features.h
${PLIST.freetype}include/cairo/cairo-ft.h
include/cairo/cairo-ft.h
include/cairo/cairo-gobject.h
include/cairo/cairo-pdf.h
include/cairo/cairo-ps.h
@ -28,8 +28,8 @@ lib/libcairo-script-interpreter.so.2.11800.0
lib/libcairo.so
lib/libcairo.so.2
lib/libcairo.so.2.11800.0
${PLIST.fontconfig}lib/pkgconfig/cairo-fc.pc
${PLIST.freetype}lib/pkgconfig/cairo-ft.pc
lib/pkgconfig/cairo-fc.pc
lib/pkgconfig/cairo-ft.pc
lib/pkgconfig/cairo-gobject.pc
lib/pkgconfig/cairo-pdf.pc
lib/pkgconfig/cairo-png.pc

View File

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.67 2023/11/15 15:17:21 tnn Exp $
# $NetBSD: buildlink3.mk,v 1.68 2023/11/26 18:45:03 schmonz Exp $
BUILDLINK_TREE+= cairo
@ -18,11 +18,6 @@ pkgbase := cairo
.include "../../x11/libxcb/buildlink3.mk"
.endif
.if ${PKG_BUILD_OPTIONS.cairo:Mx11} || ${PKG_BUILD_OPTIONS.cairo:Mxcb} || ${PKG_BUILD_OPTIONS.cairo:Mquartz}
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.endif
.if ${PKG_BUILD_OPTIONS.cairo:Mx11} || ${PKG_BUILD_OPTIONS.cairo:Mxcb}
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libXrender/buildlink3.mk"
@ -31,6 +26,8 @@ pkgbase := cairo
.include "../../archivers/lzo/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../x11/pixman/buildlink3.mk"
.endif # CAIRO_BUILDLINK3_MK

View File

@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.25 2023/11/15 15:11:39 tnn Exp $
# $NetBSD: options.mk,v 1.26 2023/11/26 18:45:03 schmonz Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.cairo
PKG_SUPPORTED_OPTIONS= x11 xcb
@ -11,25 +11,27 @@ PKG_SUGGESTED_OPTIONS= x11 xcb
.include "../../mk/bsd.options.mk"
PLIST_VARS+= fontconfig freetype x11 xcb quartz
PLIST_VARS+= x11 xcb quartz
###
### X11 and XCB support (XCB implies X11)
###
.if !empty(PKG_OPTIONS:Mx11) || !empty(PKG_OPTIONS:Mxcb)
PLIST.fontconfig= yes
PLIST.freetype= yes
PLIST.x11= yes
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libXrender/buildlink3.mk"
MESON_ARGS+= -Dxlib=enabled
. if !empty(PKG_OPTIONS:Mxcb)
PLIST.xcb= yes
. include "../../x11/libxcb/buildlink3.mk"
MESON_ARGS+= -Dxcb=enabled
. else
MESON_ARGS+= -Dxcb=disabled
. endif
.else
MESON_ARGS+= -Dxlib=disabled
MESON_ARGS+= -Dxcb=disabled
.endif
###
@ -43,12 +45,9 @@ PLIST.xcb= yes
# fonts in MacOS X system-default paths too so sticking with it will
# not be a problem.
.if !empty(PKG_OPTIONS:Mquartz)
.include "../../fonts/fontconfig/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
MESON_ARGS+= -Dfreetype=enabled
MESON_ARGS+= -Dfontconfig=enabled
PLIST.fontconfig= yes
PLIST.freetype= yes
PLIST.quartz= yes
WARNINGS+= "You have enabled Quartz backend. No fonts installed with pkgsrc will be found."
MESON_ARGS+= -Dquartz=enabled
.else
MESON_ARGS+= -Dquartz=disabled
.endif