depot/third_party/nixpkgs/pkgs/development/misc/newlib/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

36 lines
904 B
Nix

{ stdenv, fetchurl, buildPackages }:
let version = "3.3.0";
in stdenv.mkDerivation {
pname = "newlib";
inherit version;
src = fetchurl {
url = "ftp://sourceware.org/pub/newlib/newlib-${version}.tar.gz";
sha256 = "0ricyx792ig2cb2x31b653yb7w7f7mf2111dv5h96lfzmqz9xpaq";
};
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";
};
}