forked from pool/polari
Pushing GNOME 45.rc packages OBS-URL: https://build.opensuse.org/request/show/1109857 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/polari?expand=0&rev=123
53 lines
1.4 KiB
Diff
53 lines
1.4 KiB
Diff
From 41256a5842dc9d95494bf0bbd6e97875b817197f Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
Date: Fri, 16 Jun 2023 21:40:24 +0200
|
|
Subject: [PATCH] build: Only define GjsContext autocleanup if necessary
|
|
|
|
Gjs now calls G_DEFINE_AUTOPTR_CLEANUP_FUNC itself, so only define
|
|
it for older versions to avoid a compiler warning.
|
|
|
|
Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/274>
|
|
---
|
|
meson.build | 8 ++++++++
|
|
src/polari.c | 2 ++
|
|
2 files changed, 10 insertions(+)
|
|
|
|
diff --git a/meson.build b/meson.build
|
|
index b667f931..a2f74160 100644
|
|
--- a/meson.build
|
|
+++ b/meson.build
|
|
@@ -42,8 +42,16 @@ conf = configuration_data()
|
|
conf.set_quoted('PKGLIBDIR', pkglibdir)
|
|
|
|
cc = meson.get_compiler('c')
|
|
+gjs_has_autocleanup = cc.compiles(
|
|
+'''
|
|
+#include <gjs/gjs.h>
|
|
+void main(void) { g_autoptr(GjsContext) context = NULL; }
|
|
+''',
|
|
+ dependencies: [gjs])
|
|
+
|
|
conf.set('HAVE_STRCASESTR', cc.has_function('strcasestr'))
|
|
conf.set('SNAPSHOT', get_option('snapshot'))
|
|
+conf.set('GJS_HAS_AUTOCLEANUP', gjs_has_autocleanup)
|
|
|
|
config_h = declare_dependency(
|
|
sources: configure_file(
|
|
diff --git a/src/polari.c b/src/polari.c
|
|
index 8cb9d454..8f3ddc18 100644
|
|
--- a/src/polari.c
|
|
+++ b/src/polari.c
|
|
@@ -3,7 +3,9 @@
|
|
|
|
#include "config.h"
|
|
|
|
+#ifndef GJS_HAS_AUTOCLEANUP
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GjsContext, g_object_unref)
|
|
+#endif
|
|
|
|
#define JS_MAIN "resource:///org/gnome/Polari/js/main.js"
|
|
|
|
--
|
|
GitLab
|
|
|