···1-{ lib, stdenv, buildPackages
2-, fetchurl, linuxHeaders, libiconvReal
00003, extraConfig ? ""
4}:
56let
07 configParser = ''
8 function parseconfig {
9 set -x
···36 UCLIBC_HAS_RPC y
37 DO_C99_MATH y
38 UCLIBC_HAS_PROGRAM_INVOCATION_NAME y
039 UCLIBC_SUSV4_LEGACY y
40 UCLIBC_HAS_THREADS_NATIVE y
41 KERNEL_HEADERS "${linuxHeaders}/include"
42 '' + lib.optionalString (stdenv.hostPlatform.gcc.float or "" == "soft") ''
43 UCLIBC_HAS_FPU n
44- '' + lib.optionalString (stdenv.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) ''
45 CONFIG_ARM_EABI y
46 ARCH_WANTS_BIG_ENDIAN n
47 ARCH_BIG_ENDIAN n
···49 ARCH_LITTLE_ENDIAN y
50 UCLIBC_HAS_FPU n
51 '';
52-53- version = "1.0.38";
54in
55-56-stdenv.mkDerivation {
57 pname = "uclibc-ng";
58- inherit version;
5960 src = fetchurl {
61- url = "https://downloads.uclibc-ng.org/releases/${version}/uClibc-ng-${version}.tar.bz2";
62- # from "${url}.sha256";
63- sha256 = "sha256-7wexvOOfDpIsM3XcdhHxESz7GsOW+ZkiA0dfiN5rHrU=";
64 };
6566 # 'ftw' needed to build acl, a coreutils dependency
···78 hardeningDisable = [ "stackprotector" ];
7980 # Cross stripping hurts.
81- dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
8283 depsBuildBuild = [ buildPackages.stdenv.cc ];
84···86 "ARCH=${stdenv.hostPlatform.linuxArch}"
87 "TARGET_ARCH=${stdenv.hostPlatform.linuxArch}"
88 "VERBOSE=1"
89- ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
90 "CROSS=${stdenv.cc.targetPrefix}"
91 ];
92···95 enableParallelBuilding = false;
9697 installPhase = ''
0098 mkdir -p $out
99 make $makeFlags PREFIX=$out VERBOSE=1 install
100 (cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
101 # libpthread.so may not exist, so I do || true
102 sed -i s@/lib/@$out/lib/@g $out/lib/libc.so $out/lib/libpthread.so || true
00103 '';
104000000000000000000000000105 passthru = {
106- # Derivations may check for the existance of this attribute, to know what to link to.
0107 libiconv = libiconvReal;
108 };
109110- meta = with lib; {
111- homepage = "https://uclibc-ng.org";
112- description = "A small implementation of the C library";
113- maintainers = with maintainers; [ rasendubi ];
114- license = licenses.lgpl2;
115- platforms = platforms.linux;
116- broken = stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64;
117- };
118}
···1+{ lib
2+, stdenv
3+, buildPackages
4+, fetchurl
5+, linuxHeaders
6+, libiconvReal
7, extraConfig ? ""
8}:
910let
11+ isCross = (stdenv.buildPlatform != stdenv.hostPlatform);
12 configParser = ''
13 function parseconfig {
14 set -x
···41 UCLIBC_HAS_RPC y
42 DO_C99_MATH y
43 UCLIBC_HAS_PROGRAM_INVOCATION_NAME y
44+ UCLIBC_HAS_RESOLVER_SUPPORT y
45 UCLIBC_SUSV4_LEGACY y
46 UCLIBC_HAS_THREADS_NATIVE y
47 KERNEL_HEADERS "${linuxHeaders}/include"
48 '' + lib.optionalString (stdenv.hostPlatform.gcc.float or "" == "soft") ''
49 UCLIBC_HAS_FPU n
50+ '' + lib.optionalString (stdenv.isAarch32 && isCross) ''
51 CONFIG_ARM_EABI y
52 ARCH_WANTS_BIG_ENDIAN n
53 ARCH_BIG_ENDIAN n
···55 ARCH_LITTLE_ENDIAN y
56 UCLIBC_HAS_FPU n
57 '';
0058in
59+stdenv.mkDerivation rec {
060 pname = "uclibc-ng";
61+ version = "1.0.41";
6263 src = fetchurl {
64+ url = "https://downloads.uclibc-ng.org/releases/${version}/uClibc-ng-${version}.tar.xz";
65+ sha256 = "sha256-syqSoCGNlZItaXZGTm71Hi66z7zbYFggRY2du4ph4CU=";
066 };
6768 # 'ftw' needed to build acl, a coreutils dependency
···80 hardeningDisable = [ "stackprotector" ];
8182 # Cross stripping hurts.
83+ dontStrip = isCross;
8485 depsBuildBuild = [ buildPackages.stdenv.cc ];
86···88 "ARCH=${stdenv.hostPlatform.linuxArch}"
89 "TARGET_ARCH=${stdenv.hostPlatform.linuxArch}"
90 "VERBOSE=1"
91+ ] ++ lib.optionals (isCross) [
92 "CROSS=${stdenv.cc.targetPrefix}"
93 ];
94···97 enableParallelBuilding = false;
9899 installPhase = ''
100+ runHook preInstall
101+102 mkdir -p $out
103 make $makeFlags PREFIX=$out VERBOSE=1 install
104 (cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
105 # libpthread.so may not exist, so I do || true
106 sed -i s@/lib/@$out/lib/@g $out/lib/libc.so $out/lib/libpthread.so || true
107+108+ runHook postInstall
109 '';
110111+ meta = with lib; {
112+ homepage = "https://uclibc-ng.org";
113+ description = "Embedded C library";
114+ longDescription = ''
115+ uClibc-ng is a small C library for developing embedded Linux systems. It
116+ is much smaller than the GNU C Library, but nearly all applications
117+ supported by glibc also work perfectly with uClibc-ng.
118+119+ Porting applications from glibc to uClibc-ng typically involves just
120+ recompiling the source code. uClibc-ng supports shared libraries and
121+ threading. It currently runs on standard Linux and MMU-less (also known as
122+ uClinux) systems with support for Aarch64, Alpha, ARC, ARM, AVR32,
123+ Blackfin, CRIS, C-Sky, C6X, FR-V, H8/300, HPPA, i386, IA64, KVX, LM32,
124+ M68K/Coldfire, Metag, Microblaze, MIPS, MIPS64, NDS32, NIOS2, OpenRISC,
125+ PowerPC, RISCV64, Sparc, Sparc64, SuperH, Tile, X86_64 and XTENSA
126+ processors. Alpha, FR-V, HPPA, IA64, LM32, NIOS2, Tile and Sparc64 are
127+ experimental and need more testing.
128+ '';
129+ license = licenses.lgpl2Plus;
130+ maintainers = with maintainers; [ rasendubi AndersonTorres ];
131+ platforms = platforms.linux;
132+ badPlatforms = platforms.aarch64;
133+ };
134+135 passthru = {
136+ # Derivations may check for the existance of this attribute, to know what to
137+ # link to.
138 libiconv = libiconvReal;
139 };
14000000000141}
+10-6
pkgs/top-level/all-packages.nix
···1/* The top-level package collection of nixpkgs.
2- * It is sorted by categories corresponding to the folder names
3- * in the /pkgs folder. Inside the categories packages are roughly
4- * sorted by alphabet, but strict sorting has been long lost due
5- * to merges. Please use the full-text search of your editor. ;)
6 * Hint: ### starts category names.
7 */
8{ lib, noSysDirs, config, overlays }:
···24072 buildBarebox
24073 bareboxTools;
2407424075- uclibc = callPackage ../os-specific/linux/uclibc { };
2407624077- uclibcCross = callPackage ../os-specific/linux/uclibc {
24078 stdenv = crossLibcStdenv;
24079 };
00002408024081 eudev = callPackage ../os-specific/linux/eudev { util-linux = util-linuxMinimal; };
24082
···1/* The top-level package collection of nixpkgs.
2+ * It is sorted by categories corresponding to the folder names in the /pkgs
3+ * folder. Inside the categories packages are roughly sorted by alphabet, but
4+ * strict sorting has been long lost due to merges. Please use the full-text
5+ * search of your editor. ;)
6 * Hint: ### starts category names.
7 */
8{ lib, noSysDirs, config, overlays }:
···24072 buildBarebox
24073 bareboxTools;
2407424075+ uclibc-ng = callPackage ../os-specific/linux/uclibc-ng { };
2407624077+ uclibc-ng-cross = callPackage ../os-specific/linux/uclibc-ng {
24078 stdenv = crossLibcStdenv;
24079 };
24080+24081+ # Aliases
24082+ uclibc = uclibc-ng;
24083+ uclibcCross = uclibc-ng-cross;
2408424085 eudev = callPackage ../os-specific/linux/eudev { util-linux = util-linuxMinimal; };
24086