GLib の概要

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

本パッケージは LFS-10.1 において正しくビルドでき動作することが確認されています。


Additional Downloads

GLib の依存パッケージ



dbus-1.12.20bindfs (両者ともに各種テストにて用いられる), GDB-10.1 (バインディングのため), docbook-xml-4.5, docbook-xsl-1.79.2, GTK-Doc-1.33.2 (API ドキュメント生成のため), glib-networking-2.66.0 (一部のテストのため、ただし循環依存性あり)


Quoted directly from the INSTALL file: Some of the mimetype-related functionality in GIO requires the update-mime-database and update-desktop-database utilities, which are part of shared-mime-info-2.1 and desktop-file-utils-0.26, respectively. These two utilities are also needed for some tests.


GLib のインストール

If desired, apply the optional patch. In many cases, applications that use this library, either directly or indirectly via other libraries such as GTK+-3.24.26, output numerous warnings when run from the command line. This patch enables the use of an environment variable, GLIB_LOG_LEVEL, that supresses 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-2.66.7-skip_warnings-1.patch


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}

以下のコマンドを実行して GLib をビルドします。

mkdir build &&
cd    build &&

meson --prefix=/usr      \
      -Dman=true         \
      -Dselinux=disabled \
      ..                 &&


If libxslt-1.1.34 is installed, the above command may indicate several (about 33) errors that start with "Error: no ID for constraint linkend:" when generating the man pages. These are harmless.

GLib のテストスイートを実行するには desktop-file-utils が必要です。 しかし desktop-file-utils をビルドするには GLib が必要なものとなっています。 したがってまずは GLib をインストールした後にテストスイートを実行することになります。

root ユーザーになって以下を実行します。

ninja install &&

mkdir -p /usr/share/doc/glib-2.66.7 &&
cp -r ../docs/reference/{NEWS,gio,glib,gobject} /usr/share/doc/glib-2.66.7

ここで desktop-file-utils-0.26shared-mime-info-2.1 をインストールした上で、テストスイートを実行してください。

ビルド結果をテストする場合は、本パッケージをインストールした後に ninja test を実行します。

Finally, if this is a reinstall from glib2-2.64.x or earlier, remove (as the root user) an obsolete header file that interferes with some packages:

rm -f /usr/include/glib-2.0/glib/gurifuncs.h


-Dman=true: This switch causes the build to create and install the package man pages.

-Dselinux=disabled: This switch disables support for selinux which is not supported in BLFS.

-Dgtk_doc=true: This switch causes the build to create and install the API documentation.


インストールプログラム: gapplication, gdbus, gdbus-codegen, gio, gio-querymodules, glib-compile-resources, glib-compile-schemas, glib-genmarshal, glib-gettextize, glib-mkenums, gobject-query, gresource, gsettings, gtester, gtester-report
インストールディレクトリ: /usr/include/gio-unix-2.0, /usr/include/glib-2.0, /usr/lib/glib-2.0, /usr/share/glib-2.0, /usr/share/doc/glib-2.66.7, /usr/share/gtk-doc/html/{gio,glib,gobject}



can be used to start applications and to send messages to already-running instances of other applications


is a simple tool used for working with D-Bus objects


is used to generate code and/or documentation for one or more D-Bus interfaces


is a utility that makes many GIO features available from the command line


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


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


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


is a C code marshaller generation utility for GLib closures


is a variant of the gettext internationalization utility


is a C language enum description generation utility


is a small utility that draws a tree of types


offers a simple command line interface to GResource


offers a simple command line interface to GSettings


is a test running utility


is a test report formatting utility

GLib ライブラリ

contain low-level core libraries for the GIMP Toolkit

最終更新日: 2021-02-21 07:10:45 +0900