#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-491

### Chapter 24. Graphical Environments

- Prev

  xcb-util-0.4.1

- Next

  Mesa-26.0.1

- Up
- Home

# XCB Utilities

## Introduction to XCB Utilities

The XCB utilities provide extensions that developers can use when making X Window software. xcb-util-0.4.1 was just installed but these utilities offer even more extensions that X Window software may depend on.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://xorg.freedesktop.org/archive/individual/lib/

- Download size: 1.1 MB

- Estimated disk space required: 13.3 MB

- Estimated build time: 0.1 SBU (ignoring the time to download)

### XCB Utilities Dependencies

#### Required

libxcb-1.17.0 and xcb-util-0.4.1

## Downloading XCB Utilities

First, create a list of files to be downloaded. This file will also be used to verify the integrity of the downloads when complete:

    cat > xcb-utils.md5 << "EOF"
    a67bfac2eff696170259ef1f5ce1b611  xcb-util-image-0.4.1.tar.xz
    fbdc05f86f72f287ed71b162f1a9725a  xcb-util-keysyms-0.4.1.tar.xz
    193b890e2a89a53c31e2ece3afcbd55f  xcb-util-renderutil-0.3.10.tar.xz
    581b3a092e3c0c1b4de6416d90b969c3  xcb-util-wm-0.4.2.tar.xz
    e85bccd1993992be07232f8b80a814c8  xcb-util-cursor-0.1.6.tar.xz
    EOF

To download the needed files using Wget-1.25.0, use the following commands:

    mkdir xcb-utils &&
    cd    xcb-utils &&
    grep -v '^#' ../xcb-utils.md5 | awk '{print $2}' | wget -i- -c \
         -B https://xorg.freedesktop.org/archive/individual/lib/ &&
    md5sum -c ../xcb-utils.md5

## Installation of XCB Utilities

### Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

1. Run the entire script as the root user (not recommended).

2. Use the sudo command from the Sudo-1.9.17p2 package.

3. Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

    as_root()
    {
      if   [ $EUID = 0 ];        then $*
      elif [ -x /usr/bin/sudo ]; then sudo $*
      else                            su -c \\"$*\\"
      fi
    }

    export -f as_root

First, start a subshell that will exit on error:

    bash -e

Install all of the packages by running the following commands:

    for package in $(grep -v '^#' ../xcb-utils.md5 | awk '{print $2}')
    do
      packagedir=${package%.tar.?z*}
      tar -xf $package
      pushd $packagedir
         ./configure $XORG_CONFIG
         make
         as_root make install
      popd
      rm -rf $packagedir
    done

Finally, exit the shell that was started earlier:

    exit

## Contents

Installed Programs: None
Installed Libraries: libxcb-image.so, libxcb-keysyms.so, libxcb-render-util.so, libxcb-ewmh.so, libxcb-icccm.so, and libxcb-cursor.so
Installed Directories: None

### Short Descriptions

`libxcb-image.so` | is a port of Xlib's XImage and XShmImage functions
`libxcb-keysyms.so` | provides the standard X key constants and API functions for conversion to/from keycodes
`libxcb-render-util.so` | provides convenience functions for the Render extension
`libxcb-ewmh.so` | provides the client and window-manager helpers for EWMH
`libxcb-icccm.so` | provides the client and window-manager helpers for ICCCM
`libxcb-cursor.so` | is a port of Xlib's libXcursor functions

- Prev

  xcb-util-0.4.1

- Next

  Mesa-26.0.1

- Up
- Home