DIsable OpenGLX need in NO_XWAYLAND flag
Description
Hyprland still need x dependencies even with NO_XWAYLAND flag activated in the source build. It doenst make sens to need glx if i will don't use the x dependencies of opengl.
The error that i get is this
mkdir -p build && cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DNO_XWAYLAND:STRING=true -DNO_SYSTEMD:STRING=true -H./ -B./build -G Ninja
Not searching for unused variables given on the command line.
-- Gathering git info
-- Setting up wlroots
-- Found WaylandScanner at /usr/bin/wayland-scanner
-- Found wayland-protocols at //usr/share/wayland-protocols
-- Configuring Hyprland in Release with CMake
-- Checking deps...
CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenGL (missing: OPENGL_glx_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.28/Modules/FindOpenGL.cmake:545 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:103 (find_package)
-- Configuring incomplete, errors occurred!
and if i clone the repo and use the make commands that the install guide says i get this
make all && doas make install
make clear
make[1]: Entering directory '/home/hellboy/Hyprland'
rm -rf build
rm -f ./protocols/*-protocol.h ./protocols/*-protocol.c
rm -rf ./subprojects/wlroots/build
make[1]: Leaving directory '/home/hellboy/Hyprland'
make release
make[1]: Entering directory '/home/hellboy/Hyprland'
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:STRING=/usr/local -S . -B ./build -G Ninja
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.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
-- Found Python3: /usr/bin/python3.11 (found version "3.11.8") found components: Interpreter
Building itab.c/itab.h...
-- Setting up wlroots
-- Found WaylandScanner at /usr/bin/wayland-scanner
-- Found wayland-protocols at //usr/share/wayland-protocols
-- Configuring Hyprland in Release with CMake
-- Checking deps...
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1")
CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenGL (missing: OPENGL_glx_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.28/Modules/FindOpenGL.cmake:545 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:103 (find_package)
-- Configuring incomplete, errors occurred!
make[1]: *** [Makefile:14: release] Error 1
make[1]: Leaving directory '/home/hellboy/Hyprland'
make: *** [Makefile:31: all] Error 2
Could you apply this patch and see whether it fixes it?
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71766a8c..9b5d8c6c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -100,7 +100,6 @@ message(STATUS "Checking deps...")
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
-find_package(OpenGL REQUIRED)
pkg_check_modules(deps REQUIRED IMPORTED_TARGET wayland-server wayland-client wayland-cursor wayland-protocols cairo libdrm xkbcommon libinput pango pangocairo pixman-1 hyprlang>=0.3.2 hyprcursor) # we do not check for wlroots, as we provide it ourselves
file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp")
@@ -166,6 +165,7 @@ if(NO_XWAYLAND)
else()
message(STATUS "XWAYLAND Enabled (NO_XWAYLAND not defined) checking deps...")
pkg_check_modules(xcbdep REQUIRED IMPORTED_TARGET xcb)
+ find_package(OpenGL REQUIRED)
target_link_libraries(Hyprland PkgConfig::xcbdep)
endif()
Kinda solved but another problem appeared
patching file CMakeLists.txt
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.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
-- Found Python3: /usr/bin/python3.11 (found version "3.11.8") found components: Interpreter
Building itab.c/itab.h...
-- Setting up wlroots
-- Found WaylandScanner at /usr/bin/wayland-scanner
-- Found wayland-protocols at //usr/share/wayland-protocols
-- Configuring Hyprland in Release with CMake
-- Checking deps...
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1")
-- Checking for modules 'wayland-server;wayland-client;wayland-cursor;wayland-protocols;cairo;libdrm;xkbcommon;libinput;pango;pangocairo;pixman-1;hyprlang>=0.3.2;hyprcursor'
-- Found wayland-server, version 1.22.0
-- Found wayland-client, version 1.22.0
-- Found wayland-cursor, version 1.22.0
-- Found wayland-protocols, version 1.33
-- Found cairo, version 1.18.0
-- Found libdrm, version 2.4.120
-- Found xkbcommon, version 1.6.0
-- Found libinput, version 1.25.0
-- Found pango, version 1.52.1
-- Found pangocairo, version 1.52.1
-- Found pixman-1, version 0.43.4
-- Found hyprlang, version 0.5.0
-- Found hyprcursor, version 0.1.4
-- Looking for execinfo.h
-- Looking for execinfo.h - not found
-- Looking for backtrace in execinfo
-- Looking for backtrace in execinfo - not found
-- Using the NO_XWAYLAND flag, disabling XWayland!
-- SYSTEMD support is disabled...
-- Setting precompiled headers
-- Setting link libraries
-- Checking for module 'tomlplusplus'
-- Found tomlplusplus, version 3.4.0
-- Configuring done (1.7s)
CMake Error at CMakeLists.txt:223 (target_link_libraries):
Target "Hyprland" links to:
OpenGL::EGL
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
-- Generating done (0.0s)
CMake Generate step failed. Build files cannot be regenerated correctly.
Hello there!
This issue has been closed, as we are moving from issues to discussions. More about this can be found here and in #9854.
Firstly, please make sure this issue is still relevant in latest Hyprland. If so, we ask you to open a discussion (please read the discussion guidelines first, in the pinned post)
Thank you for your understanding!