File 0001-Add-libgtherm-dependency.patch of Package gnome-usage-3.38.1-1.45

From 792b2465d27c4cbc851ef1675f6661cb741fc987 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Thu, 2 Jul 2020 20:43:33 +0200
Subject: [PATCH 1/2] Add libgtherm dependency

This will be used by the thermal view
---
 .gitignore                 |  3 ++-
 meson.build                | 22 ++++++++++++++++++++++
 org.gnome.Usage.json       | 13 +++++++++++++
 src/meson.build            |  1 +
 subprojects/libgtherm.wrap |  5 +++++
 5 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/libgtherm.wrap

diff --git a/.gitignore b/.gitignore
index 870c299..bd7f5b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,5 @@ build
 .ccls-cache
 .gdb_history
 compile_commands.json
-*~
\ No newline at end of file
+subprojects/gtherm/
+*~
diff --git a/meson.build b/meson.build
index d2f40ac..25e11fa 100644
--- a/meson.build
+++ b/meson.build
@@ -8,6 +8,7 @@ project(
 cc = meson.get_compiler('c')
 valac = meson.get_compiler('vala')
 
+libgtherm_dep = dependency('libgtherm-0.0', required: false)
 glib_dep = dependency('glib-2.0', version : '>=2.38')
 gobject_dep = dependency('gobject-2.0')
 gio_dep = dependency('gio-2.0')
@@ -41,6 +42,27 @@ else
   libhandy_vapidir = ''
 endif
 
+if not libgtherm_dep.found()
+  libgtherm_subproj = subproject(
+    'libgtherm',
+    default_options: [
+      'gtk_doc=false',
+    ]
+  )
+
+  # When using libgtherm as subproject, make sure we get the VAPI file
+  libgtherm_dep = declare_dependency(
+    dependencies: [
+      libgtherm_subproj.get_variable('libgtherm_dep'),
+      libgtherm_subproj.get_variable('libgtherm_vapi'),
+    ]
+  )
+
+  libgtherm_vapidir = join_paths(meson.build_root(), 'subprojects', 'libgtherm', 'src')
+else
+  libgtherm_vapidir = ''
+endif
+
 gnome = import('gnome')
 i18n = import('i18n')
 
diff --git a/org.gnome.Usage.json b/org.gnome.Usage.json
index b8de5b2..ed7f9bb 100644
--- a/org.gnome.Usage.json
+++ b/org.gnome.Usage.json
@@ -39,6 +39,19 @@
                 }
             ]
         },
+        {
+            "name" : "libgtherm",
+            "buildsystem" : "meson",
+            "config-opts" : [
+                "-Dgtk_doc=false"
+            ],
+            "sources" : [
+                {
+                    "type" : "git",
+                    "url" : "https://source.puri.sm/Librem5/gtherm.git"
+                }
+            ]
+        },
         {
             "name" : "libhandy",
             "buildsystem" : "meson",
diff --git a/src/meson.build b/src/meson.build
index 935e2d6..0c29986 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -56,6 +56,7 @@ deps = [
   libgtop_dep,
   tracker_dep,
   libdazzle_dep,
+  libgtherm_dep,
   libhandy_dep,
   cc.find_library('m'),
   valac.find_library('config', dirs: vapi_dir),
diff --git a/subprojects/libgtherm.wrap b/subprojects/libgtherm.wrap
new file mode 100644
index 0000000..79b76f4
--- /dev/null
+++ b/subprojects/libgtherm.wrap
@@ -0,0 +1,5 @@
+[wrap-git]
+directory=gtherm
+url=https://source.puri.sm/Librem5/gtherm.git
+revision=origin/master
+
-- 
2.30.0

openSUSE Build Service is sponsored by