Skip to content

Commit

Permalink
[Install-arch] Improved install of AUR Packages
Browse files Browse the repository at this point in the history
Improved install of AUR Packages:
- no requirement for pamac
- reduced footprint
- easier to install (no pamac aur package requirement)
  • Loading branch information
Xeroxxx authored Aug 9, 2023
1 parent ab74f60 commit 14413c6
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions scripts/install-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

PYTHONDIR="${HOME}/klippy-env"
SYSTEMDDIR="/etc/systemd/system"
AURCLIENT="pamac"
TMPDIR="/tmp"
KLIPPER_USER=$USER
KLIPPER_GROUP=$KLIPPER_USER

Expand All @@ -19,17 +19,31 @@ install_packages()
# AVR chip installation and building
PKGLIST="${PKGLIST} avrdude avr-gcc avr-binutils avr-libc"
# ARM chip installation and building
AURLIST="stm32flash"
PKGLIST="${PKGLIST} arm-none-eabi-newlib"
PKGLIST="${PKGLIST} arm-none-eabi-gcc arm-none-eabi-binutils"

# Install desired packages
report_status "Installing packages..."
sudo pacman --needed -S ${PKGLIST}
$AURCLIENT build ${AURLIST}
}

# Step 2: Create python virtual environment
# Step 2: Install aur packages
install_aur_packages()
{
# AUR Package Array, separate by space
AURLIST=("stm32flash")

report_status "Installing AUR packages..."
for PKG in ${AURLIST[@]}; do
git clone https://aur.archlinux.org/${PKG}.git ${TMPDIR}/${PKG}
cd ${TMPDIR}/${PKG}
makepkg
sudo pacman -U ${PKG}-*.pkg.tar.zst
rm -rf ${TMPDIR}/${PKG}
done
}

# Step 3: Create python virtual environment
create_virtualenv()
{
report_status "Updating python virtual environment..."
Expand All @@ -41,7 +55,7 @@ create_virtualenv()
${PYTHONDIR}/bin/pip install -r ${SRCDIR}/scripts/klippy-requirements.txt
}

# Step 3: Install startup script
# Step 4: Install startup script
install_script()
{
# Create systemd service file
Expand All @@ -67,7 +81,7 @@ EOF
report_status "Make sure to add $KLIPPER_USER to the user group controlling your serial printer port"
}

# Step 4: Start host software
# Step 5: Start host software
start_software()
{
report_status "Launching Klipper host software..."
Expand Down Expand Up @@ -97,6 +111,7 @@ SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )"
# Run installation steps defined above
verify_ready
install_packages
install_aur_packages()
create_virtualenv
install_script
start_software

0 comments on commit 14413c6

Please sign in to comment.