diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d4a3eb9..7508fefd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ # Changelog All notable changes to Crowsnest will be documented in this file. +## [4.1.5](https://github.com/mainsail-crew/crowsnest/releases/tag/v4.1.5) - 2024-02-28 +### Bug Fixes and Improvements + +- Fix ustreamer binary path for v5.52 changes ([#245](https://github.com/mainsail-crew/crowsnest/pull/245)) + ## [4.1.4](https://github.com/mainsail-crew/crowsnest/releases/tag/v4.1.4) - 2024-02-17 ### Bug Fixes and Improvements diff --git a/bin/build.sh b/bin/build.sh index e8f93228..05559ff5 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -26,8 +26,10 @@ set -Ee # Base Path BASE_CN_BIN_PATH="$(dirname "$(readlink -f "${0}")")" +. "${BASE_CN_BIN_PATH%%/bin}/resources/backend_versions.txt" + # Clone Flags -CLONE_FLAGS=(--depth=1 --single-branch) +CLONE_FLAGS=(--single-branch) # Ustreamer repo USTREAMER_PATH="ustreamer" @@ -54,6 +56,34 @@ ALL_PATHS=( "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" ) +### Messages +error_msg_build() { + printf "Something went wrong!\nPlease copy the latest output, head over to\n" + printf "\thttps://discord.gg/mainsail\n" + printf "and open a ticket in #supportforum..." +} + +status_msg_build() { + local msg status + msg="${1}" + status="${2}" + printf "%s\r" "${msg}" + if [[ "${status}" == "0" ]]; then + printf "%s [\e[32mOK\e[0m]\n" "${msg}" + fi + if [[ "${status}" == "1" ]]; then + printf "%s [\e[31mFAILED\e[0m]\n" "${msg}" + error_msg_build + exit 1 + fi + if [[ "${status}" == "2" ]]; then + printf "%s [\e[33mSKIPPED\e[0m]\n" "${msg}" + fi + if [[ "${status}" == "3" ]]; then + printf "%s [\e[33mFAILED\e[0m]\n" "${msg}" + fi +} + # Helper messages show_help() { printf "Usage %s [options]\n" "$(basename "${0}")" @@ -124,10 +154,16 @@ clone_ustreamer() { printf "%s already exist ... [SKIPPED]\n" "${USTREAMER_PATH}" return fi + + printf "\nCloning ustreamer ...\n" git clone "${CROWSNEST_USTREAMER_REPO_SHIP}" \ -b "${CROWSNEST_USTREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" + + printf "\nReset to specified ustreamer commit ...\n" + git -C "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ + reset --hard "${CROWSNEST_USTREAMER_REPO_COMMIT}" } ### Clone camera-streamer @@ -141,19 +177,29 @@ clone_cstreamer() { printf "Device is not supported! Cloning camera-streamer ... [SKIPPED]\n" return fi + if [[ -d "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" ]]; then printf "%s already exist ... [SKIPPED]\n" "${CSTREAMER_PATH}" return fi + + CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MASTER}" if [[ "$(is_bookworm)" = "1" ]]; then printf "\nBookworm detected!\n" - printf "Using main branch of camera-streamer for Bookworm ...\n\n" + printf "Using main branch of camera-streamer for Bookworm ...\n" CROWSNEST_CAMERA_STREAMER_REPO_BRANCH="main" + CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN}" fi + + printf "\nCloning camera-streamer ...\n" git clone "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" \ -b "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" --recurse-submodules --shallow-submodules + + printf "\nReset to specified camera-streamer commit ...\n" + git -C "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ + reset --hard "${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT}" } ### Clone Apps diff --git a/resources/backend_versions.txt b/resources/backend_versions.txt new file mode 100644 index 00000000..399c842e --- /dev/null +++ b/resources/backend_versions.txt @@ -0,0 +1,12 @@ +#### crowsnest - A webcam Service for multiple Cams and Stream Services. +#### +#### Written by Patrick Gehrsitz aka mryel00 +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/crowsnest +#### +#### This File is distributed under GPLv3 +#### + +CROWSNEST_USTREAMER_REPO_COMMIT="81756811f3c925174f05300a9301bb722b9cbfb5" +CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MASTER="fe701b83da35598af4fc1d77c717c8a67cac9edd" +CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN="bc231917d811e4a6661fc0b01b3e3750c6babd59" diff --git a/tools/libs/build_apps.sh b/tools/libs/build_apps.sh index 2ed84f24..bc4525c8 100755 --- a/tools/libs/build_apps.sh +++ b/tools/libs/build_apps.sh @@ -43,15 +43,7 @@ clone_cstreamer() { } build_apps() { - msg "Build dependend Stream Apps ..." - msg "Cloning ustreamer repository ..." - clone_ustreamer - ## Detect Image build for Raspberrys - if [[ "${CN_INSTALL_CS}" = "1" ]]; then - msg "Cloning camera-streamer repository ..." - clone_cstreamer - else - msg "Install of camera-streamer skipped, only supported on Raspberry SBC's! ... " - fi + export CN_INSTALL_CS + sudo -E -u "${BASE_USER}" "${PWD}"/bin/build.sh --reclone sudo -u "${BASE_USER}" "${PWD}"/bin/build.sh --build }