{ nixpkgs, toolchain }: with builtins; nixpkgs.stdenvNoCC.mkDerivation { name = "genode"; outputs = [ "out" "dev" ]; version = "19.07"; HOST_LIBC = toolchain.libc.dev; src = nixpkgs.fetchgit { url = "https://git.sr.ht/~ehmry/genode"; rev = "edb117c13b0cde38ba66ffaaa19a798fbb6d044d"; sha256 = "0rkpsh07hdv4r5pgyw707zhv546h96c6h150cdw01hi54jq8c0dr"; fetchSubmodules = false; }; setupHook = ./../tool/setup-hooks.sh; depsBuildBuild = with nixpkgs.buildPackages; [ toolchain stdenv.glibc.dev git tup pkgconfig ]; configurePhase = '' # Populate the SDK headers mkdir -p $out $dev/include cp -r repos/base/src/ld $dev/ld cp -r repos/base/include $dev/include/base cp -r repos/os/include $dev/include/os cp -r repos/libports/include $dev/include/libports cp -r repos/gems/include $dev/include/gems # Configure Tup echo CONFIG_NIX= >> tup.config echo CONFIG_NIX_OUTPUTS_OUT=$out >> tup.config echo CONFIG_NIX_OUTPUTS_DEV=$dev >> tup.config # Scan repository and generate script rm Tupfile # skip the dhall stuff tup init tup generate buildPhase.sh # Redirect artifacts to Nix store ln -s $out out ln -s $dev dev ''; buildPhase = '' source buildPhase.sh ''; installPhase = '' touch $dev/.genode for pc in $dev/lib/pkgconfig/*.pc do sed -i "s|-l:|$dev/lib/|g" $pc done ''; shellHook = '' export PROMPT_DIRTRIM=2 export PS1="\[\033[1;30m\]Genode-dev [\[\033[1;37m\]\w\[\033[1;30m\]] $\[\033[0m\] " export PS2="\[\033[1;30m\]>\[\033[0m\] " ''; }