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
}
Nvidia building : Here
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
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
cd wayland-1.22.0
mkdir build &&
cd build &&
meson setup .. \
--prefix=/usr \
--buildtype=release \
-Ddocumentation=false &&
ninja
sudo ninja install
cd ../..
cd wayland-protocols-1.31
mkdir build &&
cd build &&
meson setup --prefix=/usr --buildtype=release &&
ninja
sudo ninja install
cd ../..
cd libdisplay-info-0.1.1/
mkdir build &&
cd build &&
meson setup --prefix=/usr --buildtype=release &&
ninja
sudo ninja install
cd ../..
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..
sudo make install
*enjoy Hyprland !!
Tried to intsall libwlroots, still not sure how to handle below error..
sudo make install 10s
make clear
make[1]: Entering directory '/home/krushnp/hyprland/hyprland-source'
rm -rf build
rm -f *.o *-protocol.h *-protocol.c
rm -f ./hyprctl/hyprctl
rm -rf ./subprojects/wlroots/build
make[1]: Leaving directory '/home/krushnp/hyprland/hyprland-source'
make fixwlr
make[1]: Entering directory '/home/krushnp/hyprland/hyprland-source'
sed -i -E 's/(soversion = 12)([^032]|$)/soversion = 12032/g' subprojects/wlroots/meson.build
rm -rf ./subprojects/wlroots/build
make[1]: Leaving directory '/home/krushnp/hyprland/hyprland-source'
cd ./subprojects/wlroots && meson setup build/ --buildtype=release && ninja -C build/ && cp ./build/libwlroots.so.12032 /usr/lib/ || echo "Could not install libwlroots to /usr/lib/libwlroots.so.12032"
The Meson build system
Version: 0.61.2
Source dir: /home/krushnp/hyprland/hyprland-source/subprojects/wlroots
Build dir: /home/krushnp/hyprland/hyprland-source/subprojects/wlroots/build
Build type: native build
Project name: wlroots
Project version: 0.17.0-dev
C compiler for the host machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Wlogical-op: YES
Compiler for C supports arguments -Wmissing-include-dirs: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Winit-self: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wimplicit-fallthrough=2: YES
Compiler for C supports arguments -Wendif-labels: YES
Compiler for C supports arguments -Wstrict-aliasing=2: YES
Compiler for C supports arguments -Woverflow: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Walloca: YES
Compiler for C supports arguments -Wno-missing-braces: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -fmacro-prefix-map=/prefix/to/hide=: YES
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Dependency wayland-server found: NO found 1.20.0 but need: '>=1.21'
Found CMake: /usr/bin/cmake (3.22.1)
Run-time dependency wayland-server found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency wayland-server
meson.build:105:0: ERROR: Neither a subproject directory nor a wayland.wrap file was found.
A full log can be found at /home/krushnp/hyprland/hyprland-source/subprojects/wlroots/build/meson-logs/meson-log.txt
Could not install libwlroots to /usr/lib/libwlroots.so.12032
cd subprojects/udis86 && cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B./build -G Ninja && cmake --build ./build --config Release --target all -j8 && cd ../..
Not searching for unused variables given on the command line.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/krushnp/hyprland/hyprland-source/subprojects/udis86/build
ninja: no work to do.
make protocols
make[1]: Entering directory '/home/krushnp/hyprland/hyprland-source'
/usr/bin/wayland-scanner private-code
//usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c
/usr/bin/wayland-scanner server-header
//usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o xdg-shell-protocol.o xdg-shell-protocol.c
/usr/bin/wayland-scanner private-code
protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o wlr-layer-shell-unstable-v1-protocol.o wlr-layer-shell-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
protocols/wlr-screencopy-unstable-v1.xml wlr-screencopy-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
protocols/wlr-screencopy-unstable-v1.xml wlr-screencopy-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o wlr-screencopy-unstable-v1-protocol.o wlr-screencopy-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
protocols/idle.xml idle-protocol.c
/usr/bin/wayland-scanner server-header
protocols/idle.xml idle-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o idle-protocol.o idle-protocol.c
/usr/bin/wayland-scanner private-code
protocols/ext-workspace-unstable-v1.xml ext-workspace-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
protocols/ext-workspace-unstable-v1.xml ext-workspace-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o ext-workspace-unstable-v1-protocol.o ext-workspace-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
protocols/pointer-constraints-unstable-v1.xml pointer-constraints-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
protocols/pointer-constraints-unstable-v1.xml pointer-constraints-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o pointer-constraints-unstable-v1-protocol.o pointer-constraints-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
protocols/tablet-unstable-v2.xml tablet-unstable-v2-protocol.c
/usr/bin/wayland-scanner server-header
protocols/tablet-unstable-v2.xml tablet-unstable-v2-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o tablet-unstable-v2-protocol.o tablet-unstable-v2-protocol.c
/usr/bin/wayland-scanner private-code
protocols/wlr-output-power-management-unstable-v1.xml wlr-output-power-management-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
protocols/wlr-output-power-management-unstable-v1.xml wlr-output-power-management-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o wlr-output-power-management-unstable-v1-protocol.o wlr-output-power-management-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
//usr/share/wayland-protocols/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml linux-dmabuf-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
//usr/share/wayland-protocols/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml linux-dmabuf-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o linux-dmabuf-unstable-v1-protocol.o linux-dmabuf-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
subprojects/hyprland-protocols/protocols/hyprland-toplevel-export-v1.xml hyprland-toplevel-export-v1-protocol.c
/usr/bin/wayland-scanner server-header
subprojects/hyprland-protocols/protocols/hyprland-toplevel-export-v1.xml hyprland-toplevel-export-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o hyprland-toplevel-export-v1-protocol.o hyprland-toplevel-export-v1-protocol.c
/usr/bin/wayland-scanner private-code
protocols/wlr-foreign-toplevel-management-unstable-v1.xml wlr-foreign-toplevel-management-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
protocols/wlr-foreign-toplevel-management-unstable-v1.xml wlr-foreign-toplevel-management-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o wlr-foreign-toplevel-management-unstable-v1-protocol.o wlr-foreign-toplevel-management-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
//usr/share/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml fractional-scale-v1-protocol.c
/usr/bin/wayland-scanner server-header
//usr/share/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml fractional-scale-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o fractional-scale-v1-protocol.o fractional-scale-v1-protocol.c
/usr/bin/wayland-scanner private-code
//usr/share/wayland-protocols/unstable/text-input/text-input-unstable-v1.xml text-input-unstable-v1-protocol.c
/usr/bin/wayland-scanner server-header
//usr/share/wayland-protocols/unstable/text-input/text-input-unstable-v1.xml text-input-unstable-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o text-input-unstable-v1-protocol.o text-input-unstable-v1-protocol.c
/usr/bin/wayland-scanner private-code
subprojects/hyprland-protocols/protocols/hyprland-global-shortcuts-v1.xml hyprland-global-shortcuts-v1-protocol.c
/usr/bin/wayland-scanner server-header
subprojects/hyprland-protocols/protocols/hyprland-global-shortcuts-v1.xml hyprland-global-shortcuts-v1-protocol.h
cc -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement -DXWAYLAND -I. -DWLR_USE_UNSTABLE -std=c99 -I/usr/include/libdrm -I/usr/include/pixman-1 -c -o hyprland-global-shortcuts-v1-protocol.o hyprland-global-shortcuts-v1-protocol.c
make[1]: Leaving directory '/home/krushnp/hyprland/hyprland-source'
make release
make[1]: Entering directory '/home/krushnp/hyprland/hyprland-source'
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build -G Ninja
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Gathering git info
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
-- Configuring Hyprland in Release with CMake
-- Checking deps...
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for modules 'wayland-server;wayland-client;wayland-cursor;wayland-protocols;cairo;libdrm;egl;xkbcommon;libinput;pango;pangocairo'
-- Found wayland-server, version 1.20.0
-- Found wayland-client, version 1.20.0
-- Found wayland-cursor, version 1.20.0
-- Found wayland-protocols, version 1.25
-- Found cairo, version 1.16.0
-- Found libdrm, version 2.4.113
-- Found egl, version 1.5
-- Found xkbcommon, version 1.4.0
-- Found libinput, version 1.20.0
-- Found pango, version 1.50.6
-- Found pangocairo, version 1.50.6
-- Looking for backtrace in execinfo
-- Looking for backtrace in execinfo - not found
-- XWAYLAND Enabled (NO_XWAYLAND not defined) checking deps...
-- Checking for module 'xcb'
-- Found xcb, version 1.14
-- SYSTEMD support is requested (NO_SYSTEMD not defined) checking deps...
-- Checking for module 'libsystemd'
-- Found libsystemd, version 249
-- Looking for systemd/sd-daemon.h
-- Looking for systemd/sd-daemon.h - found
-- Setting link libraries
-- Configuring done
-- Generating done
-- Build files have been written to: /home/krushnp/hyprland/hyprland-source/build
cmake --build ./build --config Release --target all -j8
[0/2] Re-checking globbed directories...
ninja: error: '../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/krushnp/hyprland/hyprland-source'
make: *** [Makefile:191: install] Error 2