From 3864714a58ae73b4f474e5a31162c8a8e324cbfc Mon Sep 17 00:00:00 2001 From: TheOnePath Date: Tue, 18 Jun 2024 19:28:34 +0100 Subject: [PATCH] Updated Makefile with hyprutils hyprutils is now a submodule of the project which is required by other Hyprland components. Removed the targets to install system packages. This is better in a bash script, but making a Solus container should be considered. --- Makefile | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 48841a8..04aa546 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,22 @@ $(__Hypercursor): $(__Hyperlang) @echo "Installing library hyprcursor..." sudo $(CMAKE) --install hyprcursor/build +# Build hyprutils if the .hpp file is not installed +__Hyprutils = $(INC_SYSTEM_PATH)/hyprutils.hpp +$(__Hyprutils): + @if [ ! -d hyprutils ]; then\ + git submodule init + git submodule update --remote hyprutils;\ + fi + $(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr -S hyprutils -B ./hyprutils/build + $(CMAKE) --build ./hyprutils/build --config Release --target all -j`nproc \ + 2>/dev/null || getconf _NPROCESSORS_CONF` + sudo $(CMAKE) --install hyprutils/build + # Build hyprlang if the .hpp file is not installed __Hyprlang = $(INC_SYSTEM_PATH)/hyprlang.hpp -$(__Hyprlang): +$(__Hyprlang): $(__Hyprutils) if [ ! -d hyprlang ]; then git submodule init git submodule update --remote hyprlang @@ -82,26 +95,18 @@ $(__Wl_clipboard): # Build and install tomlplusplus if it's not on the system tomlplusplus: - git clone https://github.com/marzer/tomlplusplus.git + git clone https://github.com/marzer/tomlplusplus.git __Tomlplusplus = $(INC_SYSTEM_PATH)/toml++ -$(__Tomlplusplus): +$(__Tomlplusplus): tomlplusplus @echo "Building and installing tomlplusplus..." - $(MESON) setup -C tomlplusplus build --buildtype=release + cd tomlplusplus && $(MESON) setup build --buildtype=release ninja -C tomlplusplus/build - sudo $(MESON) install tomlplusplus/build - -.PHONY : deps -deps: $(__Tomlplusplus) - @echo "Installing system dependencies..." - sudo eopkg it -y libcairo-devel file-devel libdrm-devel libglvnd-devel \ - libjpeg-turbo-devel librsvg-devel libwebp-devel libzip-devel \ - mesalib-devel pam-devel pango-devel waybar wayland-devel \ - wayland-protocols-devel wlroots-devel libxkbcommon-devel + sudo $(MESON) install -C tomlplusplus/build ### PHONY targets that a user would run ### .PHONY : build -build: deps $(__Hyprcursor) $(__Hyprlang) $(__Hyprlock) $(__Hyprpaper) \ - $(__Wl-clipboard) $(__Hyprland) +build: $(__Tomlplusplus) $(__Hyprutils) $(__Hyprcursor) $(__Hyprlang) \ + $(__Hyprlock) $(__Hyprpaper) $(__Wl-clipboard) $(__Hyprland) .PHONY : install install: build