From d97c564c9f9b332079c8684533702f230666b4da Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Thu, 18 Mar 2021 00:13:43 +0100 Subject: [PATCH] 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. --- pkgs/os-specific/solo5/default.nix | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/solo5/default.nix b/pkgs/os-specific/solo5/default.nix index baba0ecdf0a..4b5c1232a86 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 '';