forked from Shinonome/dots-hyprland
chore: Added a fallback mechanism for build failures. (ref #2706)
This commit is contained in:
@@ -63,8 +63,6 @@ Wayland and X11.
|
|||||||
%endif
|
%endif
|
||||||
-DBUILD_SHARED_LIBS=OFF \
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DDISTRIBUTOR="Fedora COPR (errornointernet/quickshell)" \
|
|
||||||
-DDISTRIBUTOR_DEBUGINFO_AVAILABLE=YES \
|
|
||||||
-DGIT_REVISION=%{commit} \
|
-DGIT_REVISION=%{commit} \
|
||||||
-DINSTALL_QML_PREFIX=%{_lib}/qt6/qml
|
-DINSTALL_QML_PREFIX=%{_lib}/qt6/qml
|
||||||
%cmake_build
|
%cmake_build
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# This script is meant to be sourced.
|
# This script is meant to be sourced.
|
||||||
# It's not for directly running.
|
# It's not for directly running.
|
||||||
|
set -ex
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# CONFIG
|
# CONFIG
|
||||||
# -------------------------
|
# -------------------------
|
||||||
@@ -39,13 +39,19 @@ function install_RPMS() {
|
|||||||
x spectool -g -C "$rpmbuildroot/SOURCES" "$spec_file"
|
x spectool -g -C "$rpmbuildroot/SOURCES" "$spec_file"
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
r x sudo dnf builddep -y "$spec_file"
|
r x sudo dnf builddep -y "$spec_file"
|
||||||
# Build the RPM with proper quoting preserved
|
# Build the RPM package locally. If it fails, download it from COPR.
|
||||||
x rpmbuild -bb --define "_topdir $rpmbuildroot" "$spec_file"
|
if ! rpmbuild -bb --define "_topdir $rpmbuildroot" --define "debug_package %{nil}" "$spec_file"; then
|
||||||
|
printf "${STY_RED}Local build encountered an issue. Downloading $(basename "$spec_file" .spec) from COPR. Report the issue to Discussions pls.${STY_RST}\n"
|
||||||
|
sudo dnf install -y $(basename "$spec_file" .spec)
|
||||||
|
nolock_qs=true
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
mapfile -t -d '' local_rpms < <(find "$rpmbuildroot/RPMS" -maxdepth 2 -type f -name '*.rpm' -not -name '*debug*' -print0)
|
mapfile -t -d '' local_rpms < <(find "$rpmbuildroot/RPMS" -maxdepth 2 -type f -name '*.rpm' -not -name '*debug*' -print0)
|
||||||
echo -e "${STY_BLUE}Next command:${STY_RST} sudo dnf install ${local_rpms[@]} -y"
|
if [[ ${#local_rpms[@]} -ge 1 ]]; then
|
||||||
r x sudo dnf install "${local_rpms[@]}" -y
|
echo -e "${STY_BLUE}Next command:${STY_RST} sudo dnf install ${local_rpms[@]} -y"
|
||||||
|
r x sudo dnf install "${local_rpms[@]}" -y
|
||||||
|
fi
|
||||||
x cd ${REPO_ROOT}
|
x cd ${REPO_ROOT}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +106,7 @@ while IFS= read -r deps_list_key; do
|
|||||||
done < <(echo "$deps_data" | yq '.groups | keys[]? | select(length > 0)')
|
done < <(echo "$deps_data" | yq '.groups | keys[]? | select(length > 0)')
|
||||||
|
|
||||||
# Add back versionlock at the end
|
# Add back versionlock at the end
|
||||||
v sudo dnf versionlock add quickshell-git
|
[ -n $nolock_qs ] || v sudo dnf versionlock add quickshell-git || true
|
||||||
|
|
||||||
echo -e "\n========================================"
|
echo -e "\n========================================"
|
||||||
echo "All installations are completed."
|
echo "All installations are completed."
|
||||||
|
|||||||
Reference in New Issue
Block a user