From cc2dc97eab5d8f9d4c6d6e3e7fc756dc06452383 Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Mon, 17 Feb 2020 11:17:46 +0000 Subject: [PATCH] build.sh: Add explicit support for Solus As Solus is in a longstanding transition away from the Pythonic eopkg package manager (a fork of PiSI) - some workarounds are required. In a nut shell, eopkg exit codes aren't applied to info/status commands, so we must use the Pythonic API. The 32-bit build dependencies are first calculated, and merged with the 'system.devel' component required for building any package on Solus. This is similar to 'build-essential' on other distributions. With this change, we can safely `./build.sh install` on Solus and have MANGOHUD=1 working with Vulkan applications, as tested on my own Solus installation with the Serpent demos in Vulkan mode with bgfx backend. Signed-off-by: Ikey Doherty --- build.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/build.sh b/build.sh index 9eca846d..34298099 100755 --- a/build.sh +++ b/build.sh @@ -75,6 +75,29 @@ dependencies() { rm bin/glslangValidator glslang-master-linux-Release.zip fi ;; + "Solus") + unset MANAGER_QUERY + unset DEPS + MANAGER_INSTALL="eopkg it" + + local packages=("mesalib-32bit-devel" "glslang" "libstdc++-32bit" "glibc-32bit-devel" "mako") + + # eopkg doesn't emit exit codes properly, so use the python API to find if a package is installed. + for package in ${packages[@]}; do + python -c "import pisi.db; import sys; idb = pisi.db.installdb.InstallDB(); sys.exit(0 if idb.has_package(\"${package}\") else 1)" + if [[ $? -ne 0 ]]; then + INSTALL="${INSTALL}""${package} " + fi + done + + # likewise, ensure the whole system.devel component is satisfied + python -c "import pisi.db; import sys; idb = pisi.db.installdb.InstallDB(); cdb = pisi.db.componentdb.ComponentDB(); mpkgs = [x for x in cdb.get_packages('system.devel') if not idb.has_package(x)]; sys.exit(0 if len(mpkgs) == 0 else 1)" + + if [[ $? -ne 0 ]]; then + INSTALL="${INSTALL}""-c system.devel " + fi + install + ;; *) echo "# Unable to find distro information!" echo "# Attempting to build regardless"