Libdrm-2.4.131

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

### Chapter 10. Graphics APIs

- Prev

  libatomic_ops-7.10.0

- Next

  libgbm-1.0.4

- Up
- Home

# Libdrm-2.4.131

## Introduction to Libdrm

Libdrm provides a userspace library for accessing the direct rendering manager (DRM) on operating systems that support the ioctl interface. Libdrm is a low-level library, typically used by graphics drivers such as the Mesa DRI drivers, the X drivers, libva and similar projects.

### 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://dri.freedesktop.org/libdrm/libdrm-2.4.131.tar.xz

### libdrm Dependencies

Recommended
libatomic_ops-7.10.0 (required by architectures without native atomic operations) and Xorg Libraries (for Intel KMS API support required by Mesa)

## Installation of Libdrm

Install libdrm by running the following commands:

    mkdir build &&
    cd    build &&

    meson setup --prefix=/usr         \
                --buildtype=release   \
                -D tests=false        \
                -D udev=true          \
                -D valgrind=disabled  \
                .. &&

    ninja

Now, as the `root` user:

    ninja install

## lib32 Installation of Libdrm

Install lib32-libdrm by running the following commands:

    rm -rf * &&
    meson setup --prefix=/usr        \
                --buildtype=release  \
                --cross-file=lib32   \
                -D tests=false       \
                -D udev=true         \
                -D valgrind=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 tests=false`: This parameter disables building tests for this package.

`-D udev=true`: This parameter enables support for using Udev instead of mknod.

`-D valgrind=disabled`: This parameter disables building libdrm with valgrind support. This fixes building some packages that use libdrm. Change this parameter to "enabled" (or remove it) if you need support for valgrind.

## Contents

Installed Programs: None
Installed Libraries: libdrm_amdgpu, libdrm_intel, libdrm_nouveau, libdrm_radeon, and libdrm
Installed Directories: /usr/include/libdrm and /usr/share/libdrm

### Short Descriptions

`libdrm_amdgpu` | contains the AMDGPU specific Direct Rendering Manager functions
`libdrm_intel` | contains the Intel specific Direct Rendering Manager functions
`libdrm_nouveau` | contains the open source nVidia (Nouveau) specific Direct Rendering Manager functions
`libdrm_radeon` | contains the AMD Radeon specific Direct Rendering Manager functions
`libdrm` | contains the Direct Rendering Manager API functions

- Prev

  libatomic_ops-7.10.0

- Next

  libgbm-1.0.4

- Up
- Home