@@ -0,0 +1,65 @@
1+{stdenv, fetchurl, arm-frc-linux-gnueabi-linux-api-headers}:
2+
3+let
4+ _target = "arm-frc-linux-gnueabi";
5+ _basever = "2.21-r0.83";
6+ srcs = [
7+ (fetchurl {
8+ url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6_${_basever}_cortexa9-vfpv3.ipk";
9+ sha256 = "117058215440e258027bb9ff18db63c078d55288787dbedfcd5730c06c7a1ae9";
10+ })
11+ (fetchurl {
12+ url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6-dev_${_basever}_cortexa9-vfpv3.ipk";
13+ sha256 = "e28b05d498c1160949f51539270035e12c5bb9d75d68df1f5f111a8fc087f3a6";
14+ })
15+ (fetchurl {
16+ url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libcidn1_${_basever}_cortexa9-vfpv3.ipk";
17+ sha256 = "0f7372590abf69da54a9b7db8f944cf6c48d9ac8a091218ee60f84fdd9de2398";
18+ })
19+ (fetchurl {
20+ url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6-thread-db_${_basever}_cortexa9-vfpv3.ipk";
21+ sha256 = "5a839498507a0b63165cb7a78234d7eb2ee2bb6a046bff586090f2e70e0e2bfb";
22+ })
23+ (fetchurl {
24+ url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6-extra-nss_${_basever}_cortexa9-vfpv3.ipk";
25+ sha256 = "d765d43c8ec95a4c64fa38eddf8cee848fd090d9cc5b9fcda6d2c9b03d2635c5";
26+ })
27+ ];
28+in
29+stdenv.mkDerivation rec {
30+ version = "2.21";
31+ name = "${_target}-eglibc-${version}";
32+
33+ sourceRoot = ".";
34+ inherit srcs;
35+
36+ phases = [ "unpackPhase" "installPhase" ];
37+
38+ unpackCmd = ''
39+ ar x $curSrc
40+ tar xf data.tar.gz
41+ '';
42+
43+ installPhase = ''
44+ mkdir -p $out/${_target}
45+ rm -rf lib/eglibc
46+ find . \( -name .install -o -name ..install.cmd \) -delete
47+ cp -r lib $out/${_target}
48+ cp -r usr $out/${_target}
49+
50+ cp -r ${arm-frc-linux-gnueabi-linux-api-headers}/* $out
51+ '';
52+
53+ meta = {
54+ description = "FRC standard C lib";
55+ longDescription = ''
56+ eglibc library for the NI RoboRio to be used in compiling frc user
57+ programs.
58+ '';
59+ license = stdenv.lib.licenses.gpl2;
60+ maintainers = [ stdenv.lib.maintainers.colescott ];
61+ platforms = stdenv.lib.platforms.linux;
62+
63+ priority = 2;
64+ };
65+}