summary refs log tree commit diff
path: root/pkgs/development/misc
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-10-19 11:43:33 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-10-29 14:34:10 -0500
commit8db71d9d773956d41778b88d88ead126a0138e67 (patch)
tree1f474caa00b8622f97c025301163cea07ea08e86 /pkgs/development/misc
parent2650a1f91ed08049cc6a70051ef238d0fb3dc9e5 (diff)
downloadnixpkgs-8db71d9d773956d41778b88d88ead126a0138e67.tar
nixpkgs-8db71d9d773956d41778b88d88ead126a0138e67.tar.gz
nixpkgs-8db71d9d773956d41778b88d88ead126a0138e67.tar.bz2
nixpkgs-8db71d9d773956d41778b88d88ead126a0138e67.tar.lz
nixpkgs-8db71d9d773956d41778b88d88ead126a0138e67.tar.xz
nixpkgs-8db71d9d773956d41778b88d88ead126a0138e67.tar.zst
nixpkgs-8db71d9d773956d41778b88d88ead126a0138e67.zip
newlib: init at 3.0.0
Fixes #47533

newlib seems to think it’s a compiler when it’s not. Anyway had to
make host refer to build platform for things to work.
Diffstat (limited to 'pkgs/development/misc')
-rw-r--r--pkgs/development/misc/newlib/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/misc/newlib/default.nix b/pkgs/development/misc/newlib/default.nix
new file mode 100644
index 00000000000..e26f0f78f21
--- /dev/null
+++ b/pkgs/development/misc/newlib/default.nix
@@ -0,0 +1,34 @@
+{ 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"
+  ];
+
+  dontDisableStatic = true;
+
+  passthru = {
+    incdir = "/${stdenv.hostPlatform.config}/include";
+    libdir = "/${stdenv.hostPlatform.config}/lib";
+  };
+}