nim: patch in support for running native

This commit is contained in:
Emery Hemingway 2022-10-12 17:47:09 -05:00
parent 6158b58569
commit 1faf3aff1b
4 changed files with 2270 additions and 5 deletions

View File

@ -119,6 +119,11 @@ the port definition using a `nativeBuildInputs` attribute.
Note that the hash checked into `ports.nix` is an *output hash*. The port hash
within the Genode source tree is an *explicit input hash*.
### Building a package from a test
```sh
nix build -L .#checks.x86_64-linux.«TEST_NAME».nodes.machine.config.genode.init.children.«CHILD_NAME».package
```
## Legal

View File

@ -165,6 +165,17 @@ in nullPkgs // {
# Stay clear of upstream on this one.
addPatchesHost [ ./ncurses/genode.patch ] prev.ncurses;
nim-unwrapped =
# programs are still linking to posix library
overrideAttrsTarget ({ patches, ... }: {
version = "1.6.8";
src = fetchurl {
url = "https://nim-lang.org/download/nim-1.6.8.tar.xz";
hash = "sha256-D1tlzbYPeK9BywdcI4mDaJoeH34lyBnxeYYsGKSEz1c=";
};
patches = patches ++ [ ./nim.patch ];
}) prev.nim-unwrapped;
nimPackages =
# Packages from the Nimble flake with adjustments.
prev.nimPackages.overrideScope' (_: prev': {

2253
overlay/nim.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,6 @@
nimPackages.buildNimPackage {
pname = "test_nim";
inherit (nim) version;
nimDefines = [ "posix" ];
unpackPhase = ''
mkdir test
cd test
@ -19,7 +18,6 @@
};
in {
package = testNim;
extraInputs = with pkgs.genodePackages; [ libc stdcxx ];
configFile = builtins.toFile "nim.dhall" ''
let Sigil = env:DHALL_SIGIL
@ -27,18 +25,16 @@
let Child = Init.Child
let Libc = Sigil.Libc
in λ(binary : Text)
Child.flat
Child.Attributes::{
, binary
, config = Init.Config::{ attributes = toMap { ld_verbose = "true" } }
, exitPropagate = True
, resources = Sigil.Init.Resources::{
, caps = 500
, ram = Sigil.units.MiB 10
}
, config = Libc.toConfig Libc.default
}
'';
};