added core/glib2

This commit is contained in:
Kevin Mihelich 2017-10-11 14:21:53 +00:00
parent dff0099a2a
commit 5fe41a1627
7 changed files with 351 additions and 0 deletions

View file

@ -0,0 +1,85 @@
From a7cbd565aad04f92cbd9ac36696a9d033ae6bcc0 Mon Sep 17 00:00:00 2001
From: Armin K <krejzi@email.com>
Date: Fri, 25 Aug 2017 13:36:23 +0200
Subject: [PATCH] docs: Fix building with meson
This fixes {gio,gobject}-doc ninja targets as well as
install process when gtk-doc is enabled
---
docs/reference/gio/meson.build | 15 ++++++++++++++-
docs/reference/gobject/meson.build | 13 ++++++++++++-
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build
index 7f0467726..8f8dc7ce5 100644
--- a/docs/reference/gio/meson.build
+++ b/docs/reference/gio/meson.build
@@ -52,9 +52,12 @@ if get_option('with-docs') != 'no'
'gnetworkmonitorbase.h',
'gnetworkmonitornetlink.h',
'gnetworkmonitornm.h',
+ 'gnetworkmonitorportal.h',
'gnotificationbackend.h',
'gnotification-private.h',
+ 'gosxappinfo.h',
'gpollfilemonitor.h',
+ 'gproxyresolverportal.h',
'gregistrysettingsbackend.h',
'gresourcefile.h',
'gsettingsbackendinternal.h',
@@ -95,12 +98,22 @@ if get_option('with-docs') != 'no'
configuration: version_conf
)
+ # Meson uses paths relative to meson.source_root() in dependencies,
+ # which is invalid relative to current_source_dir(), so the compile
+ # process fails to find glib headers
+ top_build_dir = meson.build_root()
+ top_source_dir = meson.source_root()
+ glib_top_build_dir = join_paths(top_build_dir, 'glib')
+ glib_top_source_dir = join_paths(top_source_dir, 'glib')
+
+ scan_dep = declare_dependency(include_directories : [ top_source_dir, glib_top_build_dir, glib_top_source_dir ])
+
gnome.gtkdoc('gio',
main_xml : 'gio-docs.xml',
namespace : 'g',
gobject_typesfile : 'gio.types',
mode : 'none',
- dependencies : [libgio_dep, libgobject_dep, libglib_dep],
+ dependencies : [libgio_dep, libgobject_dep, libglib_dep, scan_dep],
src_dir : 'gio',
scan_args : [
'--rebuild-types',
diff --git a/docs/reference/gobject/meson.build b/docs/reference/gobject/meson.build
index 1025e174f..9ec1f9123 100644
--- a/docs/reference/gobject/meson.build
+++ b/docs/reference/gobject/meson.build
@@ -17,12 +17,23 @@ if get_option('with-docs') != 'no'
configuration: version_conf
)
+ # Meson uses paths relative to meson.source_root() in dependencies,
+ # which is invalid relative to current_source_dir(), so the compile
+ # process fails to find glib headers
+ doc_source_dir = meson.current_source_dir()
+ top_build_dir = meson.build_root()
+ top_source_dir = meson.source_root()
+ glib_top_build_dir = join_paths(top_build_dir, 'glib')
+ glib_top_source_dir = join_paths(top_source_dir, 'glib')
+
+ scan_dep = declare_dependency(include_directories : [ doc_source_dir, top_source_dir, glib_top_build_dir, glib_top_source_dir ])
+
gnome.gtkdoc('gobject',
main_xml : 'gobject-docs.xml',
namespace : 'g',
gobject_typesfile : join_paths(meson.current_source_dir(), 'gobject.types'),
mode : 'none',
- dependencies : [libgobject_dep, libglib_dep],
+ dependencies : [libgobject_dep, libglib_dep, scan_dep],
src_dir : 'gobject',
scan_args : [
'--deprecated-guards=G_DISABLE_DEPRECATED',
--
2.14.1

View file

@ -0,0 +1,50 @@
From e36f79439be76f125b67081eb4605b377d738cca Mon Sep 17 00:00:00 2001
Message-Id: <e36f79439be76f125b67081eb4605b377d738cca.1505389490.git.jan.steffens@gmail.com>
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Thu, 14 Sep 2017 07:36:37 +0200
Subject: [PATCH] meson: Fix permissions of installed scripts
configure_file preserves the attributes, so the templates need to be
executable for the (installed) outputs to be executable.
---
gio/gdbus-2.0/codegen/gdbus-codegen.in | 0
gio/gdbus-2.0/codegen/meson.build | 1 -
glib-gettextize.in | 0
gobject/meson.build | 1 -
4 files changed, 2 deletions(-)
mode change 100644 => 100755 gio/gdbus-2.0/codegen/gdbus-codegen.in
mode change 100644 => 100755 glib-gettextize.in
diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
old mode 100644
new mode 100755
diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build
index 0e9ffbdfade70779..93d9106adba17a89 100644
--- a/gio/gdbus-2.0/codegen/meson.build
+++ b/gio/gdbus-2.0/codegen/meson.build
@@ -13,7 +13,6 @@ gdbus_codegen_conf.set('VERSION', glib_version)
gdbus_codegen_conf.set('PYTHON', python.path())
# Install gdbus-codegen executable
-# FIXME: Set permissions
gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
output : 'gdbus-codegen',
install : true,
diff --git a/glib-gettextize.in b/glib-gettextize.in
old mode 100644
new mode 100755
diff --git a/gobject/meson.build b/gobject/meson.build
index 0d39f2bbc36f816e..01f37a33a623f4b8 100644
--- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -76,7 +76,6 @@ python_tools_conf.set('VERSION', glib_version)
python_tools_conf.set('PYTHON', python.path())
foreach tool: python_tools
- # FIXME: Ensure we set the appropriate permissions
tool_bin = configure_file(
input : tool + '.in',
output : tool,
--
2.14.1

100
core/glib2/PKGBUILD Normal file
View file

@ -0,0 +1,100 @@
# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - switch back to autotools/make; meson build is broken for ARM
pkgbase=glib2
pkgname=(glib2 glib2-docs)
pkgver=2.54.1
pkgrel=1
pkgdesc="Low level core library"
url="https://wiki.gnome.org/Projects/GLib"
license=(LGPL2.1)
arch=(i686 x86_64)
depends=(pcre libffi libutil-linux)
makedepends=(gettext gtk-doc zlib shared-mime-info python libelf git util-linux meson)
checkdepends=(desktop-file-utils dbus)
optdepends=('python: for gdbus-codegen and gtester-report'
'libelf: gresource inspection tool')
options=(!emptydirs)
_commit=5fc5a3eaa6fc2ab23a3585cf22799adae642afa7 # tags/2.54.1^0
source=("git+https://git.gnome.org/browse/glib#commit=$_commit"
0001-docs-Fix-building-with-meson.patch
0001-meson-Fix-permissions-of-installed-scripts.patch
libs.diff
noisy-glib-compile-schemas.diff
glib-compile-schemas.hook gio-querymodules.hook)
sha256sums=('SKIP'
'8b289f3e1a5a3b29d310d45610468199acfe6f2b38a0d1be38c9224437a0e40c'
'12b1a2f4e304e4c03e48ae9564d73ae38619bbb7711a013138939ff8e5cc2327'
'05cce54fa4a728e2f0db45326ba3d4f303c2cc4d0cc68506e338906ad17ea7f0'
'81a4df0b638730cffb7fa263c04841f7ca6b9c9578ee5045db6f30ff0c3fc531'
'e1123a5d85d2445faac33f6dae1085fdd620d83279a4e130a83fe38db52b62b3'
'5ba204a2686304b1454d401a39a9d27d09dd25e4529664e3fd565be3d439f8b6')
pkgver() {
cd glib
git describe --tags | sed 's/-/+/g'
}
prepare() {
mkdir -p build glib2-docs/usr/share
cd glib
# https://bugzilla.gnome.org/show_bug.cgi?id=786796
patch -Np1 -i ../0001-docs-Fix-building-with-meson.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=787671
patch -Np1 -i ../0001-meson-Fix-permissions-of-installed-scripts.patch
# Unbreak .pc files when built with meson
# Fix gdb scripts install
patch -Np1 -i ../libs.diff
# Suppress noise from glib-compile-schemas.hook
patch -Np1 -i ../noisy-glib-compile-schemas.diff
NOCONFIGURE=1 ./autogen.sh
}
build() {
# cd build
# arch-meson ../glib
# ninja
cd glib
./configure --prefix=/usr --libdir=/usr/lib \
--sysconfdir=/etc \
--with-pcre=system \
--disable-fam \
--enable-gtk-doc \
$(check_option debug y && echo --enable-debug=yes)
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
check() {
cd build
meson test -t 2
}
package_glib2() {
# cd build
# DESTDIR="$pkgdir" ninja install
cd glib
make DESTDIR="$pkgdir" install
mv "$pkgdir/usr/share/gtk-doc" "$srcdir/glib2-docs/usr/share"
# install hooks
install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 ../*.hook
}
package_glib2-docs() {
pkgdesc="Documentation for GLib"
depends=()
optdepends=()
license+=(custom)
mv glib2-docs/* "$pkgdir"
install -Dt "$pkgdir/usr/share/licenses/glib2-docs" -m644 glib/docs/reference/COPYING
}

View file

@ -0,0 +1,11 @@
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/gio/modules/*.so
[Action]
Description = Updating GIO module cache...
When = PostTransaction
Exec = /usr/bin/gio-querymodules /usr/lib/gio/modules

View file

@ -0,0 +1,12 @@
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/share/glib-2.0/schemas/*.gschema.xml
Target = usr/share/glib-2.0/schemas/*.gschema.override
[Action]
Description = Compiling GSettings XML schema files...
When = PostTransaction
Exec = /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas

69
core/glib2/libs.diff Normal file
View file

@ -0,0 +1,69 @@
diff --git i/glib/meson.build w/glib/meson.build
index 1da0bcd3cc601b9e..5cf8f747e8b15038 100644
--- i/glib/meson.build
+++ w/glib/meson.build
@@ -284,7 +284,7 @@ configure_file(
output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version),
configuration: gdb_conf,
install: true,
- install_dir: join_paths(get_option('datadir'), 'gdb/auto-load' + get_option('libdir'))
+ install_dir: join_paths(get_option('datadir'), 'gdb/auto-load' + glib_libdir)
)
if enable_systemtap
diff --git i/gmodule/meson.build w/gmodule/meson.build
index 191bca2446f9977e..551956599a616157 100644
--- i/gmodule/meson.build
+++ w/gmodule/meson.build
@@ -37,7 +37,7 @@ elif cc.has_function('NSLinkModule')
elif cc.links(dlopen_dlsym_test_code, args : '-ldl', name : 'dlopen() and dlsym() in libdl')
g_module_impl = 'G_MODULE_IMPL_DL'
libdl_dep = cc.find_library('dl')
- g_module_lib_args = '-ldl'
+ g_module_lib_args = ['-ldl']
endif
# additional checks for G_MODULE_IMPL_DL
@@ -72,8 +72,11 @@ if g_module_impl == ''
message('WARNING: No suitable GModule implementation found!')
endif
+# For pc files
+glib_conf.set('G_MODULE_SUPPORTED', g_module_impl == '0' ? 'false' : 'true')
+glib_conf.set('G_MODULE_LIBS', ' '.join(g_module_lib_args))
+
gmoduleconf_conf.set('G_MODULE_IMPL', g_module_impl)
-gmoduleconf_conf.set('G_MODULE_SUPPORTED', g_module_impl != '0')
gmoduleconf_conf.set('G_MODULE_HAVE_DLERROR', g_module_have_dlerror)
gmoduleconf_conf.set('G_MODULE_NEED_USCORE', g_module_need_uscore)
gmoduleconf_conf.set('G_MODULE_BROKEN_RTLD_GLOBAL', g_module_broken_rtld_global)
diff --git i/gobject/meson.build w/gobject/meson.build
index aecca57c743d5956..0d39f2bbc36f816e 100644
--- i/gobject/meson.build
+++ w/gobject/meson.build
@@ -102,7 +102,7 @@ configure_file(
output: 'libgobject-2.0.so.@0@-gdb.py'.format(library_version),
configuration: gdb_conf,
install: true,
- install_dir: join_paths(get_option('datadir'), 'gdb/auto-load/' + get_option('libdir'))
+ install_dir: join_paths(get_option('datadir'), 'gdb/auto-load/' + glib_libdir)
)
if enable_systemtap
diff --git i/meson.build w/meson.build
index 65ab92f023257aef..ea3f64c5e8c47bcc 100644
--- i/meson.build
+++ w/meson.build
@@ -1533,6 +1533,12 @@ glib_conf.set('GIO_MODULE_DIR', '${libdir}/gio/modules')
# @G_MODULE_LIBS@ @SELINUX_LIBS@ @COCOA_LIBS@ @CARBON_LIBS@ @G_LIBS_EXTRA@
# @PCRE_REQUIRES@ @GLIB_EXTRA_CFLAGS@ @G_THREAD_CFLAGS@
+# HACK
+glib_conf.set('G_THREAD_LIBS', '-pthread')
+glib_conf.set('G_THREAD_CFLAGS', '-pthread')
+glib_conf.set('G_MODULE_LDFLAGS', '-Wl,--export-dynamic')
+glib_conf.set('PCRE_REQUIRES', 'libpcre')
+
# Tracing: dtrace
want_dtrace = get_option('enable-dtrace')
enable_dtrace = false

View file

@ -0,0 +1,24 @@
diff --git i/gio/glib-compile-schemas.c w/gio/glib-compile-schemas.c
index b8de0907248f6860..130f89b1728f7932 100644
--- i/gio/glib-compile-schemas.c
+++ w/gio/glib-compile-schemas.c
@@ -1219,19 +1219,6 @@ parse_state_start_schema (ParseState *state,
return;
}
- if (path && (g_str_has_prefix (path, "/apps/") ||
- g_str_has_prefix (path, "/desktop/") ||
- g_str_has_prefix (path, "/system/")))
- {
- gchar *message = NULL;
- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. "
- "Paths starting with "
- "“/apps/”, “/desktop/” or “/system/” are deprecated."),
- id, path);
- g_printerr ("%s\n", message);
- g_free (message);
- }
-
state->schema_state = schema_state_new (path, gettext_domain,
extends, extends_name, list_of);