Skip to content

Commit

Permalink
fix folder handling ZMQ_TMP_DIR.
Browse files Browse the repository at this point in the history
use ZMQ_TMP_DIR as prefix
  • Loading branch information
AlvinSchiller committed Dec 5, 2023
1 parent ecdc15e commit 440568b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions installation/routines/setup_jukebox_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ GD_ID_COMPILED_LIBZMQ_ARMV6="1iygOm-G1cg_3YERuVRT6FhGBE34ZkwgV" # ARMv6: https:/
GD_ID_COMPILED_PYZMQ_ARMV7=""
GD_ID_COMPILED_PYZMQ_ARMV6="1lDsV_pVcXbg6YReHb9AldMkyRZCpc6-n" # https://drive.google.com/file/d/1lDsV_pVcXbg6YReHb9AldMkyRZCpc6-n/view?usp=sharing

ZMQ_TMP_DIR="libzmq"
ZMQ_PREFIX="/usr/local"
ZMQ_TMP_DIR="${HOME_PATH}/libzmq"

JUKEBOX_PULSE_CONFIG="${HOME_PATH}"/.config/pulse/default.pa
JUKEBOX_SERVICE_NAME="${SYSTEMD_USR_PATH}/jukebox-daemon.service"
Expand Down Expand Up @@ -55,27 +54,27 @@ _jukebox_core_build_libzmq_with_drafts() {
LIBSODIUM_VERSION="1.0.18"
ZMQ_VERSION="4.3.4"

{ cd "${HOME_PATH}" && mkdir "${ZMQ_TMP_DIR}" && cd "${ZMQ_TMP_DIR}"; } || exit_on_error
cd "${ZMQ_TMP_DIR}" || exit_on_error
wget --quiet https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}-RELEASE/libsodium-${LIBSODIUM_VERSION}.tar.gz
tar -zxvf libsodium-${LIBSODIUM_VERSION}.tar.gz
cd libsodium-${LIBSODIUM_VERSION} || exit_on_error
./configure
make && make install

cd "${HOME}/${ZMQ_TMP_DIR}" || exit_on_error
cd "${ZMQ_TMP_DIR}" || exit_on_error
wget https://github.com/zeromq/libzmq/releases/download/v${ZMQ_VERSION}/zeromq-${ZMQ_VERSION}.tar.gz -O libzmq.tar.gz
tar -xzf libzmq.tar.gz
zeromq-${ZMQ_VERSION}/configure --prefix=${ZMQ_PREFIX} --enable-drafts
zeromq-${ZMQ_VERSION}/configure --prefix=${ZMQ_TMP_DIR} --enable-drafts
make && make install
}

_jukebox_core_download_prebuilt_libzmq_with_drafts() {
local ZMQ_TAR_FILENAME="libzmq.tar.gz"

cd "${ZMQ_TMP_DIR}" || exit_on_error
_download_file_from_google_drive "${LIBZMQ_GD_DOWNLOAD_ID}" "${ZMQ_TAR_FILENAME}"
tar -xzf ${ZMQ_TAR_FILENAME}
rm -f ${ZMQ_TAR_FILENAME}
sudo rsync -a ./* ${ZMQ_PREFIX}/
}

_jukebox_core_build_and_install_pyzmq() {
Expand All @@ -92,8 +91,6 @@ _jukebox_core_build_and_install_pyzmq() {
# Download pre-compiled libzmq from Google Drive because RPi has trouble compiling it
echo " Download pre-compiled libzmq from Google Drive because RPi has trouble compiling it"

{ cd "${HOME_PATH}" && mkdir "${ZMQ_TMP_DIR}" && cd "${ZMQ_TMP_DIR}"; } || exit_on_error

# ARMv7 as default
LIBZMQ_GD_DOWNLOAD_ID=${GD_ID_COMPILED_LIBZMQ_ARMV7}
if [[ $(uname -m) == "armv6l" ]]; then
Expand All @@ -102,13 +99,14 @@ _jukebox_core_build_and_install_pyzmq() {
_show_slow_hardware_message
fi

mkdir -p "${ZMQ_TMP_DIR}" || exit_on_error
if [ "$BUILD_LIBZMQ_WITH_DRAFTS_ON_DEVICE" = true ] ; then
_jukebox_core_build_libzmq_with_drafts
else
_jukebox_core_download_prebuilt_libzmq_with_drafts
fi

ZMQ_PREFIX="${ZMQ_PREFIX}" ZMQ_DRAFT_API=1 \
ZMQ_PREFIX="${ZMQ_TMP_DIR}" ZMQ_DRAFT_API=1 \
pip install --no-cache-dir --no-binary "pyzmq" --pre pyzmq
else
echo " Skipping. pyzmq already installed" | tee /dev/fd/3
Expand Down

0 comments on commit 440568b

Please sign in to comment.