diff --git a/packages.sh b/packages.sh index 7b0039a..d9c6976 100755 --- a/packages.sh +++ b/packages.sh @@ -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` @@ -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!" diff --git a/packages/snapcast/package.mk b/packages/snapcast/package.mk index 288f631..9a02db1 100644 --- a/packages/snapcast/package.mk +++ b/packages/snapcast/package.mk @@ -2,7 +2,7 @@ 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" @@ -10,17 +10,23 @@ 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}" \