Add distrobox build support

This commit is contained in:
wheaney 2025-10-27 14:05:20 -07:00
parent be2469ebb0
commit a0388d074c
1 changed files with 28 additions and 8 deletions

View File

@ -23,12 +23,22 @@ check_command "curl"
print_missing_dependencies() {
echo ""
printf "\n\033[1;31mMissing required components\033[0m\n"
if [ -n "${BREEZY_DISTROBOX:-}" ]; then
echo ""
printf "\033[1;33mFirst, enter your Distrobox container:\033[0m\n"
printf "\tdistrobox enter $BREEZY_DISTROBOX\n"
fi
echo ""
echo "Install the corresponding packages with your package manager, then rerun this setup:"
echo " Debian/Ubuntu: sudo apt-get update && sudo apt-get install -y extra-cmake-modules kwin-dev libkf6config-dev libkf6configwidgets-dev libkf6coreaddons-dev libkf6kcmutils-dev libkf6globalaccel-dev libkf6i18n-dev libkf6windowsystem-dev libkf6xmlgui-dev qt6-base-dev qt6-declarative-dev libdrm-dev && (sudo apt-get install -y qml6-module-qtquick3d-helpers || true)"
echo " Fedora/RHEL: sudo dnf install -y extra-cmake-modules kwin-devel kf6-kconfig-devel kf6-kconfigwidgets-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kf6-kglobalaccel-devel kf6-ki18n-devel kf6-kwindowsystem-devel kf6-kxmlgui-devel qt6-qtbase-devel qt6-qttools-devel wayland-devel libepoxy-devel libdrm-devel"
echo " Arch: sudo pacman -S --needed extra-cmake-modules qt6-base qt6-declarative qt6-tools qt6-quick3d kconfig kconfigwidgets kcoreaddons kglobalaccel ki18n kcmutils kxmlgui kwindowsystem kwin"
printf "\033[1;33mInstall the missing packages\033[0m with your package manager, then rerun this setup:\n"
printf "\tDebian/Ubuntu:\tsudo apt-get update && sudo apt-get install -y extra-cmake-modules kwin-dev libkf6config-dev libkf6configwidgets-dev libkf6coreaddons-dev libkf6kcmutils-dev libkf6globalaccel-dev libkf6i18n-dev libkf6windowsystem-dev libkf6xmlgui-dev qt6-base-dev qt6-declarative-dev libdrm-dev && (sudo apt-get install -y qml6-module-qtquick3d-helpers || true)\n"
printf "\tFedora/RHEL:\tsudo dnf install -y cmake gc++ extra-cmake-modules kwin-devel kf6-kconfig-devel kf6-kconfigwidgets-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kf6-kglobalaccel-devel kf6-ki18n-devel kf6-kwindowsystem-devel kf6-kxmlgui-devel qt6-qtbase-devel qt6-qttools-devel qt6-qtquick3d wayland-devel libepoxy-devel libdrm-devel\n"
printf "\tArch:\t\tsudo pacman -S --needed extra-cmake-modules qt6-base qt6-declarative qt6-tools qt6-quick3d kconfig kconfigwidgets kcoreaddons kglobalaccel ki18n kcmutils kxmlgui kwindowsystem kwin\n"
echo ""
if [ -z "${BREEZY_DISTROBOX:-}" ]; then
printf "\033[1;33mOn immutable distributions\033[0m (e.g. Fedora Silverblue) you can run the build inside a container.\n"
printf "\tBREEZY_DISTROBOX=your-container-name %s\n" "$0 $*"
echo ""
fi
printf "\n\033[1;33mIf you continue to see this issue\033[0m rerun as follows and attach the full output to a bug report:\n"
printf "\n\tPRINT_FULL_STDERR=1 %s\n" "$0 $*"
exit 1
@ -114,13 +124,23 @@ then
pushd $start_dir > /dev/null
fi
echo "Building Breezy Desktop from source, this may take a while..."
set +e
pkgkwin_stderr=$(LOCAL_BUILD_SYSTEM=1 bin/package_kwin --download-driver 2>&1)
pkgkwin_rc=$?
distrobox_name="${BREEZY_DISTROBOX:-}"
if [ -n "$distrobox_name" ]; then
check_command "distrobox"
echo "Building Breezy Desktop from source inside Distrobox container: $distrobox_name"
build_dir=$(pwd)
distrobox_shell_cmd="cd \"$build_dir\" && LOCAL_BUILD_SYSTEM=1 bin/package_kwin --download-driver"
pkgkwin_stderr=$(distrobox enter --name "$distrobox_name" -- /bin/sh --noprofile --norc -lc "$distrobox_shell_cmd" 2>&1)
pkgkwin_rc=$?
else
echo "Building Breezy Desktop from source, this may take a while..."
pkgkwin_stderr=$(LOCAL_BUILD_SYSTEM=1 bin/package_kwin --download-driver 2>&1)
pkgkwin_rc=$?
fi
set -e
if [ "$pkgkwin_rc" -ne 0 ]; then
if echo "$pkgkwin_stderr" | grep -qi "could not find" && [ -z "${PRINT_FULL_STDERR+x}" ]; then
if echo "$pkgkwin_stderr" | grep -qiE 'could not find|Please install "cmake"' && [ -z "${PRINT_FULL_STDERR+x}" ]; then
print_missing_dependencies "$*"
else
echo "$pkgkwin_stderr"