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 <ikey.doherty@lispysnake.com>
pull/41/head
Ikey Doherty 4 years ago
parent 93f3c97a63
commit cc2dc97eab
No known key found for this signature in database
GPG Key ID: 9EC8151B1F7ADDEA

@ -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"

Loading…
Cancel
Save