Skip to content

Commit

Permalink
snapcast: downgrade boost and use download
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Jan 8, 2024
1 parent 7df5baf commit 86a9a26
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
14 changes: 11 additions & 3 deletions packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ get_src_filename() {
fi
}

download_file() {
local filename="$1"
local download_dir="$2"
local url="$3"

wget --no-check-certificate --tries=5 --retry-connrefused --waitretry=5 \
--trust-server-names --progress=bar:force:noscroll \
-O ${filename} -P "${download_dir}" "${url}"
}

download_package_src() {
if [[ ! -z "${PACKAGE_SRC}" ]]; then
local src_filename=`get_src_filename`
Expand All @@ -180,9 +190,7 @@ download_package_src() {
echo "Using cached download"
else
echo "Downloading package source..."
wget --no-check-certificate --tries=5 --retry-connrefused --waitretry=5 \
--trust-server-names --progress=bar:force:noscroll \
-O ${src_filename} -P ${PACKAGE_SRC_DOWNLOAD_DIR} "${PACKAGE_SRC}"
download_file "${src_filename}" "${PACKAGE_SRC_DOWNLOAD_DIR}" "${PACKAGE_SRC}"
fi
else
echo_error "Error: Invalid package source specified!"
Expand Down
20 changes: 13 additions & 7 deletions packages/snapcast/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,31 @@ PACKAGE_NAME="Snapcast"
PACKAGE_VERSION="0.25.0"
PACKAGE_SRC="https://github.com/badaix/snapcast/archive/v${PACKAGE_VERSION}.tar.gz"
PACKAGE_DEPENDS="alsa libvorbis opus flac soxr avahi expat"
BOOST_VERSION="1.84.0"
BOOST_VERSION="1.76.0"
BOOST="boost_${BOOST_VERSION//./_}"
BUILD_TARGETS="server client"

if [ "${BUILD_MODEL}" = "LX01" ]; then
BUILD_TARGETS="client"
fi

preconfigure_package() {
if [ ! -e "${PACKAGE_SRC_DOWNLOAD_DIR}/${BOOST}.tar.gz" ]; then
echo_info "downloading boost lib"
wget -P ${PACKAGE_SRC_DOWNLOAD_DIR} https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/${BOOST}.tar.gz
prepare_boost() {
BOOST_PKG="${PACKAGE_SRC_DOWNLOAD_DIR}/../boost/${BOOST}.tar.gz"
BOOST_SRC="https://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/${BOOST}.tar.gz/download"
if [ ! -e "${BOOST_PKG}" ]; then
echo_info "downloading boost lib"
download_file "${BOOST_PKG}" "`dirname ${BOOST_PKG}`" "${BOOST_SRC}"
fi
echo_info "extracting boost lib"
tar xzf ${PACKAGE_SRC_DOWNLOAD_DIR}/${BOOST}.tar.gz -C ${PACKAGE_SRC_DIR}
tar xzf "${BOOST_PKG}" -C "${PACKAGE_SRC_DIR}"
}

preconfigure_package() {
prepare_boost
}

make_package() {
ADD_FLAGS="-I${PACKAGE_SRC_DIR} -I${STAGING_DIR}/${INSTALL_PREFIX}/${BUILD_TARGET}/include ${BUILD_CFLAGS} --sysroot=${STAGING_DIR}"
ADD_FLAGS="-I${PACKAGE_SRC_DIR}/${BOOST} -I${STAGING_DIR}/${INSTALL_PREFIX}/${BUILD_TARGET}/include ${BUILD_CFLAGS} --sysroot=${STAGING_DIR}"

make -j${MAKE_JOBS} \
CC="${BUILD_CC}" CXX="${BUILD_CXX}" \
Expand Down

0 comments on commit 86a9a26

Please sign in to comment.