msp430: include vendor headers with stdenv

This commit is contained in:
Aaron Lindsay 2019-03-25 20:33:39 -07:00
parent 02a1d3b24a
commit 1c7bb464d9
3 changed files with 26 additions and 0 deletions

View File

@ -34,6 +34,7 @@ rec {
else if final.isUClibc then "uclibc"
else if final.isAndroid then "bionic"
else if final.isLinux /* default */ then "glibc"
else if final.isMsp430 then "newlib"
else if final.isAvr then "avrlibc"
# TODO(@Ericson2314) think more about other operating systems
else "native/impure";

View File

@ -0,0 +1,18 @@
{ runCommand, lndir, newlib, msp430GccSupport }:
runCommand "msp430-${newlib.name}" {
inherit newlib;
inherit msp430GccSupport;
preferLocalBuild = true;
allowSubstitutes = false;
passthru = {
inherit (newlib) incdir libdir;
};
} ''
mkdir $out
${lndir}/bin/lndir -silent $newlib $out
${lndir}/bin/lndir -silent $msp430GccSupport/include $out/${newlib.incdir}
${lndir}/bin/lndir -silent $msp430GccSupport/lib $out/${newlib.libdir}
''

View File

@ -8374,6 +8374,12 @@ in
msp430GccSupport = callPackage ../development/misc/msp430/gcc-support.nix { };
msp430Newlib = callPackage ../development/misc/msp430/newlib.nix { };
msp430NewlibCross = callPackage ../development/misc/msp430/newlib.nix {
inherit (pkgs.buildPackages.xorg) lndir;
newlib = pkgs.newlibCross;
};
pharo-vms = callPackage ../development/pharo/vm { };
pharo = pharo-vms.multi-vm-wrapper;
pharo-cog32 = pharo-vms.cog32;
@ -10146,6 +10152,7 @@ in
else if name == "bionic" then targetPackages.bionic or bionic
else if name == "uclibc" then targetPackages.uclibcCross or uclibcCross
else if name == "avrlibc" then targetPackages.avrlibcCross or avrlibcCross
else if name == "newlib" && stdenv.targetPlatform.isMsp430 then targetPackages.msp430NewlibCross or msp430NewlibCross
else if name == "newlib" then targetPackages.newlibCross or newlibCross
else if name == "musl" then targetPackages.muslCross or muslCross
else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64