glib: fix installing gdb scripts

the disk space cost is less than 20Kb

They provide pretty printers for datascructures likes hash tables in
gdb.

To check that the scripts are loaded:
run gdb on any glib application (for example gio from the bin output)
run info auto-load python-scripts
observe scripts whose filename is libglib-...-gdb.py
This commit is contained in:
Guillaume Girol 2024-05-11 12:00:00 +00:00
parent f1010e0469
commit 6ccd956fd4
2 changed files with 30 additions and 0 deletions

View File

@ -111,6 +111,12 @@ stdenv.mkDerivation (finalAttrs: {
# 3. Tools for desktop environment that cannot go to $bin due to $out depending on them ($out)
# * gio-launch-desktop
./split-dev-programs.patch
# Tell Meson to install gdb scripts next to the lib
# GDB only looks there and in ${gdb}/share/gdb/auto-load,
# and by default meson installs in to $out/share/gdb/auto-load
# which does not help
./gdb_script.patch
];
outputs = [ "bin" "out" "dev" "devdoc" ];
@ -208,6 +214,7 @@ stdenv.mkDerivation (finalAttrs: {
postInstall = ''
moveToOutput "share/glib-2.0" "$dev"
moveToOutput "share/glib-2.0/gdb" "$out"
substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev"
sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|"

View File

@ -0,0 +1,23 @@
diff --git a/glib/meson.build b/glib/meson.build
index b2dd569e1..b013991a1 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -541,7 +540,7 @@ configure_file(
input: 'libglib-gdb.py.in',
output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version),
configuration: gdb_conf,
- install_dir: gdb_install_dir,
+ install_dir: glib_libdir,
install_tag: 'devel',
install: gdb_install,
)
diff --git a/gobject/meson.build b/gobject/meson.build
@@ -185,7 +184,7 @@ configure_file(
input: 'libgobject-gdb.py.in',
output: 'libgobject-2.0.so.@0@-gdb.py'.format(library_version),
configuration: gdb_conf,
- install_dir: gdb_install_dir,
+ install_dir: glib_libdir,
install_tag: 'devel',
install: gdb_install,
)