mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
Revert "meson: Use gnome.mkenum_simple()"
This reverts commit 756b424cce
.
The freedesktop SDK, which is used by gnome-build-meta, only has Meson
0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment,
GLib is not buildable in gnome-build-meta and hence can’t be tested in
nightly pipelines against other projects, etc.
That’s bad for testing GLib.
It’s arguably bad that we’re restricted to using an older version of
Meson than shipped by Debian Testing, but that’s a separate discussion
to be had.
Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥
0.64. This also means reverting the simplifications to use of
`gnome.mkenum_simple()`.
See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064
This commit is contained in:
parent
78d0ac4237
commit
b646b1cab7
@ -19,8 +19,6 @@
|
||||
* Author: Ryan Lortie <desrt@desrt.ca>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
|
||||
#error "Only <gio/gio.h> can be included directly."
|
||||
#endif
|
||||
|
63
gio/gioenumtypes.c.template
Normal file
63
gio/gioenumtypes.c.template
Normal file
@ -0,0 +1,63 @@
|
||||
/*** BEGIN file-header ***/
|
||||
/*
|
||||
* Copyright © 2007 Red Hat, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Authors: Matthias Clasen <mclasen@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "gioenumtypes.h"
|
||||
#include <gio.h>
|
||||
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GType
|
||||
@enum_name@_get_type (void)
|
||||
{
|
||||
static gsize static_g_define_type_id = 0;
|
||||
|
||||
if (g_once_init_enter (&static_g_define_type_id))
|
||||
{
|
||||
static const G@Type@Value values[] = {
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN value-production ***/
|
||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
/*** END value-production ***/
|
||||
|
||||
/*** BEGIN value-tail ***/
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
GType g_define_type_id =
|
||||
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
g_once_init_leave (&static_g_define_type_id, g_define_type_id);
|
||||
}
|
||||
|
||||
return static_g_define_type_id;
|
||||
}
|
||||
|
||||
/*** END value-tail ***/
|
46
gio/gioenumtypes.h.template
Normal file
46
gio/gioenumtypes.h.template
Normal file
@ -0,0 +1,46 @@
|
||||
/*** BEGIN file-header ***/
|
||||
/*
|
||||
* Copyright © 2007 Red Hat, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Authors: Matthias Clasen <mclasen@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __GIO_ENUM_TYPES_H__
|
||||
#define __GIO_ENUM_TYPES_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gio/gio-visibility.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GIO_AVAILABLE_IN_ALL GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN file-tail ***/
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIO_ENUM_TYPES_H__ */
|
||||
/*** END file-tail ***/
|
@ -765,16 +765,29 @@ gio_headers += settings_headers
|
||||
gio_headers += gdbus_headers
|
||||
install_headers(gio_headers, install_dir : gio_includedir)
|
||||
|
||||
mkenums_header_prefix = '#include <gio/gio-visibility.h>'
|
||||
gioenumtypes = gnome.mkenums_simple('gioenumtypes',
|
||||
sources : gio_headers,
|
||||
decorator : 'GIO_AVAILABLE_IN_ALL',
|
||||
body_prefix : mkenums_body_prefix,
|
||||
header_prefix : mkenums_header_prefix,
|
||||
install_header : true,
|
||||
install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'),
|
||||
)
|
||||
gioenumtypes_h = gioenumtypes[1]
|
||||
# We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums
|
||||
# in PATH, which means you can't bootstrap glib with its own glib-mkenums.
|
||||
gioenumtypes_h = custom_target('gioenumtypes_h',
|
||||
output : 'gioenumtypes.h',
|
||||
capture : true,
|
||||
input : gio_headers,
|
||||
install : true,
|
||||
install_dir : gio_includedir,
|
||||
# FIXME: Not needed with Meson >= 0.64.0
|
||||
install_tag: 'devel',
|
||||
command : [python, glib_mkenums,
|
||||
'--template', files('gioenumtypes.h.template'),
|
||||
'@INPUT@', gnetworking_h])
|
||||
|
||||
gioenumtypes_c = custom_target('gioenumtypes_c',
|
||||
output : 'gioenumtypes.c',
|
||||
capture : true,
|
||||
input : gio_headers,
|
||||
depends : [gioenumtypes_h],
|
||||
command : [python, glib_mkenums,
|
||||
'--template', files('gioenumtypes.c.template'),
|
||||
'@INPUT@', gnetworking_h])
|
||||
|
||||
gioenumtypes_dep = declare_dependency(sources : [gioenumtypes_h, glib_enumtypes_h, gvisibility_h])
|
||||
|
||||
# inotify
|
||||
@ -827,7 +840,7 @@ else
|
||||
endif
|
||||
|
||||
libgio = library('gio-2.0',
|
||||
gioenumtypes, gnetworking_h, gio_sources,
|
||||
gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources,
|
||||
gio_dtrace_hdr, gio_dtrace_obj,
|
||||
version : library_version,
|
||||
soversion : soversion,
|
||||
|
47
gobject/glib-enumtypes.c.template
Normal file
47
gobject/glib-enumtypes.c.template
Normal file
@ -0,0 +1,47 @@
|
||||
/*** BEGIN file-header ***/
|
||||
#include "config.h"
|
||||
#include "glib-enumtypes.h"
|
||||
#include <glib-object.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-tail ***/
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/*** END file-tail ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@filename@" */
|
||||
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GType
|
||||
@enum_name@_get_type (void)
|
||||
{
|
||||
static gsize static_g_define_type_id = 0;
|
||||
|
||||
if (g_once_init_enter (&static_g_define_type_id))
|
||||
{
|
||||
static const G@Type@Value values[] = {
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN value-production ***/
|
||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
/*** END value-production ***/
|
||||
|
||||
/*** BEGIN value-tail ***/
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
GType g_define_type_id =
|
||||
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
g_once_init_leave (&static_g_define_type_id, g_define_type_id);
|
||||
}
|
||||
|
||||
return static_g_define_type_id;
|
||||
}
|
||||
|
||||
/*** END value-tail ***/
|
24
gobject/glib-enumtypes.h.template
Normal file
24
gobject/glib-enumtypes.h.template
Normal file
@ -0,0 +1,24 @@
|
||||
/*** BEGIN file-header ***/
|
||||
#ifndef __GOBJECT_ENUM_TYPES_H__
|
||||
#define __GOBJECT_ENUM_TYPES_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GOBJECT_AVAILABLE_IN_2_60 GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN file-tail ***/
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GOBJECT_ENUM_TYPES_H__ */
|
||||
/*** END file-tail ***/
|
@ -109,32 +109,39 @@ endforeach
|
||||
#
|
||||
# For now, we only include gunicode.h here, since GScriptType is needed for
|
||||
# Pango. More headers can be added as needed in future.
|
||||
#
|
||||
# We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums
|
||||
# in PATH, which means you can't bootstrap glib with its own glib-mkenums.
|
||||
glib_enumtypes_input_headers = files(
|
||||
'../glib/gunicode.h',
|
||||
)
|
||||
|
||||
mkenums_body_prefix = '''
|
||||
#ifndef GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
#include "config.h"
|
||||
'''
|
||||
|
||||
glib_enumtypes = gnome.mkenums_simple('glib-enumtypes',
|
||||
sources : glib_enumtypes_input_headers,
|
||||
decorator : 'GOBJECT_AVAILABLE_IN_2_60',
|
||||
body_prefix : mkenums_body_prefix,
|
||||
install_header : true,
|
||||
glib_enumtypes_h = custom_target('glib_enumtypes_h',
|
||||
output : 'glib-enumtypes.h',
|
||||
capture : true,
|
||||
input : glib_enumtypes_input_headers,
|
||||
install : true,
|
||||
install_dir : join_paths(get_option('includedir'), 'glib-2.0/gobject'),
|
||||
)
|
||||
glib_enumtypes_h = glib_enumtypes[1]
|
||||
install_tag: 'devel',
|
||||
command : [python, glib_mkenums,
|
||||
'--template', files('glib-enumtypes.h.template'),
|
||||
'@INPUT@'])
|
||||
|
||||
glib_enumtypes_c = custom_target('glib_enumtypes_c',
|
||||
output : 'glib-enumtypes.c',
|
||||
capture : true,
|
||||
input : glib_enumtypes_input_headers,
|
||||
depends : [glib_enumtypes_h],
|
||||
command : [python, glib_mkenums,
|
||||
'--template', files('glib-enumtypes.c.template'),
|
||||
'@INPUT@'])
|
||||
|
||||
# Expose as variable to be used by gobject-introspection
|
||||
# when it includes GLib as a subproject
|
||||
glib_types_h = files('glib-types.h')
|
||||
|
||||
libgobject = library('gobject-2.0',
|
||||
gobject_dtrace_obj, gobject_dtrace_hdr, glib_enumtypes,
|
||||
gobject_dtrace_obj, gobject_dtrace_hdr, glib_enumtypes_h, glib_enumtypes_c,
|
||||
sources : gobject_sources,
|
||||
version : library_version,
|
||||
soversion : soversion,
|
||||
|
@ -9,8 +9,6 @@ project('glib', 'c',
|
||||
]
|
||||
)
|
||||
|
||||
gnome = import('gnome')
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
c_standards = {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user