wip
This commit is contained in:
parent
c594535bf5
commit
9c879b5f3f
1 changed files with 70 additions and 9 deletions
77
hyprlock.sh
77
hyprlock.sh
|
@ -62,18 +62,18 @@ getDependencies() {
|
||||||
# │ You can define dependencies for various linux distros here. It will │
|
# │ You can define dependencies for various linux distros here. It will │
|
||||||
# │ automagically be pulled via the $pkgArray[$distro] variable │
|
# │ automagically be pulled via the $pkgArray[$distro] variable │
|
||||||
# ╰─────────────────────────────────────────────────────────────────────────╯
|
# ╰─────────────────────────────────────────────────────────────────────────╯
|
||||||
depsDebian=(libcairo2-dev mesa-common-dev cmake libgbm-dev libdrm-dev libopengl-dev wayland-protocols wayland-utils libsdbus-c++-dev libhyprlang-dev hyprgraphics)
|
depsDebian=(libpixman-1-dev libcairo2-dev cmake wayland-protocols libwebp-dev libjpeg-dev libspng-dev libmagic-dev libcairo2-dev mesa-common-dev cmake libgbm-dev libdrm-dev libopengl-dev wayland-protocols wayland-utils libsdbus-c++-dev libhyprlang-dev hyprgraphics)
|
||||||
|
depsArch=(hyprutils hyprgraphics)
|
||||||
# depsUbuntu=()
|
# depsUbuntu=()
|
||||||
# depsFedora=()
|
# depsFedora=()
|
||||||
# depsOpensuse=()
|
# depsOpensuse=()
|
||||||
# depsArch=()
|
|
||||||
# depsAlpine=()
|
# depsAlpine=()
|
||||||
|
|
||||||
declare -A deps=(
|
declare -A deps=(
|
||||||
[debian]="depsDebian"
|
[debian]="depsDebian"
|
||||||
|
[arch]="depsArch"
|
||||||
# [ubuntu]="depsUbuntu"
|
# [ubuntu]="depsUbuntu"
|
||||||
# [fedora]="depsFedora"
|
# [fedora]="depsFedora"
|
||||||
# [arch]="depsArch"
|
|
||||||
# [alpine]="depsAlpine"
|
# [alpine]="depsAlpine"
|
||||||
# [opensuse]="depsOpensuse"
|
# [opensuse]="depsOpensuse"
|
||||||
)
|
)
|
||||||
|
@ -87,10 +87,16 @@ getDependencies() {
|
||||||
for pkg in "${pkgArray[@]}"; do
|
for pkg in "${pkgArray[@]}"; do
|
||||||
case "$pkg" in
|
case "$pkg" in
|
||||||
hyprgraphics)
|
hyprgraphics)
|
||||||
if checkComp; then
|
case "$distro" in
|
||||||
eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/hypr/hyprgraphics.sh)"
|
arch) checkAndInstall hyprgraphics ;;
|
||||||
|
debian)
|
||||||
|
if ! command_exists hyprutils; then
|
||||||
|
cloneAndBuildUtils &&
|
||||||
|
cloneAndBuildGraphics
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if checkComp; then
|
if checkComp; then
|
||||||
checkAndInstall "$pkg"
|
checkAndInstall "$pkg"
|
||||||
|
@ -100,13 +106,60 @@ getDependencies() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildGraphics() {
|
||||||
|
echo_info "Building hyprgraphics"
|
||||||
|
run cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
|
||||||
|
run cmake --build ./build --config Release --target all -j$(nproc 2>/dev/null || getconf NPROCESSORS_CONF)
|
||||||
|
}
|
||||||
|
|
||||||
|
cloneAndBuildGraphics() {
|
||||||
|
local cloneDir="$(mktemp -d)"
|
||||||
|
cd $cloneDir || mkdir -p "$cloneDir" && cd "$cloneDir"
|
||||||
|
|
||||||
|
git clone --depth=1 https://github.com/hyprwm/hyprgraphics.git &&
|
||||||
|
cd hyprgraphics
|
||||||
|
|
||||||
|
if build; then
|
||||||
|
echo_info "Installing package.."
|
||||||
|
$_sudo cmake --install build
|
||||||
|
else
|
||||||
|
echo_error "Build has failed for $distro compiling $PACKAGE"
|
||||||
|
return 69
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
buildUtils() {
|
||||||
|
echo_info "Building hyprutils"
|
||||||
|
run cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
|
||||||
|
run cmake --build ./build --config Release --target all -j$(nproc 2>/dev/null || getconf NPROCESSORS_CONF)
|
||||||
|
}
|
||||||
|
|
||||||
|
cloneAndBuildUtils() {
|
||||||
|
local cloneDir="$(mktemp -d)"
|
||||||
|
# local cloneDir="$HOME/.builds"
|
||||||
|
|
||||||
|
cd $cloneDir || mkdir -p $cloneDir && cd $cloneDir
|
||||||
|
|
||||||
|
echo_info "Cloning sources for $PACKAGE into $cloneDir/$PACKAGE"
|
||||||
|
git clone --depth=1 https://github.com/hyprwm/hyprutils.git &&
|
||||||
|
cd hyprutils
|
||||||
|
|
||||||
|
if build; then
|
||||||
|
echo_info "Installing package.."
|
||||||
|
$_sudo cmake --install build
|
||||||
|
else
|
||||||
|
echo_error "Build has failed for $distro compiling $package"
|
||||||
|
return 69
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
echo_info "Building $package"
|
echo_info "Building $package"
|
||||||
run cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
|
run cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
|
||||||
run cmake --build ./build --config Release --target hyprlock -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)
|
run cmake --build ./build --config Release --target hyprlock -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneAndBuild() {
|
cloneAndBuildLock() {
|
||||||
local cloneDir="$(mktemp -d)"
|
local cloneDir="$(mktemp -d)"
|
||||||
|
|
||||||
cd $cloneDir || mkdir -p $cloneDir && cd $cloneDir
|
cd $cloneDir || mkdir -p $cloneDir && cd $cloneDir
|
||||||
|
@ -126,10 +179,18 @@ cloneAndBuild() {
|
||||||
main() {
|
main() {
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
arch)
|
arch)
|
||||||
_install hyprlock
|
_install hyprlock hyprgraphics hyprutils
|
||||||
;;
|
;;
|
||||||
debian)
|
debian)
|
||||||
cloneAndBuild
|
if ! command_exists hyprutils; then
|
||||||
|
cloneAndBuildUtils
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command_exists hyprgraphics; then
|
||||||
|
cloneAndBuildGraphics
|
||||||
|
fi
|
||||||
|
|
||||||
|
cloneAndBuildLock
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "$distro is not supported by this script!"
|
echo "$distro is not supported by this script!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue