Hyprland Libraries

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

### Chapter 15. Hyprland

- Prev

  Hyprland

- Next

  Hyprland-0.53.3

- Up
- Home

# Hyprland Libraries

## Introduction to Hyprland Libraries

The Hyprland libraries provide needed utilities for the entire Hyprland ecosystem. While three of the packages installed in this page are not strictly required (hyprtoolkit, hyprland-qt-support, and hyprland-guiutils), they are needed for some dialog boxes and this book assumes that you have built them.

### Important

Updating this package is known to break ABI.

### Note

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

- Download: https://github.com/hyprwm/

### Hyprland Libraries Dependencies

#### Required

Cairo, CMake, GBM (libgbm or Mesa), Glslang, libdisplay-info, libdrm, libinput, libjxl, libpng, librsvg, libwebp, libzip-1.11.4, OpenGL + EGL + GLESv2 (libglvnd or Mesa; Mesa's GL is not supported), Pixman, pugixml-1.15, Qt-6, seatd-0.9.2, toml++-3.4.0, Wayland, and Wayland-Protocols

#### Recommended

Bash Shell Startup Files and hwdata

## Downloading Hyprland Libraries

First create a list of files to be downloaded:

    cat > hypr-list << "EOF"
    hyprland-protocols/archive/v0.7.0/hyprland-protocols-0.7.0.tar.gz
    hyprutils/archive/v0.11.0/hyprutils-0.11.0.tar.gz
    hyprlang/archive/v0.6.8/hyprlang-0.6.8.tar.gz
    hyprwire/archive/v0.3.0/hyprwire-0.3.0.tar.gz
    hyprcursor/archive/v0.1.13/hyprcursor-0.1.13.tar.gz
    hyprwayland-scanner/archive/v0.4.5/hyprwayland-scanner-0.4.5.tar.gz
    aquamarine/archive/v0.10.0/aquamarine-0.10.0.tar.gz
    hyprgraphics/archive/v0.5.0/hyprgraphics-0.5.0.tar.gz
    hyprtoolkit/archive/v0.5.3/hyprtoolkit-0.5.3.tar.gz
    hyprland-qt-support/archive/v0.1.0/hyprland-qt-support-0.1.0.tar.gz
    hyprland-guiutils/archive/v0.2.1/hyprland-guiutils-0.2.1.tar.gz
    EOF

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

    mkdir hyprlib &&
    cd    hyprlib &&
    grep -v '^#' ../hypr-list | wget -i- -c \
        -B https://github.com/hyprwm/

## Installation of Hyprland Libraries

Create `/etc/profile.d/hypr.sh` to ensure QML files can be loaded and imported as the `root` user:

    cat > /etc/profile.d/hypr.sh << "EOF"
    # Begin /etc/profile.d/hypr.sh

    pathappend /usr/lib/plugins        QT_PLUGIN_PATH
    pathappend $QT6DIR/lib/plugins     QT_PLUGIN_PATH

    pathappend /usr/lib/qt6/qml        QML2_IMPORT_PATH
    pathappend $QT6DIR/lib/qml         QML2_IMPORT_PATH

    # End /etc/profile.d/hypr.sh
    EOF

Now source the main profile:

    source /etc/profile

### 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 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

Next, start a subshell that will exit on error:

    bash -e

Install all the packages by running the following commands:

    for package in $(grep -v '^#' ../hypr-list)
    do
    package=$(basename "$package")
    packagedir=${package%.tar.?z*}
    echo "Building $packagedir"

      tar -xf $package
      pushd $packagedir

      case $packagedir in
        hyprland-protocols-[0-9]* )
          mkdir build
          cd build
            meson setup --prefix=/usr ..
        ;;

        * )
          mkdir build
          cd    build
            cmake -D CMAKE_INSTALL_PREFIX=/usr       \
                  -D CMAKE_BUILD_TYPE=Release        \
                  -D CMAKE_SKIP_INSTALL_RPATH=ON     \
                  -D INSTALL_QML_PREFIX=/lib/qt6/qml \
                  -D DISABLE_TESTS=ON                \
                  -D BUILD_TESTING=OFF               \
                  -W no-dev -G Ninja ..
        ;;
      esac

      ninja
      as_root ninja install
      popd
      rm -rf $packagedir
      as_root /sbin/ldconfig
    done

Finally, exit the shell that was started earlier:

    exit

## Command Explanations

`-D CMAKE_SKIP_INSTALL_RPATH=ON`: This switch makes cmake remove hardcoded library search paths (rpath) when installing a binary executable file or a shared library. This package does not need rpath once it's installed into the standard location, and rpath may sometimes cause unwanted effects or even security issues.

## Contents

Installed Programs: hyprcursor-util, hyprland-dialog, hyprland-donate-screen, hyprland-update-screen, hyprland-welcome, hyprland-run, hyprwayland-scanner, and hyprwire-scanner
Installed Libraries: libaquamarine, libhyprcursor, libhyprgraphics, libhyprland-quick-style-implplugin, libhyprland-quick-style-impl, libhyprland-quick-styleplugin, libhyprland-quick-style, libhyprlang, libhyprtoolkit, libhyprutils, and libhyprwire
Installed Directories: /usr/include/{aquamarine,hypr{cursor,graphics,toolkit,utils,wire}}, /usr/lib/cmake/hypr{wayland,wire}-scanner, /usr/lib/qt6/qml/org/hyprland/style, and /usr/share/hyprland-protocols

### Short Descriptions

hyprcursor-util | compiles, packs, and unpacks hyprcursor and xcursor themes
hyprland-dialog | shows certain dialog using Qt-6
hyprland-donate-screen | shows a pop up box telling users to donate using Qt-6
hyprland-update-screen | shows a pop up box telling users to update using Qt-6
hyprland-welcome | shows a pop up box that walks the user through setting up Hyprland using Qt-6
hyprland-run | shows a pop up box that can run a given application in `PATH` using Qt-6 (not a good replacement for Rofi-2.0.0 or other launchers)
hyprwayland-scanner | generates C++ code from Wayland protocol XML files
hyprwire-scanner | generates C++ code from hyprwire protocol XML files
`libaquamarine` | provides rendering backend API functions
`libhyprcursor` | provides API functions for the hyprcursor format
`libhyprgraphics` | provides graphics utility functions for the Hypr ecosystem
`libhyprland-quick-style-implplugin` | is the Hyprland Quick Style IMPL plugin
`libhyprland-quick-style-impl` | is the Hyprland Quick Style IMPL library
`libhyprland-quick-styleplugin` | is the Hyprland Quick Style plugin
`libhyprland-quick-style` | is the Hyprland Quick Style library
`libhyprlang` | provides functions to parse and use the Hypr configurartion language
`libhyprtoolkit` | provides GUI toolkit functions for use with some Hypr packages
`libhyprutils` | provides utility functions for the Hypr ecoysystem
`libhyprwire` | provides functions to replace D-Bus, but not in place; a new IPC wire protocol and its implementation library

- Prev

  Hyprland

- Next

  Hyprland-0.53.3

- Up
- Home