vcpkg/ports/cairo/0001-meson-fix-macOS-build-and-add-macOS-ci.patch

113 lines
3.7 KiB
Diff

From d8d16562ec094593eba4446432e918704590ab20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Sat, 26 Sep 2020 19:25:21 +0100
Subject: [PATCH] meson: fix macOS build and add macOS ci
Fixes #441
---
.gitlab-ci.yml | 26 ++++++++++++++++++++
meson.build | 61 ++++++++++++++++++++++-------------------------
meson_options.txt | 1 +
3 files changed, 56 insertions(+), 32 deletions(-)
diff --git a/meson.build b/meson.build
index 53a9af343..fe7757b1f 100644
--- a/meson.build
+++ b/meson.build
@@ -371,37 +371,34 @@ if qtgui_dep.found() and false
deps += [qtgui_dep]
endif
-# Untested
-if cc.has_header('ApplicationServices/ApplicationServices.h')
- if cc.has_header('CoreGraphics/CoreGraphics.h')
- quartz_extra_libs = ['-Xlinker', '-framework', '-Xlinker', 'CoreGraphics']
- else
- quartz_extra_libs = ['-Xlinker', '-framework', '-Xlinker', 'ApplicationServices']
+if host_machine.system() == 'darwin' and not get_option('quartz').disabled()
+ quartz_deps = dependency('appleframeworks', modules : ['CoreFoundation', 'ApplicationServices'], required: get_option('quartz'))
+
+ if quartz_deps.found()
+ deps += [quartz_deps]
+
+ feature_conf.set('CAIRO_HAS_QUARTZ_SURFACE', 1)
+ feature_conf.set('CAIRO_HAS_QUARTZ_FONT', 1)
+ feature_conf.set('CAIRO_HAS_QUARTZ_IMAGE_SURFACE', 1)
+
+ built_features += [
+ {
+ 'name': 'cairo-quartz',
+ 'description': 'Quartz surface backend',
+ 'deps': quartz_deps,
+ },
+ {
+ 'name': 'cairo-quartz-image',
+ 'description': 'Quartz Image surface backend',
+ 'deps': quartz_deps,
+ },
+ {
+ 'name': 'cairo-quartz-font',
+ 'description': 'Quartz font backend',
+ 'deps': quartz_deps,
+ },
+ ]
endif
-
- extra_link_args += quartz_extra_libs
-
- feature_conf.set('CAIRO_HAS_QUARTZ_SURFACE', 1)
- feature_conf.set('CAIRO_HAS_QUARTZ_FONT', 1)
- feature_conf.set('CAIRO_HAS_QUARTZ_IMAGE_SURFACE', 1)
-
- built_features += [
- {
- 'name': 'cairo-quartz',
- 'description': 'Quartz surface backend',
- 'libs': quartz_extra_libs,
- },
- {
- 'name': 'cairo-quartz-image',
- 'description': 'Quartz Image surface backend',
- 'libs': quartz_extra_libs,
- },
- {
- 'name': 'cairo-quartz-font',
- 'description': 'Quartz font backend',
- 'libs': quartz_extra_libs,
- },
- ]
endif
if host_machine.system() == 'windows'
@@ -887,13 +884,13 @@ foreach feature: built_features
feature_deps = feature.get('deps', [])
feature_libs = feature.get('libs', [])
feature_compile_deps = feature.get('compile-deps', [])
- pkgmod.generate(libraries: [libcairo] + feature_deps + feature_libs,
+ pkgmod.generate(libraries: [libcairo, feature_deps, feature_libs],
name: feature['name'],
description: feature['description'] + ' for cairo graphics library',
)
meson.override_dependency(feature['name'],
declare_dependency(link_with: libcairo,
- dependencies: feature_deps + feature_compile_deps,
+ dependencies: [feature_deps, feature_compile_deps],
link_args: feature_libs,
)
)
diff --git a/meson_options.txt b/meson_options.txt
index ff11fe7ed..5cafe8bda 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -13,6 +13,7 @@ option('glesv3', type : 'feature', value : 'disabled')
option('drm', type : 'feature', value : 'disabled')
option('openvg', type : 'feature', value : 'disabled')
option('png', type : 'feature', value : 'auto') # png and svg surfaces
+option('quartz', type : 'feature', value : 'auto')
option('qt', type : 'feature', value : 'disabled')
option('tee', type : 'feature', value : 'disabled')
option('xcb', type : 'feature', value : 'auto')
--
2.29.2