diff --git a/hyprlock.sh b/hyprlock.sh index eac9786..447cdc8 100644 --- a/hyprlock.sh +++ b/hyprlock.sh @@ -88,6 +88,7 @@ getDependencies() { debian) cloneAndBuildUtils cloneAndBuildGraphics + cloneAndBuildScanner ;; esac ;; @@ -147,6 +148,31 @@ cloneAndBuildUtils() { fi } +buildScanner() { + echo_pkg build "Building hyprwayland-scanner" + run cmake -DCMAKE_INSTALL_PREFIX=/usr -B build + run cmake --build build -j $(nproc) +} + +cloneAndBuildScanner() { + local cloneDir="$(mktemp -d)" + + cd $cloneDir || mkdir -p $cloneDir && cd $cloneDir + + echo_pkg git "Cloning hyprwayland-scanner into $cloneDir/hyprwayland-scanner" + + git clone https://github.com/hyprwm/hyprwayland-scanner && + cd hyprwayland-scanner + + if buildScanner; then + echo_pkg install + $_sudo cmake --install build + else + echo_error "Build has failed for $distro compiling hyprlock" + return 69 + fi +} + build() { echo_pkg build "Building hyprlock" run cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build @@ -186,8 +212,6 @@ main() { _install hyprlock ;; debian) - cloneAndBuildUtils - cloneAndBuildGraphics cloneAndBuildLock ;; *)