diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sources.nix | 16 | ||||
-rw-r--r-- | lib/systems/doubles.nix | 2 | ||||
-rw-r--r-- | lib/systems/examples.nix | 12 |
3 files changed, 23 insertions, 7 deletions
diff --git a/lib/sources.nix b/lib/sources.nix index 0ffadea8f1bc..c4680087b245 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -53,12 +53,16 @@ rec { # Filter sources by a list of regular expressions. # # E.g. `src = sourceByRegex ./my-subproject [".*\.py$" "^database.sql$"]` - sourceByRegex = src: regexes: cleanSourceWith { - filter = (path: type: - let relPath = lib.removePrefix (toString src + "/") (toString path); - in lib.any (re: builtins.match re relPath != null) regexes); - inherit src; - }; + sourceByRegex = src: regexes: + let + isFiltered = src ? _isLibCleanSourceWith; + origSrc = if isFiltered then src.origSrc else src; + in lib.cleanSourceWith { + filter = (path: type: + let relPath = lib.removePrefix (toString origSrc + "/") (toString path); + in lib.any (re: builtins.match re relPath != null) regexes); + inherit src; + }; # Get all files ending with the specified suffices from the given # directory or its descendants. E.g. `sourceFilesBySuffices ./dir diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index f096a0b17fc6..823f6a915d6e 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -26,7 +26,7 @@ let "riscv32-linux" "riscv64-linux" - "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" + "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" ]; allParsed = map parse.mkSystemFromString all; diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index d17af9fcc148..aa55438de082 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -97,6 +97,18 @@ rec { riscv64 = riscv "64"; riscv32 = riscv "32"; + riscv64-embedded = { + config = "riscv64-none-elf"; + libc = "newlib"; + platform = platforms.riscv-multiplatform "64"; + }; + + riscv32-embedded = { + config = "riscv32-none-elf"; + libc = "newlib"; + platform = platforms.riscv-multiplatform "32"; + }; + msp430 = { config = "msp430-elf"; libc = "newlib"; |