summary refs log tree commit diff
path: root/pkgs/development/misc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/misc')
-rw-r--r--pkgs/development/misc/avr/binutils/default.nix22
-rw-r--r--pkgs/development/misc/avr/gcc/avrbinutils-path.patch15
-rw-r--r--pkgs/development/misc/avr/gcc/default.nix60
-rw-r--r--pkgs/development/misc/avr/libc/default.nix23
-rw-r--r--pkgs/development/misc/newlib/default.nix35
-rw-r--r--pkgs/development/misc/qmk_firmware/default.nix27
-rw-r--r--pkgs/development/misc/stm32/betaflight/default.nix10
-rw-r--r--pkgs/development/misc/stm32/inav/default.nix10
8 files changed, 82 insertions, 120 deletions
diff --git a/pkgs/development/misc/avr/binutils/default.nix b/pkgs/development/misc/avr/binutils/default.nix
deleted file mode 100644
index 83ba93e63b76..000000000000
--- a/pkgs/development/misc/avr/binutils/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ stdenv, fetchurl }:
-
-let
-  version = "2.31.1";
-in
-stdenv.mkDerivation {
-  name = "avr-binutils-${version}";
-
-  src = fetchurl {
-    url = "mirror://gnu/binutils/binutils-${version}.tar.bz2";
-    sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
-  };
-  configureFlags = [ "--target=avr" "--enable-languages=c,c++" ];
-
-  meta = with stdenv.lib; {
-    description = "the GNU Binutils for AVR microcontrollers";
-    homepage = http://www.gnu.org/software/binutils/;
-    license = licenses.gpl3Plus;
-    platforms = platforms.unix;
-    maintainers = with maintainers; [ mguentner ];
-  };
-}
diff --git a/pkgs/development/misc/avr/gcc/avrbinutils-path.patch b/pkgs/development/misc/avr/gcc/avrbinutils-path.patch
deleted file mode 100644
index f0ec21b7589f..000000000000
--- a/pkgs/development/misc/avr/gcc/avrbinutils-path.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
-index 838ebc2..3ac4ee7 100644
---- a/gcc/gcc-ar.c
-+++ b/gcc/gcc-ar.c
-@@ -118,8 +118,8 @@ setup_prefixes (const char *exec_path)
- 				dir_separator, NULL);
-   prefix_from_string (self_libexec_prefix, &target_path);
- 
--  /* Add path as a last resort.  */
--  prefix_from_env ("PATH", &path);
-+  /* Add path to avrbinutils.  */
-+  prefix_from_string ("@avrbinutils@/bin", &path);
- }
- 
- int 
diff --git a/pkgs/development/misc/avr/gcc/default.nix b/pkgs/development/misc/avr/gcc/default.nix
deleted file mode 100644
index 5c9b56c99183..000000000000
--- a/pkgs/development/misc/avr/gcc/default.nix
+++ /dev/null
@@ -1,60 +0,0 @@
-{ stdenv, fetchurl, gmp, mpfr, libmpc, zlib, avrbinutils, texinfo }:
-
-let
-  version = "8.2.0";
-in
-stdenv.mkDerivation {
-
-  name = "avr-gcc-${version}";
-  src = fetchurl {
-    url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
-    sha256 = "10007smilswiiv2ymazr3b6x2i933c0ycxrr529zh4r6p823qv0r";
-  };
-
-  patches = [
-    ./avrbinutils-path.patch
-  ];
-
-  # avrbinutils-path.patch introduces a reference to @avrbinutils@, substitute
-  # it now.
-  postPatch = ''
-    substituteInPlace gcc/gcc-ar.c --subst-var-by avrbinutils ${avrbinutils}
-  '';
-
-  buildInputs = [ gmp mpfr libmpc zlib avrbinutils ];
-
-  nativeBuildInputs = [ texinfo ];
-
-  hardeningDisable = [ "format" ];
-
-  stripDebugList= [ "bin" "libexec" ];
-
-  enableParallelBuilding = true;
-
-  configurePhase = ''
-    mkdir gcc-build
-    cd gcc-build
-    ../configure   \
-    --prefix=$out  \
-    --host=$CHOST  \
-    --build=$CHOST \
-    --target=avr   \
-    --with-as=${avrbinutils}/bin/avr-as \
-    --with-gnu-as  \
-    --with-gnu-ld  \
-    --with-ld=${avrbinutils}/bin/avr-ld \
-    --with-system-zlib \
-    --disable-install-libiberty \
-    --disable-nls \
-    --disable-libssp \
-    --with-dwarf2 \
-    --enable-languages=c,c++'';
-
-  meta = with stdenv.lib; {
-    description = "GNU Compiler Collection, version ${version} for AVR microcontrollers";
-    homepage = http://gcc.gnu.org;
-    license = licenses.gpl3Plus;
-    platforms = with platforms; linux ++ darwin;
-    maintainers = with maintainers; [ mguentner ];
-  };
-}
diff --git a/pkgs/development/misc/avr/libc/default.nix b/pkgs/development/misc/avr/libc/default.nix
index 039846d5fcfb..ab9a696afb00 100644
--- a/pkgs/development/misc/avr/libc/default.nix
+++ b/pkgs/development/misc/avr/libc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, avrgcc, avrbinutils, automake, autoconf }:
+{ stdenv, fetchurl, automake, autoconf }:
 
 let
   version = "2.0.0";
@@ -11,28 +11,21 @@ stdenv.mkDerivation {
     sha256 = "15svr2fx8j6prql2il2fc0ppwlv50rpmyckaxx38d3gxxv97zpdj";
   };
 
-  buildInputs = [ avrgcc avrbinutils automake autoconf ];
-  configurePhase = ''
-    unset LD
-    unset AS
-    unset AR
-    unset CC
-    unset CXX
-    unset RANLIB
-    unset STRIP
-
-    ./configure --prefix=$out --build=$(./config.guess) --host=avr
-  '';
+  nativeBuildInputs = [ automake autoconf ];
 
   # Make sure we don't strip the libraries in lib/gcc/avr.
-  stripDebugList= "bin";
+  stripDebugList = "bin";
   dontPatchELF = true;
 
+  passthru = {
+    incdir = "/avr/include";
+  };
+
   meta = with stdenv.lib; {
     description = "a C runtime library for AVR microcontrollers";
     homepage = http://savannah.nongnu.org/projects/avr-libc/;
     license = licenses.bsd3;
-    platforms = platforms.unix;
+    platforms = [ "avr-none" ];
     maintainers = with maintainers; [ mguentner ];
   };
 }
diff --git a/pkgs/development/misc/newlib/default.nix b/pkgs/development/misc/newlib/default.nix
new file mode 100644
index 000000000000..693cfa093b08
--- /dev/null
+++ b/pkgs/development/misc/newlib/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, buildPackages }:
+
+let version = "3.0.0";
+in stdenv.mkDerivation {
+  name = "newlib-${version}";
+  src = fetchurl {
+    url = "ftp://sourceware.org/pub/newlib/newlib-${version}.tar.gz";
+    sha256 = "0chka3szh50krcz2dcxcsr1v1i000jylwnsrp2pgrrblxqsn6mn8";
+  };
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  # newlib expects CC to build for build platform, not host platform
+  preConfigure = ''
+    export CC=cc
+  '';
+
+  configurePlatforms = [ "build" "target" ];
+  configureFlags = [
+    "--host=${stdenv.buildPlatform.config}"
+
+    "--disable-newlib-supplied-syscalls"
+    "--disable-nls"
+    "--enable-newlib-io-long-long"
+    "--enable-newlib-register-fini"
+    "--enable-newlib-retargetable-locking"
+  ];
+
+  dontDisableStatic = true;
+
+  passthru = {
+    incdir = "/${stdenv.targetPlatform.config}/include";
+    libdir = "/${stdenv.targetPlatform.config}/lib";
+  };
+}
diff --git a/pkgs/development/misc/qmk_firmware/default.nix b/pkgs/development/misc/qmk_firmware/default.nix
new file mode 100644
index 000000000000..0a7b4fd9d9a7
--- /dev/null
+++ b/pkgs/development/misc/qmk_firmware/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub
+, avrgcc, avrbinutils
+, gcc-arm-embedded, binutils-arm-embedded
+, teensy-loader-cli, dfu-programmer, dfu-util }:
+
+let version = "0.6.144";
+
+in stdenv.mkDerivation {
+  name = "qmk_firmware-${version}";
+  src = fetchFromGitHub {
+    owner = "qmk";
+    repo = "qmk_firmware";
+    rev = version;
+    sha256 = "0m71f9w32ksqjkrwhqwhr74q5v3pr38bihjyb9ks0k5id0inhrjn";
+    fetchSubmodules = true;
+  };
+  buildFlags = "all:default";
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+  nativeBuildInputs = [
+    avrgcc
+    avrbinutils
+    gcc-arm-embedded
+    teensy-loader-cli
+    dfu-programmer
+    dfu-util
+  ];
+}
diff --git a/pkgs/development/misc/stm32/betaflight/default.nix b/pkgs/development/misc/stm32/betaflight/default.nix
index 0c601c7773cc..fbe48803f2db 100644
--- a/pkgs/development/misc/stm32/betaflight/default.nix
+++ b/pkgs/development/misc/stm32/betaflight/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub
-, gcc-arm-embedded, python2
+, gcc-arm-embedded, binutils-arm-embedded, python2
 , skipTargets ? [
   # These targets do not build, for the reasons listed, along with the last version checked.
   # Probably all of the issues with these targets need to be addressed upstream.
@@ -24,14 +24,17 @@ in stdenv.mkDerivation rec {
     sha256 = "1wyp23p876xbfi9z6gm4xn1nwss3myvrjjjq9pd3s0vf5gkclkg5";
   };
 
-  buildInputs = [
-    gcc-arm-embedded
+  nativeBuildInputs = [
+    gcc-arm-embedded binutils-arm-embedded
     python2
   ];
 
   postPatch = ''
     sed -ri "s/REVISION.*=.*git log.*/REVISION = ${builtins.substring 0 10 src.rev}/" Makefile # Simulate abbrev'd rev.
     sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
+
+    substitutateInPlace Makefile \
+      --replace "--specs=nano.specs" ""
   '';
 
   enableParallelBuilding = true;
@@ -58,7 +61,6 @@ in stdenv.mkDerivation rec {
     homepage = https://github.com/betaflight/betaflight;
     license = licenses.gpl3;
     maintainers = with maintainers; [ elitak ];
-    platforms = [ "i686-linux" "x86_64-linux" ];
   };
 
 }
diff --git a/pkgs/development/misc/stm32/inav/default.nix b/pkgs/development/misc/stm32/inav/default.nix
index cb9cc80d3252..102b1eb8048d 100644
--- a/pkgs/development/misc/stm32/inav/default.nix
+++ b/pkgs/development/misc/stm32/inav/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub
-, gcc-arm-embedded, ruby
+, gcc-arm-embedded, binutils-arm-embedded, ruby
 }:
 
 let
@@ -17,8 +17,8 @@ in stdenv.mkDerivation rec {
     sha256 = "15zai8qf43b06fmws1sbkmdgip51zp7gkfj7pp9b6gi8giarzq3y";
   };
 
-  buildInputs = [
-    gcc-arm-embedded
+  nativeBuildInputs = [
+    gcc-arm-embedded binutils-arm-embedded
     ruby
   ];
 
@@ -26,6 +26,9 @@ in stdenv.mkDerivation rec {
     sed -ri "s/REVISION.*=.*shell git.*/REVISION = ${builtins.substring 0 10 src.rev}/" Makefile # Simulate abbrev'd rev.
     sed -ri "s/-j *[0-9]+//" Makefile # Eliminate parallel build args in submakes
     sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
+
+    substitutateInPlace Makefile \
+      --replace "--specs=nano.specs" ""
   '';
 
   enableParallelBuilding = true;
@@ -50,7 +53,6 @@ in stdenv.mkDerivation rec {
     homepage = https://inavflight.github.io;
     license = licenses.gpl3;
     maintainers = with maintainers; [ elitak ];
-    platforms = [ "i686-linux" "x86_64-linux" ];
   };
 
 }