Skip to content

Commit

Permalink
build.sh: Add explicit support for Solus
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ikeycode committed Feb 17, 2020
1 parent 93f3c97 commit cc2dc97
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cc2dc97

Please sign in to comment.