[gnome-contacts/wip/nielsdg/fix-eds-canberra] Make Cheese an optional dependency



commit b195b59486250ebf538bb226b8f8862f3610c6d7
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Apr 19 14:17:59 2020 +0200

    Make Cheese an optional dependency
    
    libcanberra-gtk got removed in the latest Flatpak runtime (3.38), so we
    can't build cheese as it hard depends on it. Luckily, we don't
    hard-depend on cheese, so let's get rid of it (for now).
    
    As an extra, this commit also makes Cheese an optional dependency,
    making it a bit easier to build it at the first go (without installing
    cheese-devel) and a shorter CI time.

 data/flatpak/org.gnome.Contacts.Devel.json | 15 ---------------
 meson.build                                |  6 ++----
 meson_options.txt                          |  2 +-
 src/meson.build                            |  4 ++--
 4 files changed, 5 insertions(+), 22 deletions(-)
---
diff --git a/data/flatpak/org.gnome.Contacts.Devel.json b/data/flatpak/org.gnome.Contacts.Devel.json
index 1b1dae2..ef2af27 100644
--- a/data/flatpak/org.gnome.Contacts.Devel.json
+++ b/data/flatpak/org.gnome.Contacts.Devel.json
@@ -165,21 +165,6 @@
                 }
             ]
         },
-        {
-            "name": "cheese",
-            "buildsystem": "meson",
-            "config-opts": [
-                "-Dgtk_doc=false",
-                "-Dintrospection=true",
-                "-Dman=false"
-            ],
-            "sources": [
-                {
-                    "type": "git",
-                    "url": "https://gitlab.gnome.org/GNOME/cheese.git";
-                }
-            ]
-        },
         {
             "name": "libhandy",
             "buildsystem": "meson",
diff --git a/meson.build b/meson.build
index 541fa38..f7b93fc 100644
--- a/meson.build
+++ b/meson.build
@@ -46,10 +46,8 @@ libebook = dependency('libebook-1.2', version: '>=' + min_eds_version)
 libedataserver = dependency('libedataserver-1.2', version: '>=' + min_eds_version)
 libedataserverui = dependency('libedataserverui-1.2', version: '>=' + min_eds_version)
 
-if get_option('cheese')
-  cheese = dependency('cheese')
-  cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91')
-endif
+cheese = dependency('cheese', required: get_option('cheese'))
+cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91', required: get_option('cheese'))
 
 if get_option('telepathy')
   folks_telepathy = dependency('folks-telepathy', version: '>=' + min_folks_version)
diff --git a/meson_options.txt b/meson_options.txt
index b83a1c7..0d89064 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,5 @@
 option('profile', type: 'combo', choices: [ 'default', 'development' ], value: 'default', description: 
'Indicate whether this is a nightly build (used for CI purposes)')
-option('cheese', type: 'boolean', value: true, description: 'Enable cheese webcam support.')
+option('cheese', type: 'feature', value: 'auto', description: 'Enable cheese webcam support to create an 
avatar if allowed.')
 option('telepathy', type: 'boolean', value: false, description: 'Enable Telepathy call/chat support.')
 option('manpage', type: 'boolean', value: true, description: 'Enable building man pages.')
 option('docs', type: 'boolean', value: false, description: 'Whether to build the valadoc docs.')
diff --git a/src/meson.build b/src/meson.build
index c663c61..ba5dd1b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,7 +47,7 @@ contacts_deps = [
 ]
 
 # Add extra stuff given a certain set of options
-if get_option('cheese')
+if cheese_dep.found() and cheese_gtk_dep.found()
   contacts_deps += [ cheese, cheese_gtk ]
   contacts_vala_args += [ '-D', 'HAVE_CHEESE' ]
 endif
@@ -103,7 +103,7 @@ contacts_c_sources = [
   'cc-crop-area.c',
 ]
 
-if get_option('cheese')
+if cheese_dep.found() and cheese_gtk_dep.found()
   contacts_c_sources += 'cheese-flash.c'
 endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]