--- /dev/null
+From 4d5ddcdb9c03d4e829fe7080e497a00f0b379eff Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 14 Jun 2020 17:33:31 +0200
+Subject: [PATCH] meson: add introspection option
+
+This will allow the user to build granite without gobject-introspection
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/elementary/granite/pull/410]
+---
+ lib/meson.build | 38 ++++++++++++++++++++------------------
+ meson_options.txt | 1 +
+ 2 files changed, 21 insertions(+), 18 deletions(-)
+
+diff --git a/lib/meson.build b/lib/meson.build
+index a9fc4ed4..770feeb5 100644
+--- a/lib/meson.build
++++ b/lib/meson.build
+@@ -98,24 +98,26 @@ install_data(
+ install_dir: include_dir
+ )
+
+-# typelib generation isn't automated yet
+-g_ir_compiler = find_program('g-ir-compiler')
+-custom_target(
+- granite_typelib,
+- command: [
+- g_ir_compiler,
+- '--shared-library',
+- '@PLAINNAME@',
+- '--output',
+- '@OUTPUT@',
+- join_paths(meson.current_build_dir(), granite_gir),
+- ],
+- input: libgranite,
+- output: granite_typelib,
+- depends: libgranite,
+- install: true,
+- install_dir: join_paths(get_option('libdir'), 'girepository-1.0'),
+-)
++if get_option('introspection')
++ # typelib generation isn't automated yet
++ g_ir_compiler = find_program('g-ir-compiler')
++ custom_target(
++ granite_typelib,
++ command: [
++ g_ir_compiler,
++ '--shared-library',
++ '@PLAINNAME@',
++ '--output',
++ '@OUTPUT@',
++ join_paths(meson.current_build_dir(), granite_gir),
++ ],
++ input: libgranite,
++ output: granite_typelib,
++ depends: libgranite,
++ install: true,
++ install_dir: join_paths(get_option('libdir'), 'girepository-1.0'),
++ )
++endif
+
+ libgranite_dep = declare_dependency(
+ link_with: libgranite,
+diff --git a/meson_options.txt b/meson_options.txt
+index 9d9f62e9..bd1a1d6f 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1 +1,2 @@
+ option('documentation', type: 'boolean', value: false, description: 'generate documentation with gtk-doc and valadoc')
++option('introspection', type: 'boolean', value: true, description: 'Whether to build introspection files')
+--
+2.26.2
+
#
################################################################################
-GRANITE_VERSION_MAJOR = 0.4
-GRANITE_VERSION = $(GRANITE_VERSION_MAJOR).1
-GRANITE_SITE = https://launchpad.net/granite/$(GRANITE_VERSION_MAJOR)/$(GRANITE_VERSION)/+download
-GRANITE_SOURCE = granite-$(GRANITE_VERSION).tar.xz
+GRANITE_VERSION = 5.4.0
+GRANITE_SITE = $(call github,elementary,granite,$(GRANITE_VERSION))
GRANITE_DEPENDENCIES = host-pkgconf host-vala libgee libglib2 libgtk3
GRANITE_INSTALL_STAGING = YES
GRANITE_LICENSE = LGPL-3.0+
GRANITE_LICENSE_FILES = COPYING
-$(eval $(cmake-package))
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GRANITE_CONF_OPTS += -Dintrospection=true
+GRANITE_DEPENDENCIES += gobject-introspection
+else
+GRANITE_CONF_OPTS += -Dintrospection=false
+endif
+
+$(eval $(meson-package))