summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-10-12 15:09:59 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-10-29 14:34:09 -0500
commitd59a9ac7cf5e17f42aa1d971028f108864f2d252 (patch)
treeb6a8dd275ba5fdcb10b2d8c1cc0c5c004702ffe0 /lib
parent075e4883e0abea400aecb886e6244a6c2acf7bd8 (diff)
downloadnixlib-d59a9ac7cf5e17f42aa1d971028f108864f2d252.tar
nixlib-d59a9ac7cf5e17f42aa1d971028f108864f2d252.tar.gz
nixlib-d59a9ac7cf5e17f42aa1d971028f108864f2d252.tar.bz2
nixlib-d59a9ac7cf5e17f42aa1d971028f108864f2d252.tar.lz
nixlib-d59a9ac7cf5e17f42aa1d971028f108864f2d252.tar.xz
nixlib-d59a9ac7cf5e17f42aa1d971028f108864f2d252.tar.zst
nixlib-d59a9ac7cf5e17f42aa1d971028f108864f2d252.zip
avr: use new compilation infrastructure
Gets rid of:
  avrbinutils
  avrgcc

to replace with:
  pkgsCross.avr.buildPackages.binutils
  pkgsCross.avr.buildPackages.gcc
Diffstat (limited to 'lib')
-rw-r--r--lib/systems/examples.nix4
-rw-r--r--lib/systems/inspect.nix1
-rw-r--r--lib/systems/parse.nix5
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix
index 8ba03a63fd8d..e19143543902 100644
--- a/lib/systems/examples.nix
+++ b/lib/systems/examples.nix
@@ -99,6 +99,10 @@ rec {
   riscv64 = riscv "64";
   riscv32 = riscv "32";
 
+  arduino-uno = {
+    config = "avr";
+    platform = { name = "avr5"; };
+  };
 
   #
   # Darwin
diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix
index 65f560328af5..2fcf1afe4628 100644
--- a/lib/systems/inspect.nix
+++ b/lib/systems/inspect.nix
@@ -19,6 +19,7 @@ rec {
     isRiscV        = { cpu = { family = "riscv"; }; };
     isSparc        = { cpu = { family = "sparc"; }; };
     isWasm         = { cpu = { family = "wasm"; }; };
+    isAvr          = { cpu = { family = "avr"; }; };
 
     is32bit        = { cpu = { bits = 32; }; };
     is64bit        = { cpu = { bits = 64; }; };
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index bb26c93f3d7a..058d4bed9085 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -101,6 +101,8 @@ rec {
 
     wasm32   = { bits = 32; significantByte = littleEndian; family = "wasm"; };
     wasm64   = { bits = 64; significantByte = littleEndian; family = "wasm"; };
+
+    avr      = { bits = 8; family = "avr"; };
   };
 
   ################################################################################
@@ -255,6 +257,9 @@ rec {
     setType "system" components;
 
   mkSkeletonFromList = l: {
+    "1" = if elemAt l 0 == "avr"
+      then { cpu = elemAt l 0; kernel = "none"; abi = "unknown"; }
+      else throw "Target specification with 1 components is ambiguous";
     "2" = # We only do 2-part hacks for things Nix already supports
       if elemAt l 1 == "cygwin"
         then { cpu = elemAt l 0;                      kernel = "windows";  abi = "cygnus";   }