Skip to content

Commit

Permalink
Core: Move to aquamarine (#6608)
Browse files Browse the repository at this point in the history
Moves Hyprland from wlroots to aquamarine for the backend.

---------

Signed-off-by: Vaxry <[email protected]>
Co-authored-by: Mihai Fufezan <[email protected]>
Co-authored-by: Jan Beich <[email protected]>
Co-authored-by: vaxerski <[email protected]>
Co-authored-by: UjinT34 <[email protected]>
Co-authored-by: Tom Englund <[email protected]>
Co-authored-by: Ikalco <[email protected]>
Co-authored-by: diniamo <[email protected]>
  • Loading branch information
8 people authored Jul 21, 2024
1 parent f642fb9 commit 016da23
Show file tree
Hide file tree
Showing 131 changed files with 4,740 additions and 3,445 deletions.
6 changes: 6 additions & 0 deletions .github/actions/setup_base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ runs:
libglvnd \
libinput \
libliftoff \
libxcursor \
libxcvt \
libxfont2 \
libxkbcommon \
Expand Down Expand Up @@ -73,6 +74,11 @@ runs:
run: |
git clone https://github.com/hyprwm/hyprutils && cd hyprutils && cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -B build && cmake --build build --target hyprutils && cmake --install build
- name: Get aquamarine-git
shell: bash
run: |
git clone https://github.com/hyprwm/aquamarine && cd aquamarine && cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -B build && cmake --build build --target aquamarine && cmake --install build
- name: Get Xorg pacman pkgs
shell: bash
if: inputs.INSTALL_XORG_PKGS == 'true'
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@
[submodule "subprojects/tracy"]
path = subprojects/tracy
url = https://github.com/wolfpld/tracy
[submodule "subprojects/wlroots-hyprland"]
path = subprojects/wlroots-hyprland
url = https://github.com/hyprwm/wlroots-hyprland
ignore = dirty
42 changes: 6 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.27)

include(CheckIncludeFile)
include(ExternalProject)
include(GNUInstallDirs)

# Get version
Expand Down Expand Up @@ -31,9 +30,6 @@ execute_process(
# udis
add_subdirectory("subprojects/udis86")

# wlroots
message(STATUS "Setting up wlroots")

if(CMAKE_BUILD_TYPE)
string(TOLOWER ${CMAKE_BUILD_TYPE} BUILDTYPE_LOWER)
if(BUILDTYPE_LOWER STREQUAL "release")
Expand All @@ -53,18 +49,6 @@ else()
set(BUILDTYPE_LOWER "release")
endif()

ExternalProject_Add(
wlroots-hyprland
PREFIX ${CMAKE_SOURCE_DIR}/subprojects/wlroots-hyprland
SOURCE_DIR ${CMAKE_SOURCE_DIR}/subprojects/wlroots-hyprland
CONFIGURE_COMMAND meson setup --reconfigure --clearcache build --buildtype=${BUILDTYPE_LOWER} -Dwerror=false -Dxwayland=$<IF:$<BOOL:${NO_XWAYLAND}>,disabled,enabled> -Dexamples=false -Drenderers=gles2 -Dbackends=drm,libinput $<IF:$<BOOL:${WITH_ASAN}>,-Db_sanitize=address,-Db_sanitize=none>
BUILD_COMMAND ninja -C build
BUILD_ALWAYS true
BUILD_IN_SOURCE true
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/subprojects/wlroots-hyprland/build/libwlroots.a
INSTALL_COMMAND echo "wlroots-hyprland: install not needed"
)

find_package(PkgConfig REQUIRED)

pkg_get_variable(WaylandScanner wayland-scanner wayland_scanner)
Expand All @@ -84,12 +68,9 @@ endif()
include_directories(
.
"src/"
"subprojects/wlroots-hyprland/include/"
"subprojects/wlroots-hyprland/build/include/"
"subprojects/udis86/"
"protocols/")
set(CMAKE_CXX_STANDARD 23)
add_compile_definitions(WLR_USE_UNSTABLE)
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value
-Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith
-fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=)
Expand All @@ -109,9 +90,10 @@ endif()
find_package(OpenGL REQUIRED COMPONENTS ${GLES_VERSION})

pkg_check_modules(deps REQUIRED IMPORTED_TARGET
aquamarine
xkbcommon uuid
wayland-server wayland-client wayland-cursor wayland-protocols
cairo pango pangocairo pixman-1
cairo pango pangocairo pixman-1 xcursor
libdrm libinput hwdata libseat libdisplay-info libliftoff libudev gbm
hyprlang>=0.3.2 hyprcursor>=0.1.7 hyprutils>=0.2.0
)
Expand All @@ -127,7 +109,6 @@ if(USE_TRACY)
endif()

add_executable(Hyprland ${SRCFILES} ${TRACY_CPP_FILES})
add_dependencies(Hyprland wlroots-hyprland)

set(USE_GPROF ON)

Expand Down Expand Up @@ -266,7 +247,6 @@ function(protocolWayland)
endfunction()

target_link_libraries(Hyprland
${CMAKE_SOURCE_DIR}/subprojects/wlroots-hyprland/build/libwlroots.a
OpenGL::EGL
OpenGL::GL
Threads::Threads
Expand Down Expand Up @@ -314,6 +294,8 @@ protocolNew("unstable/primary-selection" "primary-selection-unstable-v1" false)
protocolNew("staging/xwayland-shell" "xwayland-shell-v1" false)
protocolNew("stable/viewporter" "viewporter" false)
protocolNew("stable/linux-dmabuf" "linux-dmabuf-v1" false)
protocolNew("staging/drm-lease" "drm-lease-v1" false)
protocolNew("staging/linux-drm-syncobj" "linux-drm-syncobj-v1" false)

protocolWayland()

Expand All @@ -326,8 +308,8 @@ install(TARGETS Hyprland)

install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${CMAKE_INSTALL_BINDIR}/Hyprland \
${CMAKE_INSTALL_BINDIR}/hyprland
${CMAKE_INSTALL_FULL_BINDIR}/Hyprland \
${CMAKE_INSTALL_FULL_BINDIR}/hyprland
)"
)

Expand Down Expand Up @@ -358,18 +340,6 @@ install(FILES ${MANPAGES}
install(FILES ${CMAKE_BINARY_DIR}/hyprland.pc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)

# wlroots headers
set(HEADERS_WLR "${CMAKE_CURRENT_SOURCE_DIR}/subprojects/wlroots-hyprland/include/wlr")
install(DIRECTORY ${HEADERS_WLR}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hyprland
FILES_MATCHING PATTERN "*.h")

# config.h and version.h
set(HEADERS_WLR_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/subprojects/wlroots-hyprland/build/include/wlr")
install(DIRECTORY ${HEADERS_WLR_ROOT}/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hyprland/wlr
FILES_MATCHING PATTERN "*.h")

# protocol headers
set(HEADERS_PROTO "${CMAKE_CURRENT_SOURCE_DIR}/protocols")
install(DIRECTORY ${HEADERS_PROTO}
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ nopch:
clear:
rm -rf build
rm -f ./protocols/*.h ./protocols/*.c ./protocols/*.cpp ./protocols/*.hpp
rm -rf ./subprojects/wlroots-hyprland/build

all:
$(MAKE) clear
Expand All @@ -50,14 +49,11 @@ installheaders:
rm -fr ${PREFIX}/include/hyprland
mkdir -p ${PREFIX}/include/hyprland
mkdir -p ${PREFIX}/include/hyprland/protocols
mkdir -p ${PREFIX}/include/hyprland/wlr
mkdir -p ${PREFIX}/share/pkgconfig

cmake --build ./build --config Release --target generate-protocol-headers

find src -name '*.h*' -print0 | cpio --quiet -0dump ${PREFIX}/include/hyprland
cd subprojects/wlroots-hyprland/include/wlr && find . -name '*.h*' -print0 | cpio --quiet -0dump ${PREFIX}/include/hyprland/wlr && cd ../../../..
cd subprojects/wlroots-hyprland/build/include && find . -name '*.h*' -print0 | cpio --quiet -0dump ${PREFIX}/include/hyprland/wlr && cd ../../../..
cp ./protocols/*.h* ${PREFIX}/include/hyprland/protocols
cp ./build/hyprland.pc ${PREFIX}/share/pkgconfig
if [ -d /usr/share/pkgconfig ]; then cp ./build/hyprland.pc /usr/share/pkgconfig 2>/dev/null || true; fi
Expand Down Expand Up @@ -88,7 +84,7 @@ asan:
@pidof Hyprland > /dev/null && exit 1 || echo ""

rm -rf ./wayland
git reset --hard
#git reset --hard

@echo -en "If you want to apply a patch, input its path (leave empty for none):\n"
@read patchvar
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

<br>

Hyprland is a dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks.
Hyprland is a 100% independent, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.

It provides the latest Wayland features, is highly customizable, has all the eyecandy, the most powerful plugins,
easy IPC, much more QoL stuff than other wlr-based compositors and more...
easy IPC, much more QoL stuff than other compositors and more...
<br>
<br>

Expand All @@ -37,7 +37,7 @@ easy IPC, much more QoL stuff than other wlr-based compositors and more...

- All of the eyecandy: gradient borders, blur, animations, shadows and much more
- A lot of customization
- Much more QoL stuff than other wlr-based compositors
- 100% independent, no wlroots, no libweston, no kwin, no mutter.
- Custom bezier curves for the best animations
- Powerful plugin support
- Built-in plugin manager
Expand All @@ -48,7 +48,6 @@ easy IPC, much more QoL stuff than other wlr-based compositors and more...
- Config reloaded instantly upon saving
- Fully dynamic workspaces
- Two built-in layouts and more available as plugins
- Uses forked wlroots with QoL patches
- Global keybinds passed to your apps of choice
- Tiling/pseudotiling/floating/fullscreen windows
- Special workspaces (scratchpads)
Expand Down Expand Up @@ -86,7 +85,7 @@ easy IPC, much more QoL stuff than other wlr-based compositors and more...

<br>

**[wlroots]** - *For their amazing library*
**[wlroots]** - *For powering Hyprland in the past*

**[tinywl]** - *For showing how 2 do stuff*

Expand Down
30 changes: 30 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
# <https://github.com/nix-systems/nix-systems>
systems.url = "github:nix-systems/default-linux";

aquamarine = {
url = "github:hyprwm/aquamarine";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
inputs.hyprutils.follows = "hyprutils";
inputs.hyprwayland-scanner.follows = "hyprwayland-scanner";
};

hyprcursor = {
url = "github:hyprwm/hyprcursor";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
2 changes: 1 addition & 1 deletion hyprland.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Name: Hyprland
URL: https://github.com/hyprwm/Hyprland
Description: Hyprland header files
Version: @HYPRLAND_VERSION@
Cflags: -I${prefix} -I${prefix}/hyprland/protocols -I${prefix}/hyprland -I${prefix}/hyprland/wlr
Cflags: -I${prefix} -I${prefix}/hyprland/protocols -I${prefix}/hyprland
7 changes: 1 addition & 6 deletions hyprpm/src/core/PluginManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ eHeadersErrors CPluginManager::headersValid() {
else
headers = "";

if (PATH.ends_with("protocols") || PATH.ends_with("wlroots-hyprland"))
if (PATH.ends_with("protocols"))
continue;

verHeader = trim(PATH.substr(2)) + "/hyprland/src/version.h";
Expand Down Expand Up @@ -493,11 +493,6 @@ bool CPluginManager::updateHeaders(bool force) {
return false;
}

// le hack. Wlroots has to generate its build/include
ret = execAndGet("cd " + WORKINGDIR + "/subprojects/wlroots-hyprland && meson setup -Drenderers=gles2 -Dexamples=false build");
if (m_bVerbose)
progress.printMessageAbove(std::string{Colors::BLUE} + "[v] " + Colors::RESET + "meson returned: " + ret);

progress.printMessageAbove(std::string{Colors::GREEN} + "" + Colors::RESET + " configured Hyprland");
progress.m_iSteps = 4;
progress.m_szCurrentMessage = "Installing sources";
Expand Down
11 changes: 2 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ if cpp_compiler.check_header('execinfo.h')
add_project_arguments('-DHAS_EXECINFO', language: 'cpp')
endif

wlroots = subproject('wlroots-hyprland', default_options: ['examples=false', 'renderers=gles2'])
have_xwlr = wlroots.get_variable('features').get('xwayland')
xcb_dep = dependency('xcb', required: get_option('xwayland'))
xcb_composite_dep = dependency('xcb-composite', required: get_option('xwayland'))
xcb_errors_dep = dependency('xcb-errors', required: get_option('xwayland'))
Expand All @@ -38,12 +36,7 @@ cmake = import('cmake')
udis = cmake.subproject('udis86')
udis86 = udis.dependency('libudis86')

if get_option('xwayland').enabled() and not have_xwlr
error('Cannot enable Xwayland in Hyprland: wlroots has been built without Xwayland support')
endif
have_xwayland = xcb_dep.found() and have_xwlr

if not have_xwayland
if not xcb_dep.found()
add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
endif

Expand Down Expand Up @@ -86,5 +79,5 @@ import('pkgconfig').generate(
url: 'https://github.com/hyprwm/Hyprland',
description: 'Hyprland header files',
install_dir: pkg_install_dir,
subdirs: ['', 'hyprland/protocols', 'hyprland', 'hyprland/wlr'],
subdirs: ['', 'hyprland/protocols', 'hyprland'],
)
3 changes: 3 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
makeWrapper,
cmake,
ninja,
aquamarine,
binutils,
cairo,
expat,
Expand Down Expand Up @@ -104,6 +105,7 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov

buildInputs = lib.concatLists [
[
aquamarine
cairo
expat
fribidi
Expand Down Expand Up @@ -136,6 +138,7 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
(lib.optionals stdenv.hostPlatform.isMusl [libexecinfo])
(lib.optionals enableXWayland [
xorg.libxcb
xorg.libXcursor
xorg.libXdmcp
xorg.xcbutil
xorg.xcbutilerrors
Expand Down
1 change: 1 addition & 0 deletions nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ in {
# Packages for variations of Hyprland, dependencies included.
hyprland-packages = lib.composeManyExtensions [
# Dependencies
inputs.aquamarine.overlays.default
inputs.hyprcursor.overlays.default
inputs.hyprlang.overlays.default
inputs.hyprutils.overlays.default
Expand Down
17 changes: 0 additions & 17 deletions nix/update-wlroots.sh

This file was deleted.

2 changes: 2 additions & 0 deletions protocols/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ new_protocols = [
[wl_protocol_dir, 'staging/xwayland-shell/xwayland-shell-v1.xml'],
[wl_protocol_dir, 'stable/viewporter/viewporter.xml'],
[wl_protocol_dir, 'stable/linux-dmabuf/linux-dmabuf-v1.xml'],
[wl_protocol_dir, 'staging/drm-lease/drm-lease-v1.xml'],
[wl_protocol_dir, 'staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml'],
]

wl_protos_src = []
Expand Down
Loading

0 comments on commit 016da23

Please sign in to comment.