3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/misc/newlib/default.nix

37 lines
904 B
Nix
Raw Normal View History

{ stdenv, fetchurl, buildPackages }:
2020-03-06 23:03:33 +00:00
let version = "3.3.0";
in stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "newlib";
inherit version;
src = fetchurl {
url = "ftp://sourceware.org/pub/newlib/newlib-${version}.tar.gz";
2020-03-06 23:03:33 +00:00
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";
};
}