Skip to content

Instantly share code, notes, and snippets.

@Vertecedoc4545
Last active December 19, 2025 17:51
Show Gist options
  • Select an option

  • Save Vertecedoc4545/3b077301299c20c5b9b4db00f4ca6000 to your computer and use it in GitHub Desktop.

Select an option

Save Vertecedoc4545/3b077301299c20c5b9b4db00f4ca6000 to your computer and use it in GitHub Desktop.
Ubuntu 23.04 Build and Install instructions for Hyprland

Building on Ubuntu 23.04

You have 2 options, use the script descrived bellow or follow the instrutions

script in this gist if you want the source code

wget https://gist.githubusercontent.com/Vertecedoc4545/6e54487f07a1888b656b656c0cdd9764/raw/2c5e8ccb428fc331307e2f653cab88174c051310/build-ubuntu-23.sh
chmod +x build-ubuntu-23.sh
./build-ubuntu-23.sh

Warning you will need to add the bellow config to your hyprland.conf file after installing hyprland either way. If you detect a bug respect to xdg-portals reffer to the issue in github

misc {
  suppress_portal_warnings = true
}

INSTRUCTIONS

Nvidia building : Here

Dependencies:

Most of our dependencies are disponible in the official repos, for speed is recomendable to use nala package manager intead of apt

installing nala will keep apt

sudo apt-get install -y nala
sudo nala install -y meson wget build-essential ninja-build cmake-extras cmake gettext gettext-base fontconfig libfontconfig-dev libffi-dev libxml2-dev libdrm-dev libxkbcommon-x11-dev libxkbregistry-dev libxkbcommon-dev libpixman-1-dev libudev-dev libseat-dev seatd libxcb-dri3-dev libvulkan-dev libvulkan-volk-dev  vulkan-validationlayers-dev libvkfft-dev libgulkan-dev libegl-dev libgles2 libegl1-mesa-dev glslang-tools libinput-bin libinput-dev libxcb-composite0-dev libavutil-dev libavcodec-dev libavformat-dev libxcb-ewmh2 libxcb-ewmh-dev libxcb-present-dev libxcb-icccm4-dev libxcb-render-util0-dev libxcb-res0-dev libxcb-xinput-dev libpango1.0-dev xdg-desktop-portal-wlr hwdata-dev

or if you don't want to use nala apt replacement do:

sudo apt-get install -y meson wget build-essential ninja-build cmake-extras cmake gettext gettext-base fontconfig libfontconfig-dev libffi-dev libxml2-dev libdrm-dev libxkbcommon-x11-dev libxkbregistry-dev libxkbcommon-dev libpixman-1-dev libudev-dev libseat-dev seatd libxcb-dri3-dev libvulkan-dev libvulkan-volk-dev  vulkan-validationlayers-dev libvkfft-dev libgulkan-dev libegl-dev libgles2 libegl1-mesa-dev glslang-tools libinput-bin libinput-dev libxcb-composite0-dev libavutil-dev libavcodec-dev libavformat-dev libxcb-ewmh2 libxcb-ewmh-dev libxcb-present-dev libxcb-icccm4-dev libxcb-render-util0-dev libxcb-res0-dev libxcb-xinput-dev xdg-desktop-portal-wlr hwdata-dev

but some dependencies that we requiere are a little older in the repos so we need to build them

Building libs from source

first get all of our sources for building then extarct them

Hyprland and containing folder

mkdir HyprSource
cd HyprSource

## We get Source
wget https://github.com/hyprwm/Hyprland/releases/download/v0.24.1/source-v0.24.1.tar.gz
tar -xvf source-v0.24.1.tar.gz
wget https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.31/downloads/wayland-protocols-1.31.tar.xz
tar -xvJf wayland-protocols-1.31.tar.xz

wget https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.22.0/downloads/wayland-1.22.0.tar.xz
tar -xzvJf wayland-1.22.0.tar.xz

wget https://gitlab.freedesktop.org/emersion/libdisplay-info/-/releases/0.1.1/downloads/libdisplay-info-0.1.1.tar.xz
tar -xvJf libdisplay-info-0.1.1.tar.xz

now only get inside each one, we build and install directly

build wayland 1.22.0

cd wayland-1.22.0
mkdir build &&
cd    build &&

meson setup ..            \
      --prefix=/usr       \
      --buildtype=release \
      -Ddocumentation=false &&
ninja
sudo ninja install

cd ../..

bulild wayland protocols

cd wayland-protocols-1.31

mkdir build &&
cd    build &&

meson setup --prefix=/usr --buildtype=release &&
ninja

sudo ninja install

cd ../..

Lets build libdisplay-info

cd libdisplay-info-0.1.1/

mkdir build &&
cd    build &&

meson setup --prefix=/usr --buildtype=release &&
ninja

sudo ninja install

cd ../..

Lets build Hyprland!!!

you will need to change the folder permisions due to the use of sudo, so in the future you can acces and modify the folder

chmod a+rw hyprland-source

cd hyprland-source/

modify config.mk and change PREFIX=/usr/local to PREFIX=/usr or use this command

sed -i 's/\/usr\/local/\/usr/g' config.mk

also in that file you could use your custom cflags as for example adding -O3 or -Ofast optimization even -Og etc..

then only do:

sudo make install

*enjoy Hyprland !!

@josephbburg
Copy link

josephbburg commented Dec 19, 2025

Does anyone know why?

the missing libs can be installed by doing:
sudo apt install libcairo2-dev
sudo apt install libpango1.0-dev
sudo apt install libpango1.0-dev

but then, for me, anyway, I have these errors. (I'm using Raspberry Pi OS though)

[160/391] Compiling C object libwlroots.so.12032.p/backend_libinput_tablet_pad.c.o
FAILED: libwlroots.so.12032.p/backend_libinput_tablet_pad.c.o 
cc -Ilibwlroots.so.12032.p -I. -I.. -Iinclude -I../include -Iprotocol -I../protocol -Ibackend/drm -I/usr/include/libdrm -I/usr/include/pixman-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -DWLR_USE_UNSTABLE -DWLR_LITTLE_ENDIAN=1 -DWLR_BIG_ENDIAN=0 -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-parameter -fmacro-prefix-map=../= -fPIC -MD -MQ libwlroots.so.12032.p/backend_libinput_tablet_pad.c.o -MF libwlroots.so.12032.p/backend_libinput_tablet_pad.c.o.d -o libwlroots.so.12032.p/backend_libinput_tablet_pad.c.o -c ../backend/libinput/tablet_pad.c
../backend/libinput/tablet_pad.c: In function ‘add_pad_group_from_libinput’:
../backend/libinput/tablet_pad.c:37:38: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
   37 |         group->rings = calloc(sizeof(unsigned int), group->ring_count);
      |                                      ^~~~~~~~
../backend/libinput/tablet_pad.c:37:38: note: earlier argument should specify number of elements, later size of each element
../backend/libinput/tablet_pad.c:54:39: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
   54 |         group->strips = calloc(sizeof(unsigned int), group->strip_count);
      |                                       ^~~~~~~~
../backend/libinput/tablet_pad.c:54:39: note: earlier argument should specify number of elements, later size of each element
../backend/libinput/tablet_pad.c:70:40: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
   70 |         group->buttons = calloc(sizeof(unsigned int), group->button_count);
      |                                        ^~~~~~~~
../backend/libinput/tablet_pad.c:70:40: note: earlier argument should specify number of elements, later size of each element
cc1: all warnings being treated as errors

which leads to a whole cascade of errors by 1000 other things that need this code to compile, and finally:

cmake --build ./build --config Release --target all -j4
[0/2] Re-checking globbed directories...
ninja: error: '/home/nodespaghetti/repos/HyprSource/hyprland-source/subprojects/wlroots/build/libwlroots.so.12032', needed by 'Hyprland', missing and no known rule to make it
make[1]: *** [Makefile:164: release] Error 1
make[1]: Leaving directory '/home/nodespaghetti/repos/HyprSource/hyprland-source'
make: *** [Makefile:191: install] Error 2

I'll post again if I can figure the next step out

=================================================

forgive me for resorting to Chat GPT, but I am not a C++ programmer so it's the best I can do...

ChatGPT says that some of the uses of calloc in wayland's libwlroot code is using bad practice or something and you have to swap the order of the arguments in a handful of places:

❌ Current (wrong)
group->rings = calloc(sizeof(unsigned int), group->ring_count);
group->strips = calloc(sizeof(unsigned int), group->strip_count);
group->buttons = calloc(sizeof(unsigned int), group->button_count);

✅ Correct
group->rings = calloc(group->ring_count, sizeof(unsigned int));
group->strips = calloc(group->strip_count, sizeof(unsigned int));
group->buttons = calloc(group->button_count, sizeof(unsigned int));

It looks to me like this code allocates the right number of bytes either way but I guess this order of things leads to bugs or something and newer versions of gcc complain about it.

It seems like there are a couple other options - maybe you can make the warnings not be treated as errors somehow. Also, maybe you can skip building tablet/touch features since it looks to me like that is the only part of the code that is causing the problem.

Anyhow if you clear all of these out it just leads to another build error. I am stuck again.

[357/391] Compiling C object examples/dmabuf-capture.p/dmabuf-capture.c.o
FAILED: examples/dmabuf-capture.p/dmabuf-capture.c.o 
cc -Iexamples/dmabuf-capture.p -Iexamples -I../examples -Iprotocol -I/usr/include/aarch64-linux-gnu -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -DWLR_USE_UNSTABLE -DWLR_LITTLE_ENDIAN=1 -DWLR_BIG_ENDIAN=0 -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-parameter -fmacro-prefix-map=../= -pthread -MD -MQ examples/dmabuf-capture.p/dmabuf-capture.c.o -MF examples/dmabuf-capture.p/dmabuf-capture.c.o.d -o examples/dmabuf-capture.p/dmabuf-capture.c.o -c ../examples/dmabuf-capture.c
../examples/dmabuf-capture.c: In function ‘uninit’:
../examples/dmabuf-capture.c:904:9: error: ‘avcodec_close’ is deprecated [-Werror=deprecated-declarations]
  904 |         avcodec_close(ctx->avctx);
      |         ^~~~~~~~~~~~~
In file included from ../examples/dmabuf-capture.c:2:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:2398:5: note: declared here
 2398 | int avcodec_close(AVCodecContext *avctx);
      |     ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
[362/391] Compiling C object tinywl/tinywl.p/tinywl.c.o
ninja: build stopped: subcommand failed.
Could not install libwlroots to /usr/lib/libwlroots.so.12032

============================================================

this is apparently because the call:
avcodec_close(ctx->avctx);

is deprecated in the version of FFMPEG that is installed on my Raspberry Pi.

the newer FFMPEG uses:
avcodec_free_context(&ctx->avctx);
which seems to have resolved the problem.

NOTE: most of the problems I encountered with wlroots were in examples that can be disabled in the meson command. But since this is all being run from sudo make install in the parent directory, I don't know how to do this! I think I could also change the "all warnings are error" behaviour this way.

I'm still waiting for hyprland to build, but wlroots built this time, at least! I'll update some more if hyprland isn't able to build. Raspberry Pi CPUs are kinda slow! It takes a while to build!

=============================================================

even after getting wlroots to compile I get this error when it tries to compile udis86 😮‍💨 :

Package wlroots was not found in the pkg-config search path.
Perhaps you should add the directory containing `wlroots.pc'
to the PKG_CONFIG_PATH environment variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment