[cairo-commit] 2 commits - .gitlab-ci.yml meson.build meson_options.txt

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 6 13:27:30 UTC 2021


 .gitlab-ci.yml    |   26 +++++++++++++++++++++++
 meson.build       |   61 +++++++++++++++++++++++++-----------------------------
 meson_options.txt |    1 
 3 files changed, 56 insertions(+), 32 deletions(-)

New commits:
commit b80d26a064a0b9ca749a0ed386c3f1da9fb7fcae
Merge: cb3618f76 d8d16562e
Author: Uli Schlachter <psychon at znc.in>
Date:   Wed Jan 6 13:27:28 2021 +0000

    Merge branch 'meson-ci-macos' into 'master'
    
    meson: fix macOS build and add macOS ci
    
    Closes #441
    
    See merge request cairo/cairo!101

commit d8d16562ec094593eba4446432e918704590ab20
Author: Tim-Philipp Müller <tim at centricular.com>
Date:   Sat Sep 26 19:25:21 2020 +0100

    meson: fix macOS build and add macOS ci
    
    Fixes #441

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4c0450d71..98186c490 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -213,3 +213,29 @@ meson android arm64 fedora:
       EOF
     - meson setup --cross-file android-cross-file.txt build
     - meson compile --verbose -C build
+
+meson macOS:
+  tags:
+    - gst-macos-10.15
+  artifacts:
+    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
+    expire_in: '5 days'
+    when: 'always'
+    paths:
+      - "build/meson-logs/*txt"
+      - "build/meson-private/*pc"
+  before_script:
+    - pip3 install --upgrade pip
+    # Make sure meson is up to date
+    - pip3 install -U meson
+    # Need to install certificates for python
+    - pip3 install --upgrade certifi
+    # Anther way to install certificates
+    - open /Applications/Python\ 3.8/Install\ Certificates.command
+    # Get ninja
+    - pip3 install -U ninja
+  script:
+    - CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
+    # pixman region-test fails to link on macOS
+    - meson setup -Dpixman:tests=disabled build
+    - meson compile --verbose -C build
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')


More information about the cairo-commit mailing list