From 04cc988e5c9721e88dc92236aa93868c0b0a7a78 Mon Sep 17 00:00:00 2001 From: clsty Date: Sun, 16 Jun 2024 22:01:01 +0800 Subject: [PATCH] Add PKGBUILD for AGS for arch(based) distros --- arch-packages/illogical-impulse-ags/.SRCINFO | 36 ++++++++++++++ arch-packages/illogical-impulse-ags/PKGBUILD | 50 ++++++++++++++++++++ install.sh | 21 +++----- manual-install-helper.sh | 17 +++++++ non-Arch-installer.temp.sh | 19 -------- scriptdata/installers | 2 + scriptdata/options | 4 +- update-ags.sh | 13 ----- 8 files changed, 113 insertions(+), 49 deletions(-) create mode 100644 arch-packages/illogical-impulse-ags/.SRCINFO create mode 100644 arch-packages/illogical-impulse-ags/PKGBUILD create mode 100755 manual-install-helper.sh delete mode 100755 non-Arch-installer.temp.sh delete mode 100755 update-ags.sh diff --git a/arch-packages/illogical-impulse-ags/.SRCINFO b/arch-packages/illogical-impulse-ags/.SRCINFO new file mode 100644 index 000000000..8a36546b2 --- /dev/null +++ b/arch-packages/illogical-impulse-ags/.SRCINFO @@ -0,0 +1,36 @@ +pkgbase = ii-aylurs-gtk-shell-git + pkgdesc = Aylurs's Gtk Shell (AGS), version fixed for illogical-impulse dotfiles + pkgver = 1.8.2.r2.g1115022 + pkgrel = 1 + url = https://github.com/Aylur/ags + arch = x86_64 + license = GPL3 + makedepends = git + makedepends = gobject-introspection + makedepends = meson + makedepends = npm + makedepends = typescript + depends = gjs + depends = glib2 + depends = glib2-devel + depends = glibc + depends = gtk3 + depends = gtk-layer-shell + depends = libpulse + depends = pam + optdepends = gnome-bluetooth-3.0: required for bluetooth service + optdepends = greetd: required for greetd service + optdepends = libdbusmenu-gtk3: required for systemtray service + optdepends = libsoup3: required for the Utils.fetch feature + optdepends = libnotify: required for sending notifications + optdepends = networkmanager: required for network service + optdepends = power-profiles-daemon: required for powerprofiles service + optdepends = upower: required for battery service + conflicts = aylurs-gtk-shell + backup = etc/pam.d/ags + source = git+https://github.com/Aylur/ags + source = git+https://gitlab.gnome.org/GNOME/libgnome-volume-control + sha256sums = SKIP + sha256sums = SKIP + +pkgname = aylurs-gtk-shell-git diff --git a/arch-packages/illogical-impulse-ags/PKGBUILD b/arch-packages/illogical-impulse-ags/PKGBUILD new file mode 100644 index 000000000..7a941a5c2 --- /dev/null +++ b/arch-packages/illogical-impulse-ags/PKGBUILD @@ -0,0 +1,50 @@ +# Copied from AUR package maintained by kotontrion +pkgname=illogical-impulse-ags +_pkgname=ags +pkgver=r525.05e0f23 +pkgrel=1 +pkgdesc="Aylurs's Gtk Shell (AGS), version fixed for illogical-impulse dotfiles." +arch=('x86_64') +url="https://github.com/Aylur/ags" +license=('GPL3') +makedepends=('git' 'gobject-introspection' 'meson' 'npm' 'typescript') +depends=('gjs' 'glib2' 'glib2-devel' 'glibc' 'gtk3' 'gtk-layer-shell' 'libpulse' 'pam') +optdepends=('gnome-bluetooth-3.0: required for bluetooth service' + 'greetd: required for greetd service' + 'libdbusmenu-gtk3: required for systemtray service' + 'libsoup3: required for the Utils.fetch feature' + 'libnotify: required for sending notifications' + 'networkmanager: required for network service' + 'power-profiles-daemon: required for powerprofiles service' + 'upower: required for battery service') +conflicts=('aylurs-gtk-shell' 'aylurs-gtk-shell-git') +backup=('etc/pam.d/ags') +source=("git+${url}.git#commit=05e0f23534fa30c1db2a142664ee8f71e38db260" + "git+https://gitlab.gnome.org/GNOME/libgnome-volume-control") +sha256sums=('SKIP' + 'SKIP') + +pkgver(){ + cd $srcdir/$_pkgname + printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd $srcdir/$_pkgname + git submodule init + git config submodule.subprojects/gvc.url "$srcdir/libgnome-volume-control" + git -c protocol.file.allow=always submodule update +} + +build() { + cd $srcdir/$_pkgname + npm install + arch-meson build --libdir "lib/$_pkgname" -Dbuild_types=true + meson compile -C build +} + +package() { + cd $srcdir/$_pkgname + meson install -C build --destdir "$pkgdir" + ln -sf /usr/share/com.github.Aylur.ags/com.github.Aylur.ags ${pkgdir}/usr/bin/ags +} diff --git a/install.sh b/install.sh index 9b1339d8c..024eebc6d 100755 --- a/install.sh +++ b/install.sh @@ -127,7 +127,7 @@ install-local-pkgbuild() { } # Install core dependencies from the meta-packages -metapkgs=(./arch-packages/illogical-impulse-{audio,backlight,basic,fonts-themes,gnome,gtk,microtex,portal,python,screencapture,widgets}) +metapkgs=(./arch-packages/illogical-impulse-{audio,backlight,basic,ags,fonts-themes,gnome,gtk,microtex,portal,python,screencapture,widgets}) for i in "${metapkgs[@]}"; do metainstallflags="--needed" @@ -189,19 +189,6 @@ v systemctl --user enable ydotool --now printf "\e[36m[$0]: 2. Installing parts from source repo\e[0m\n" sleep 1 -case $SKIP_AGS in - true) sleep 0;; - *) - if command -v ags >/dev/null 2>&1;then - echo -e "\e[33m[$0]: Command \"ags\" already exists, no need to install.\e[0m" - echo -e "\e[34mYou can reinstall it in order to update to the latest version anyway.\e[0m" - ask_ags=$ask - else ask_ags=true - fi - if $ask_ags;then showfun install-ags;v install-ags;fi - ;; -esac - if $(fc-list|grep -q Rubik); then echo -e "\e[33m[$0]: Font \"Rubik\" already exists, no need to install.\e[0m" echo -e "\e[34mYou can reinstall it in order to update to the latest version anyway.\e[0m" @@ -331,6 +318,9 @@ try hyprctl reload existed_zsh_conf=n grep -q 'source ${XDG_CONFIG_HOME:-~/.config}/zshrc.d/dots-hyprland.zsh' ~/.zshrc && existed_zsh_conf=y +existed_ags_localbin=n +test -f /usr/local/bin/ags && existed_ags_localbin=y + ##################################################################################### printf "\e[36m[$0]: Finished. See the \"Import Manually\" folder and grab anything you need.\e[0m\n" printf "\n" @@ -352,3 +342,6 @@ case $existed_hypr_conf in printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\" as a reference for a proper format.\e[0m\n" printf "\e[33mIf this is your first time installation, you must overwrite \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" with \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\".\e[0m\n" ;;esac +case $existed_ags_localbin in + y) printf "\n\e[31m[$0]: \!! Important \!! : Please delete \"/usr/local/bin/ags\" manually as soon as possible, since we\'re now using local PKGBUILD to build AGS for Arch(based) Linux distros, and \"/usr/local/bin/ags\" takes precedence over it.\e[0m\n" +;;esac diff --git a/manual-install-helper.sh b/manual-install-helper.sh new file mode 100755 index 000000000..a761a5563 --- /dev/null +++ b/manual-install-helper.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# This script is for installing/updating some "packages" for non-Arch users. +# + +cd "$(dirname "$0")" +export base="$(pwd)" +source ./scriptdata/functions +source ./scriptdata/installers + +if command -v pacman >/dev/null 2>&1;then printf "\e[31m[$0]: pacman found, it seems that the system is ArchLinux or Arch-based distro. Aborting...\e[0m\n";exit 1;fi +install-ags +install-Rubik +install-Gabarito +install-OneUI +install-bibata +install-MicroTeX diff --git a/non-Arch-installer.temp.sh b/non-Arch-installer.temp.sh deleted file mode 100755 index 07d4de79d..000000000 --- a/non-Arch-installer.temp.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# -# This script is for installing/updating some "packages" which are not installed by system package managers. -# Its functions are contained in `install.sh` already, and this just makes it more convenient for non-Arch users. -# -# Though this is not elegant at all. I may improve the method some day in the future. -# - -cd "$(dirname "$0")" -export base="$(pwd)" -source ./scriptdata/functions -source ./scriptdata/installers - -install-ags -install-Rubik -install-Gabarito -install-OneUI -install-bibata -install-MicroTeX diff --git a/scriptdata/installers b/scriptdata/installers index 74b7a8798..80c0c7842 100644 --- a/scriptdata/installers +++ b/scriptdata/installers @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# TODO: This file should be provided for non-Arch(based) distros. As for Arch Linux, we should write local PKGBUILDs, which is the "right" way compared to copying files directly into /usr/local/* . + # This script depends on `functions' . # This is NOT a script for execution, but for loading functions, so NOT need execution permission. # NOTE that you NOT need to `cd ..' because the `$0' is NOT this file, but the script file which will source this file. diff --git a/scriptdata/options b/scriptdata/options index 94b8a2628..bffdd1ef8 100644 --- a/scriptdata/options +++ b/scriptdata/options @@ -14,7 +14,6 @@ If no option is specified, run default install process. -f, --force (Dangerous) Force mode without any confirm -c, --clean Clean the build cache first -s, --skip-sysupdate Skip \"sudo pacman -Syu\" - --skip-ags Skip installing ags and its config --skip-hyprland Skip installing the config for Hyprland --skip-hypr-aur Skip installing hyprland-git --skip-pymyc-aur Skip installing python-materialyoucolor-git, gradience-git, @@ -36,7 +35,7 @@ cleancache(){ # `man getopt` to see more para=$(getopt \ -o hfk:cs \ - -l help,force,fontset:,deplistfile:,clean,skip-sysupdate,skip-ags,skip-fish,skip-hyprland,skip-hypr-aur,skip-pymyc-aur,skip-plasmaintg,skip-miscconf \ + -l help,force,fontset:,deplistfile:,clean,skip-sysupdate,skip-fish,skip-hyprland,skip-hypr-aur,skip-pymyc-aur,skip-plasmaintg,skip-miscconf \ -n "$0" -- "$@") [ $? != 0 ] && echo "$0: Error when getopt, please recheck parameters." && exit 1 ##################################################################################### @@ -63,7 +62,6 @@ while true ; do ## Ones without parameter -f|--force) ask=false;shift;; -s|--skip-sysupdate) SKIP_SYSUPDATE=true;shift;; - --skip-ags) SKIP_AGS=true;shift;; --skip-hyprland) SKIP_HYPRLAND=true;shift;; --skip-hypr-aur) SKIP_HYPR_AUR=true;shift;; --skip-pymyc-aur) SKIP_PYMYC_AUR=true;shift;; diff --git a/update-ags.sh b/update-ags.sh deleted file mode 100755 index cf15747f4..000000000 --- a/update-ags.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# This script showed one reason about why it's good to split functions and installers in another file. -# -# This script is for install/update ags itself, NOT the config for it. -# The install.sh will install ags for you, why you still need this? -# Because you may run this script to ONLY update ags, since ags is a very active project currently and updates frequently. -# -cd "$(dirname "$0")" -export base="$(pwd)" -source ./scriptdata/functions -source ./scriptdata/installers - -install-ags