diff --git a/nixos-modules/genode-core.nix b/nixos-modules/genode-core.nix index 6dedac6..87d1702 100644 --- a/nixos-modules/genode-core.nix +++ b/nixos-modules/genode-core.nix @@ -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 = diff --git a/nixos-modules/hardware/nic.nix b/nixos-modules/hardware/nic.nix index 754b4b2..335a468 100644 --- a/nixos-modules/hardware/nic.nix +++ b/nixos-modules/hardware/nic.nix @@ -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; diff --git a/packages/default.nix b/packages/default.nix index 14d9e09..4f9db57 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -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"; diff --git a/packages/genodelabs/default.nix b/packages/genodelabs/default.nix index 485db0d..b04a7d3 100644 --- a/packages/genodelabs/default.nix +++ b/packages/genodelabs/default.nix @@ -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; }); diff --git a/packages/genodelabs/depot-targets.nix b/packages/genodelabs/depot-targets.nix index 276a382..b2c59ea 100644 --- a/packages/genodelabs/depot-targets.nix +++ b/packages/genodelabs/depot-targets.nix @@ -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 = { }; } diff --git a/packages/stdcxx/default.nix b/packages/stdcxx/default.nix deleted file mode 100644 index e94ab7e..0000000 --- a/packages/stdcxx/default.nix +++ /dev/null @@ -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 - ''; -}