1 commit b273c9f7ab10475787db4d6e09bd4b71b374d0ec
2 Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
3 Date: Thu Mar 18 01:28:46 2021 +0100
5 Let user specify solo5-binding to use
7 This is a little feature for the configure script I wanted to have for
8 the NixOS package: It allows the user to set PKG_CONFIG_DEPS before
9 running configure.sh to disable the autodetection mechanism. This is
10 useful for NixOS as we have all bindings bundled in the solo5 package,
11 so the result would also be solo5-bindings-xen. Additionally, it allows
12 us to do the binding selection declaratively and minimize the risk of
13 accidentally switching backend.
15 PKG_CONFIG_DEPS seems like a bit of an unappropriate variable name for a
16 user “interface”, let me know if you want a dedicated environment
17 variable for this in case there will be more PKG_CONFIG_DEPS.
19 diff --git a/configure.sh b/configure.sh
20 index c254f7b..c675a02 100755
23 @@ -11,13 +11,19 @@ if pkg_exists solo5-bindings-hvt solo5-bindings-spt solo5-bindings-virtio solo5-
24 echo "ERROR: Only one of solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode, solo5-bindings-xen can be installed." 1>&2
28 -pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt
29 -pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt
30 -pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen
31 -pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio
32 -pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode
33 -pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen
34 +if [ -z "${PKG_CONFIG_DEPS}" ]; then
36 + pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt
37 + pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt
38 + pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen
39 + pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio
40 + pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode
41 + pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen
43 + pkg_exists "${PKG_CONFIG_DEPS}" \
44 + || (echo "ERROR: ${PKG_CONFIG_DEPS} is not installed" 1>&2; exit 1) \
47 if [ -z "${PKG_CONFIG_DEPS}" ]; then
48 echo "ERROR: No supported Solo5 bindings package found." 1>&2
49 echo "ERROR: solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode or solo5-bindings-xen must be installed." 1>&2