nim: patch in support for running native
This commit is contained in:
parent
6158b58569
commit
1faf3aff1b
|
@ -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
|
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*.
|
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
|
## Legal
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,17 @@ in nullPkgs // {
|
||||||
# Stay clear of upstream on this one.
|
# Stay clear of upstream on this one.
|
||||||
addPatchesHost [ ./ncurses/genode.patch ] prev.ncurses;
|
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 =
|
nimPackages =
|
||||||
# Packages from the Nimble flake with adjustments.
|
# Packages from the Nimble flake with adjustments.
|
||||||
prev.nimPackages.overrideScope' (_: prev': {
|
prev.nimPackages.overrideScope' (_: prev': {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,6 @@
|
||||||
nimPackages.buildNimPackage {
|
nimPackages.buildNimPackage {
|
||||||
pname = "test_nim";
|
pname = "test_nim";
|
||||||
inherit (nim) version;
|
inherit (nim) version;
|
||||||
nimDefines = [ "posix" ];
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
mkdir test
|
mkdir test
|
||||||
cd test
|
cd test
|
||||||
|
@ -19,7 +18,6 @@
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
package = testNim;
|
package = testNim;
|
||||||
extraInputs = with pkgs.genodePackages; [ libc stdcxx ];
|
|
||||||
configFile = builtins.toFile "nim.dhall" ''
|
configFile = builtins.toFile "nim.dhall" ''
|
||||||
let Sigil = env:DHALL_SIGIL
|
let Sigil = env:DHALL_SIGIL
|
||||||
|
|
||||||
|
@ -27,18 +25,16 @@
|
||||||
|
|
||||||
let Child = Init.Child
|
let Child = Init.Child
|
||||||
|
|
||||||
let Libc = Sigil.Libc
|
|
||||||
|
|
||||||
in λ(binary : Text) →
|
in λ(binary : Text) →
|
||||||
Child.flat
|
Child.flat
|
||||||
Child.Attributes::{
|
Child.Attributes::{
|
||||||
, binary
|
, binary
|
||||||
|
, config = Init.Config::{ attributes = toMap { ld_verbose = "true" } }
|
||||||
, exitPropagate = True
|
, exitPropagate = True
|
||||||
, resources = Sigil.Init.Resources::{
|
, resources = Sigil.Init.Resources::{
|
||||||
, caps = 500
|
, caps = 500
|
||||||
, ram = Sigil.units.MiB 10
|
, ram = Sigil.units.MiB 10
|
||||||
}
|
}
|
||||||
, config = Libc.toConfig Libc.default
|
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue