summaryrefslogtreecommitdiffstats
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-03-18 00:13:43 +0100
committerEmery Hemingway <ehmry@posteo.net>2021-03-26 11:06:31 +0100
commitd97c564c9f9b332079c8684533702f230666b4da (patch)
tree7607e6b16069c472efd1f25365251277b3fa62f9 /pkgs/os-specific
parentf61460e499d36bbcb10950e57d49b70680271989 (diff)
solo5: install opam bindings for all targets that are enabled
Reuse the configuration generated by configure.sh to dynamically install the bindings for all enabled targets. A bit of a hack grepping for the respective lines in the Makeconf which incidentally also parse as shell. Alternative would be to check for the target libs.
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/solo5/default.nix24
1 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/os-specific/solo5/default.nix b/pkgs/os-specific/solo5/default.nix
index baba0ecdf0ab..4b5c1232a864 100644
--- a/pkgs/os-specific/solo5/default.nix
+++ b/pkgs/os-specific/solo5/default.nix
@@ -1,6 +1,16 @@
{ lib, stdenv, fetchurl, pkg-config, libseccomp, util-linux, qemu }:
-let version = "0.6.8";
+let
+ version = "0.6.8";
+ # list of all theoretically available targets
+ targets = [
+ "genode"
+ "hvt"
+ "muen"
+ "spt"
+ "virtio"
+ "xen"
+ ];
in stdenv.mkDerivation {
pname = "solo5";
inherit version;
@@ -29,9 +39,15 @@ in stdenv.mkDerivation {
export DESTDIR=$out
export PREFIX=$out
make install-tools
- ${lib.optionalString stdenv.hostPlatform.isLinux "make ${
- (lib.concatMapStringsSep " " (x: "install-opam-${x}") [ "hvt" "spt" ])
- }"}
+
+ # get CONFIG_* vars from Makeconf which also parse in sh
+ grep '^CONFIG_' Makeconf > nix_tmp_targetconf
+ source nix_tmp_targetconf
+ # install opam / pkg-config files for all enabled targets
+ ${lib.concatMapStrings (bind: ''
+ [ -n "$CONFIG_${lib.toUpper bind}" ] && make install-opam-${bind}
+ '') targets}
+
runHook postInstall
'';