packages: transitive depot package dependencies

The buildDepot function now takes a "depotInputs" argument that
propagates "portInputs" and "depotInputs" across packages.

Drop the stdcxx package that includes a dev output and just use
the simple depot package for now.
This commit is contained in:
Ehmry - 2021-02-02 21:41:23 +01:00
parent e9d784ac52
commit cc211e763a
6 changed files with 80 additions and 57 deletions

View File

@ -199,8 +199,8 @@ in {
jitter_sponge = "${pkgs.genodePackages.jitter_sponge}/bin/jitter_sponge";
report_rom = "${pkgs.genodePackages.report_rom}/bin/report_rom";
rtc_drv = "${pkgs.genodePackages.rtc_drv}/bin/rtc_drv";
vfs = "${pkgs.genodePackages.vfs}/bin/vfs";
"vfs.lib.so" = "${pkgs.genodePackages.vfs.lib}/lib/vfs.lib.so";
vfs = "${pkgs.genodePackages.vfs.unpatched}/bin/vfs";
"vfs.lib.so" = "${pkgs.genodePackages.vfs.unpatched}/lib/vfs.lib.so";
};
genode.core.children =

View File

@ -84,6 +84,11 @@ with lib;
ipxe = ipxe_nic_drv;
virtio = virtio_nic_drv;
}.${interface.genode.driver};
binaryPath = with pkgs.genodePackages;
{
ipxe = "${ipxe_nic_drv}/bin/ipxe_nic_drv";
virtio = "${virtio_nic_drv}/bin/virtio_nic_drv";
}.${interface.genode.driver};
in {
inputs = [ binary ];
configFile = let
@ -103,8 +108,7 @@ with lib;
in Init.Child.flat
Init.Child.Attributes::{
, binary = "${binary}/bin/${binary.pname}"
, provides = [ "Nic" ]
, binary = "${binaryPath}"
, resources = Init.Resources::{ caps = 128, ram = Genode.units.MiB 4 }
, routes = [ Init.ServiceRoute.parent "IO_MEM" ]
, config = Init.Config::{
@ -127,6 +131,11 @@ with lib;
lwip = vfs_lwip;
lxip = vfs_lxip;
}.${interface.genode.stack};
vfsPluginPath = with pkgs.genodePackages;
{
lwip = "${vfs_lwip}/lib/vfs_lwip.lib.so";
lxip = "${vfs_lxip}/lib/vfs_lxip.lib.so";
}.${interface.genode.stack};
in {
name = name';
value = if interface.genode.stack == null then
@ -147,7 +156,7 @@ with lib;
}
{
name = "load";
value = "${vfsPlugin}/lib/${vfsPlugin.pname}.lib.so";
value = vfsPlugin;
}
] ++ lib.optionals (interface.ipv4.addresses != [ ])
(let addr = head interface.ipv4.addresses;

View File

@ -49,8 +49,6 @@ in upstream // {
portInputs = with genodeSources.ports; [ libc libssh openssl zlib ];
};
stdcxx = callPackage ./stdcxx { };
worldSources = buildPackages.fetchFromGitHub {
owner = "genodelabs";
repo = "genode-world";

View File

@ -190,10 +190,20 @@ let
buildDepot =
# Build a Depot target from the Genode sources
{ name, apiOnly ? false, portInputs ? [ ], nativeBuildInputs ? [ ]
, buildInputs ? [ ], meta ? { }, ... }@extraAttrs:
{ name, apiOnly ? false, portInputs ? [ ], depotInputs ? [ ]
, nativeBuildInputs ? [ ], buildInputs ? [ ], meta ? { }, ... }@extraAttrs:
stdenv'.mkDerivation (extraAttrs // {
let
getDepotInputs = lib.concatMap (x:
[ x ] ++ x.passthru.depotInputs
++ (getDepotInputs x.passthru.depotInputs));
depotInputs' = lib.lists.unique (getDepotInputs depotInputs);
portInputs' = portInputs
++ lib.concatMap (builtins.getAttr "portInputs") depotInputs';
in stdenv'.mkDerivation (extraAttrs // {
pname = name;
inherit (genodeSources) version;
enableParallelBuilding = true;
@ -208,7 +218,7 @@ let
configurePhase = let
copyPorts = # wasteful copy
toString
(builtins.map (drv: " cp -r ${drv}/* $CONTRIB_DIR/;") portInputs);
(builtins.map (drv: " cp -r ${drv}/* $CONTRIB_DIR/;") portInputs');
in ''
runHook preConfigure
export GENODE_DIR=$(pwd)
@ -237,6 +247,7 @@ let
runHook preInstall
rm -r depot/genodelabs/bin/${arch}/${name}/*\.build
local outputBinDir="''${!outputBin}/bin"
local outputLibDir="''${!outputLib}/lib"
find depot/genodelabs/bin/${arch}/${name} -name '*.lib.so' \
-exec install -Dt "$outputLibDir" {} \; -delete
@ -252,11 +263,12 @@ let
fi
find depot/genodelabs/bin/${arch}/${name} -executable \
-exec install -Dt "''${!outputBin}/bin" {} \;
-exec install -Dt "$outputBinDir" {} \;
runHook postInstall
'';
passthru = { inherit depotInputs portInputs; };
meta = { platforms = lib.platforms.genode; } // meta;
});

View File

@ -15,13 +15,14 @@ let
vbox5' = {
nativeBuildInputs = with buildPackages; [ iasl yasm ];
portInputs = with ports; [ libc libiconv qemu-usb stdcxx virtualbox5 ];
depotInputs = with self; [ posix libiconv stdcxx zlib ];
portInputs = with ports; [ qemu-usb virtualbox5 ];
};
in {
acpi_drv = { };
acpica = { };
ahci_drv = { };
backdrop.portInputs = with ports; [ libc libpng zlib ];
backdrop = { depotInputs = with self; [ posix libpng ]; };
bash-minimal = {
enableParallelBuilding = false;
nativeBuildInputs = with buildPackages; [ autoconf ];
@ -41,14 +42,18 @@ in {
clipboard = { };
coreutils-minimal = {
enableParallelBuilding = false;
portInputs = with ports; [ coreutils libc ];
depotInputs = with self; [ libc ];
portInputs = with ports; [ coreutils ];
postInstall = ''
find depot/genodelabs/bin/ -name '*.tar' -exec tar xf {} -C $out \;
'';
};
cpu_burner = { };
cpu_load_display = { };
curl.portInputs = with ports; [ curl libc libssh openssl zlib ];
curl = {
depotInputs = with self; [ libcrypto libssh libssl zlib ];
portInputs = with ports; [ curl ];
};
decorator = { };
demo = { };
depot_deploy = { };
@ -109,19 +114,34 @@ in {
lan9118_nic_drv = { };
libarchive = { };
libc = {
buildInputs = [ self.vfs ];
depotInputs = with self; [ vfs ];
portInputs = with ports; [ libc ];
patches = [ ./patches/libc.patch ];
};
libcrypto.portInputs = with ports; [ libc openssl ];
libiconv.portInputs = with ports; [ libc libiconv ];
libcrypto = {
depotInputs = with self; [ libc ];
portInputs = with ports; [ openssl ];
};
libiconv = {
depotInputs = with self; [ libc ];
portInputs = with ports; [ libiconv ];
};
liblzma = { };
libpng = { };
libpng = {
depotInputs = with self; [ zlib ];
portInputs = with ports; [ libpng ];
};
libqgenodeviewwidget = { };
libqpluginwidget = { };
libsparkcrypto = { };
libssh.portInputs = with ports; [ libc libssh openssl zlib ];
libssl.portInputs = with ports; [ libc openssl ];
libssh = {
depotInputs = with self; [ libcrypto zlib ];
portInputs = with ports; [ libssh ];
};
libssl = {
depotInputs = with self; [ libcrypto ];
portInputs = with ports; [ openssl ];
};
lighttpd = { };
linux_nic_drv.HOST_INC_DIR = [ hostLibcInc ];
linux_rtc_drv = { };
@ -138,7 +158,10 @@ in {
mpfr = { };
mupdf = { };
nano3d = { };
ncurses.portInputs = with ports; [ libc ncurses ];
ncurses = {
depotInputs = with self; [ libc ];
portInputs = with ports; [ ncurses ];
};
nic_bridge = { };
nic_loopback = { };
nic_router = { };
@ -153,8 +176,7 @@ in {
pdf_view = { };
platform_drv.patches = [ ./patches/platform_drv.patch ];
posix = {
buildInputs = [ self.libc ];
portInputs = with ports; [ ports.libc ];
depotInputs = with self; [ libc ];
patches = [ ./patches/libc.patch ];
};
ps2_drv = { };
@ -192,8 +214,11 @@ in {
seoul.portInputs = with ports; [ libc seoul ];
sequence = { };
spark = { };
ssh_terminal.portInputs = with ports; [ libc libssh ];
stdcxx.portInputs = with ports; [ libc stdcxx ];
ssh_terminal = { depotInputs = with self; [ libssh ]; };
stdcxx = {
depotInputs = with self; [ libc ];
portInputs = with ports; [ stdcxx ];
};
stdin2out = { };
system_rtc = { };
tar = { };
@ -281,10 +306,7 @@ in {
vbox5-nova = vbox5';
verify = { };
vesa_drv.portInputs = with ports; [ libc x86emu ];
vfs = {
outputs = [ "out" "lib" ];
patches = [ ./patches/vfs.patch ];
};
vfs.patches = [ ./patches/vfs.patch ];
vfs_audit = { };
vfs_block = { };
vfs_fatfs = { };
@ -307,9 +329,15 @@ in {
postInstall = "mv $out/bin/virtio_*_nic $out/bin/$pname";
};
which = { };
wifi_drv.portInputs = with ports; [ dde_linux libc openssl ];
wifi_drv = {
depotInputs = with self; [ libcrypto ];
portInputs = with ports; [ dde_linux ];
};
window_layouter = { };
wm = { };
zlib = { };
zlib = {
depotInputs = with self; [ libc ];
portInputs = with ports; [ zlib ];
};
zynq_nic_drv = { };
}

View File

@ -1,24 +0,0 @@
{ genodePackages }:
let
inherit (genodePackages) genodeSources;
port = genodeSources.ports.stdcxx;
in genodeSources.buildUpstream {
name = "stdcxx";
outputs = [ "out" "dev" ];
targets = [ "LIB=stdcxx" ];
portInputs = [ genodeSources.ports.libc port ];
propagatedBuildInputs = [ genodeSources.genodeBase ];
STDCXX_PORT = port;
postInstall = ''
mkdir -p $dev/include
pushd $STDCXX_PORT/*
cp -r --no-preserve=mode \
include/stdcxx/* \
$GENODE_DIR/repos/libports/include/stdcxx/* \
$dev/include/
popd
'';
}