Skip to content

Commit

Permalink
Fix future3 installation for bookworm (MiczFlor#2100)
Browse files Browse the repository at this point in the history
* add --break-system-packages option to pip3 install

as required for bookworm, see MiczFlor#2050 (comment)

* install libasound2-dev

to fix installation of pyalsaaudio via pip3

* install NodeJS and npm via official recommendation

see https://github.com/nodesource/distributions

* configure break-system-packages option globally

see discussion in MiczFlor#2100 (review)

* allow nginx (and others) to access /home/pi
  • Loading branch information
Chilipp authored Nov 11, 2023
1 parent 4667fc1 commit b7743da
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions installation/routines/setup_jukebox_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ _jukebox_core_install_os_dependencies() {
python3-rpi.gpio python3-gpiozero \
espeak ffmpeg mpg123 \
pulseaudio pulseaudio-module-bluetooth pulseaudio-utils caps \
libasound2-dev \
--no-install-recommends \
--allow-downgrades \
--allow-remove-essential \
--allow-change-held-packages

# add configuration that we break the global python system packages
# (required for bookworm, see
# https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/2050). This
# should be removed once the jukebox has been isolated to a dedicated
# venv
sudo python3 -m pip config set global.break-system-packages true

sudo pip3 install --upgrade pip
}

Expand Down
19 changes: 14 additions & 5 deletions installation/routines/setup_jukebox_webapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
GD_ID_COMPILED_WEBAPP="1EE_1MdneGtKL5V7GyYZC0nb6ODQWTsPb" # https://drive.google.com/file/d/1EE_1MdneGtKL5V7GyYZC0nb6ODQWTsPb/view?usp=sharing

# For ARMv7+
NODE_SOURCE="https://deb.nodesource.com/setup_16.x"
NODE_MAJOR=16
# For ARMv6
# To update version, follow these links
# https://github.com/sdesalas/node-pi-zero
Expand All @@ -26,12 +26,18 @@ _jukebox_webapp_install_node() {
# Zero and older versions of Pi with ARMv6 only
# support experimental NodeJS
if [[ $(uname -m) == "armv6l" ]]; then
NODE_SOURCE=${NODE_SOURCE_EXPERIMENTAL}
wget -O - ${NODE_SOURCE_EXPERIMENTAL} | sudo bash
sudo apt-get -qq -y install nodejs
sudo npm install --silent -g npm
else
# install NodeJS and npm as recommended in
# https://github.com/nodesource/distributions
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs npm -y
fi

wget -O - ${NODE_SOURCE} | sudo bash
sudo apt-get -qq -y install nodejs
sudo npm install --silent -g npm
fi
}

Expand Down Expand Up @@ -67,6 +73,9 @@ _jukebox_webapp_register_as_system_service_with_nginx() {
sudo mv -f /etc/nginx/sites-available/default /etc/nginx/sites-available/default.orig
sudo cp -f "${INSTALLATION_PATH}/resources/default-settings/nginx.default" /etc/nginx/sites-available/default

# make sure nginx can access the home directory of the user
sudo chmod o+x /home/pi

sudo service nginx restart
}

Expand Down

0 comments on commit b7743da

Please sign in to comment.