GLib-2.86.4

#### Gaming Linux® From Scratch - Version 13.0

### Chapter 5. Security

- Prev

  duktape-2.7.0

- Next

  ICU-78.2

- Up
- Home

# GLib-2.86.4

## Introduction to GLib

The GLib package contains low-level libraries useful for providing data structure handling for C, portability wrappers and interfaces for runtime functionality such as an event loop, threads, dynamic loading and an object system.

### Note

This may take a while to build. Feel free to do something else while this is building.

### Important

For the lib32 installation instructions, they require new Meson cross files from MLFS, as `--libdir=/usr/lib32` has been moved to the cross files and no longer appear in the instructions. Install the new cross files so that 32-bit libraries don't get installed in `/usr/lib`.

- Download: https://download.gnome.org/sources/glib/2.86/glib-2.86.4.tar.xz

### Additional Downloads

GObject Introspection (Recommended)

- Download: https://download.gnome.org/sources/gobject-introspection/1.86/gobject-introspection-1.86.0.tar.xz

Required patch to fix memory corruption issues exposed by glibc-2.43:

- Required patch: https://www.linuxfromscratch.org/glfs/view/13.0/download/glib/glib-2.86.4-upstream_fixes-1.patch

Patch for Log Level Selection (Optional)

- Optional patch: https://www.linuxfromscratch.org/glfs/view/13.0/download/glib/glib-skip_warnings-1.patch

### GLib Dependencies

Recommended
shared-mime-info-2.4 and desktop-file-utils-0.28 (both at runtime)
Optional
libxslt (for man-pages)

## Installation of GLib

First, fix memory corruption issues exposed by glibc-2.43:

    patch -Np1 -i ../glib-2.86.4-upstream_fixes-1.patch

If desired, apply the optional patch. In many cases, applications that use this library, either directly or indirectly via other libraries. This patch enables the use of an environment variable, `GLIB_LOG_LEVEL`, that suppresses unwanted messages. The value of the variable is a digit that corresponds to:

1 Alert
2 Critical
3 Error
4 Warning
5 Notice

For instance `export GLIB_LOG_LEVEL=4` will skip output of Warning and Notice messages (and Info/Debug messages if they are turned on). If `GLIB_LOG_LEVEL` is not defined, normal message output will not be affected.

    patch -Np1 -i ../glib-skip_warnings-1.patch

### Warning

If a previous version of glib is installed, move the headers out of the way so that later packages do not encounter conflicts:

    if [ -e /usr/include/glib-2.0 ]; then
        rm -rf /usr/include/glib-2.0.old &&
        mv -vf /usr/include/glib-2.0{,.old}
    fi

Install GLib by running the following commands:

    mkdir build &&
    cd    build &&

    meson setup --prefix=/usr             \
                --buildtype=release       \
                -D introspection=disabled \
                -D glib_debug=disabled    \
                -D man-pages=disabled     \
                -D tests=false            \
                -D sysprof=disabled       \
                .. &&
    ninja

As the `root` user, install this package for the first time to allow building GObject Introspection:

    ninja install

Build GObject Introspection:

    tar xf ../../gobject-introspection-1.86.0.tar.xz &&

    meson setup gobject-introspection-1.86.0 gi-build \
                --prefix=/usr --buildtype=release     &&
    ninja -C gi-build

As the `root` user, install GObject Introspection for generating the introspection data of GLib libraries (required by various packages using Glib, especially some GNOME packages):

    ninja -C gi-build install

Now generate the introspection data:

    meson configure -D introspection=enabled &&
    ninja

As the `root` user, install this package again for the introspection data:

    ninja install

## lib32 Installation of GLib

Install lib32-GLib by running the following commands:

    rm -rf * &&
    meson setup --prefix=/usr             \
                --buildtype=release       \
                --cross-file=lib32        \
                -D introspection=disabled \
                -D glib_debug=disabled    \
                -D man-pages=disabled     \
                -D tests=false            \
                -D sysprof=disabled       \
                .. &&

    ninja

Now, as the `root` user:

    DESTDIR=$PWD/DESTDIR ninja install    &&
    cp -vR DESTDIR/usr/lib32/* /usr/lib32 &&
    rm -rf DESTDIR                        &&
    ldconfig

## Command Explanations

### Note

Inspect `meson_options.txt` or `meson.options` for a full list of options.

`--buildtype=release`: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

`-D man-pages=disabled`: This switch causes the build to create and install the package man pages.

`-D tests=false`: This switch causes tests to be built. It is disabled because it is beyond the scope of GLFS. If you'd like to test glib, reference BLFS's glib page.

`-D glib_debug=disabled`: This switch causes the build to not include some expensive checks for debugging in the built programs and libraries.

`-D sysprof=disabled`: This switch disables the tracing support for sysprof. Remove this option if you want the tracing support. Note that if sysprof is not installed, removing this option will cause the build system to download a copy of sysprof from the Internet.

## Contents

### GLib Contents

Installed Programs: gapplication, gdbus, gdbus-codegen, gi-compile-repository, gi-decompile-typelib, gi-inspect-typelib gio, gio-querymodules, glib-compile-resources, glib-compile-schemas, glib-genmarshal, glib-gettextize, glib-mkenums, gobject-query, gresource, gsettings, gtester, and gtester-report
Installed Libraries: libgio-2.0, libgirepository-2.0, libglib-2.0, libgmodule-2.0, libgobject-2.0, and libgthread-2.0
Installed Directories: /usr/include/gio-unix-2.0, /usr/include/glib-2.0, /usr/lib/gio, /usr/lib/glib-2.0, /usr/share/glib-2.0, and /usr/share/doc/glib-2.86.4 (optional)

### GObject Introspection Contents

Installed Programs: g-ir-annotation-tool, g-ir-compiler, g-ir-doc-tool (optional), g-ir-generate, g-ir-inspect, and g-ir-scanner
Installed Libraries: libgirepository-1.0 and _giscanner.cpython-314-<arch>-linux-gnu
Installed Directories: /usr/include/gobject-introspection-1.0, /usr/lib/girepository-1.0, /usr/lib/gobject-introspection, /usr/share/gir-1.0, and /usr/share/gobject-introspection-1.0

### Short Descriptions

gapplication | can be used to start applications and to send messages to already-running instances of other applications
gdbus | is a simple tool used for working with D-Bus objects
gdbus-codegen | is used to generate code and/or documentation for one or more D-Bus interfaces
gi-compile-repository | converts one or more GIR files into one or more typelib files
gi-decompile-typelib | is a GIR decompiler that uses the repository API
gi-inspect-typelib | is a utility that gives information about a GI typelib
gio | is a utility that makes many GIO features available from the command line
gio-querymodules | is used to create a `giomodule.cache` file in the listed directories. This file lists the implemented extension points for each module that has been found
glib-compile-resources | is used to read the resource description from a file and the files that it references to create a binary resource bundle that is suitable for use with the GResource API
glib-compile-schemas | is used to compile all the GSettings XML schema files in a directory into a binary file with the name `gschemas.compiled` that can be used by GSettings
glib-genmarshal | is a C code marshaller generation utility for GLib closures
glib-gettextize | is a variant of the gettext internationalization utility
glib-mkenums | is a C language enum description generation utility
gobject-query | is a small utility that draws a tree of types
gresource | offers a simple command line interface to GResource
gsettings | offers a simple command line interface to GSettings
gtester | is a test running utility
gtester-report | is a test report formatting utility
`libgio-2.0` | is a library providing useful classes for general purpose I/O, networking, IPC, settings, and other high level application functionality
`libgirepository-2.0` | is a library providing access to typelibs and introspection data which describes C APIs
`libglib-2.0` | is a general-purpose, portable utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a mainloop abstraction, and so on
`libgmodule-2.0` | provides portable API for dynamically loading modules
`libgobject-2.0` | provides the GLib base type system and object class
`libgthread-2.0` | is a skeleton library for backwards compatibility; it used to be the GLib thread library but the functionalities has been merged info `libglib-2.0`
g-ir-annotation-tool | creates or extracts annotation data from GI typelibs
g-ir-compiler | is a counterpart of gi-compile-repository for the old `libgirepository-1.0` API
g-ir-doc-tool | generates Mallard files that can be viewed with yelp or rendered to HTML with yelp-build from yelp-tools
g-ir-inspect | is a counterpart of gi-inspect-typelib for the old `libgirepository-1.0` API
g-ir-generate | is a counterpart of gi-decompile-typelib for the old `libgirepository-1.0` API
g-ir-scanner | is a tool which generates GIR XML files by parsing headers and introspecting GObject based libraries
`libgirepository-1.0` | is a counterpart of `libgirepository-2.0` with the old 1.0 API

- Prev

  duktape-2.7.0

- Next

  ICU-78.2

- Up
- Home