Improvement for python installation

This commit is contained in:
clsty
2025-02-04 23:14:04 +08:00
parent f06c831887
commit 7935d14d61
4 changed files with 36 additions and 34 deletions
@@ -1,15 +1,16 @@
pkgname=illogical-impulse-python pkgname=illogical-impulse-python
pkgver=1.1 pkgver=1.1
pkgrel=1 pkgrel=2
pkgdesc='Illogical Impulse Python Dependencies' pkgdesc='Illogical Impulse Python Dependencies'
arch=(any) arch=(any)
license=(None) license=(None)
depends=( depends=(
gtk4 uv
libadwaita gtk4
libsoup3 libadwaita
libportal-gtk4 libsoup3
blueprint-compiler libportal-gtk4
gobject-introspection blueprint-compiler
sassc gobject-introspection
sassc
) )
+7 -22
View File
@@ -130,28 +130,9 @@ for i in "${metapkgs[@]}"; do
v install-local-pkgbuild "$i" "$metainstallflags" v install-local-pkgbuild "$i" "$metainstallflags"
done done
ags_state_dir=~/.local/state/ags # These python packages are installed using uv, not pacman.
showfun install-python-packages
showfun install-uv v install-python-packages
v install-uv
x mkdir -p $ags_state_dir
# we need python 3.12 https://github.com/python-pillow/Pillow/issues/8089
x uv venv --prompt .venv $PYTHON_VENV_PATH -p 3.12
x source $PYTHON_VENV_PATH/bin/activate
x uv pip install -r scriptdata/requirements.txt
# install gradience
gradience_dir=/tmp/gradience
x git clone https://github.com/ZeyadMoustafaKamal/Gradience.git $gradience_dir
x cd $gradience_dir
x git submodule update --init --recursive
x uv pip install -r requirements.txt
x meson setup build --prefix=$VIRTUAL_ENV
x meson compile -C build
x meson install -C build
x cd -
x deactivate # We don't need the virtual environment anymore
# Why need cleanbuild? see https://github.com/end-4/dots-hyprland/issues/389#issuecomment-2040671585 # Why need cleanbuild? see https://github.com/end-4/dots-hyprland/issues/389#issuecomment-2040671585
# Why install deps by running a seperate command? see pinned comment of https://aur.archlinux.org/packages/hyprland-git # Why install deps by running a seperate command? see pinned comment of https://aur.archlinux.org/packages/hyprland-git
@@ -321,6 +302,10 @@ case $existed_hypr_conf in
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" 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 ;;esac
if [[ -z "${ILLOGICAL_IMPULSE_VIRTUAL_ENV}" ]]; then
printf "\n\e[31m[$0]: \!! Important \!! : Please ensure environment variable \e[0m \$ILLOGICAL_IMPULSE_VIRTUAL_ENV \e[31m is set to proper value (by default \"~/.local/state/ags/.venv\"), or AGS config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.\e[0m\n"
fi
if [[ ! -z "${warn_files[@]}" ]]; then if [[ ! -z "${warn_files[@]}" ]]; then
printf "\n\e[31m[$0]: \!! Important \!! : Please delete \e[0m ${warn_files[*]} \e[31m manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.\e[0m\n" printf "\n\e[31m[$0]: \!! Important \!! : Please delete \e[0m ${warn_files[*]} \e[31m manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.\e[0m\n"
fi fi
+1 -1
View File
@@ -7,4 +7,4 @@ XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
BACKUP_DIR=${BACKUP_DIR:-$HOME/backup} BACKUP_DIR=${BACKUP_DIR:-$HOME/backup}
UV_NO_MODIFY_PATH=1 UV_NO_MODIFY_PATH=1
PYTHON_VENV_PATH=$XDG_STATE_HOME/ags/.venv PYTHON_VENV_PATH=$XDG_STATE_HOME/ags/.venv
PYTHON_BIN_PATH=$PYTHON_VENV_PATH/bin/python #PYTHON_BIN_PATH=$PYTHON_VENV_PATH/bin/python
+19 -3
View File
@@ -113,7 +113,23 @@ install-MicroTeX (){
x cd $base x cd $base
} }
install-uv (){ # Below command can be used to install uv, but it's already an Arch package so...
x curl -LsSf https://astral.sh/uv/install.sh | sh # curl -LsSf https://astral.sh/uv/install.sh | sh
} install-python-packages (){
x mkdir -p $PYTHON_VENV_PATH
# we need python 3.12 https://github.com/python-pillow/Pillow/issues/8089
x uv venv --prompt .venv $PYTHON_VENV_PATH -p 3.12
x source $PYTHON_VENV_PATH/bin/activate
x uv pip install -r scriptdata/requirements.txt
x mkdir -p $base/cache/gradience && cd $base/cache/gradience
try git init -b main
try git remote add origin https://github.com/clsty/ii-gradience.git
x git pull origin main && git submodule update --init --recursive
x uv pip install -r requirements.txt
x meson setup build --prefix=$VIRTUAL_ENV
x meson compile -C build
x meson install -C build
x cd -
x deactivate # We don't need the virtual environment anymore
}