lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at release-16.03-start 109 lines 3.0 kB view raw
1{stdenv, fetchzip, linuxHeaders, libiconvReal, cross ? null, gccCross ? null, 2extraConfig ? ""}: 3 4assert stdenv.isLinux; 5assert cross != null -> gccCross != null; 6 7let 8 configParser = '' 9 function parseconfig { 10 set -x 11 while read LINE; do 12 NAME=`echo "$LINE" | cut -d \ -f 1` 13 OPTION=`echo "$LINE" | cut -d \ -f 2` 14 15 if test -z "$NAME"; then 16 continue 17 fi 18 19 echo "parseconfig: removing $NAME" 20 sed -i /^$NAME=/d .config 21 22 #if test "$OPTION" != n; then 23 echo "parseconfig: setting $NAME=$OPTION" 24 echo "$NAME=$OPTION" >> .config 25 #fi 26 done 27 set +x 28 } 29 ''; 30 31 archMakeFlag = if cross != null then "ARCH=${cross.arch}" else ""; 32 crossMakeFlag = if cross != null then "CROSS=${cross.config}-" else ""; 33 34 # UCLIBC_SUSV4_LEGACY defines 'tmpnam', needed for gcc libstdc++ builds. 35 nixConfig = '' 36 RUNTIME_PREFIX "/" 37 DEVEL_PREFIX "/" 38 UCLIBC_HAS_WCHAR y 39 UCLIBC_HAS_FTW y 40 UCLIBC_HAS_RPC y 41 DO_C99_MATH y 42 UCLIBC_HAS_PROGRAM_INVOCATION_NAME y 43 UCLIBC_SUSV4_LEGACY y 44 UCLIBC_HAS_THREADS_NATIVE y 45 KERNEL_HEADERS "${linuxHeaders}/include" 46 '' + stdenv.lib.optionalString (stdenv.isArm && cross == null) '' 47 CONFIG_ARM_EABI y 48 ARCH_WANTS_BIG_ENDIAN n 49 ARCH_BIG_ENDIAN n 50 ARCH_WANTS_LITTLE_ENDIAN y 51 ARCH_LITTLE_ENDIAN y 52 UCLIBC_HAS_FPU n 53 ''; 54 55 name = "uclibc-0.9.34-pre-20150131"; 56 rev = "343f6b8f1f754e397632b0552e4afe586c8b392b"; 57 58in 59 60stdenv.mkDerivation { 61 name = name + stdenv.lib.optionalString (cross != null) ("-" + cross.config); 62 63 src = fetchzip { 64 name = name + "-source"; 65 url = "http://git.uclibc.org/uClibc/snapshot/uClibc-${rev}.tar.bz2"; 66 sha256 = "1kgylzpid7da5i7wz7slh5q9rnq1m8bv5h9ilm76g0xwc2iwlhbw"; 67 }; 68 69 # 'ftw' needed to build acl, a coreutils dependency 70 configurePhase = '' 71 make defconfig ${archMakeFlag} 72 ${configParser} 73 cat << EOF | parseconfig 74 ${nixConfig} 75 ${extraConfig} 76 ${if cross != null then stdenv.lib.attrByPath [ "uclibc" "extraConfig" ] "" cross else ""} 77 $extraCrossConfig 78 EOF 79 make oldconfig 80 ''; 81 82 # Cross stripping hurts. 83 dontStrip = cross != null; 84 85 makeFlags = [ crossMakeFlag "VERBOSE=1" ]; 86 87 buildInputs = stdenv.lib.optional (gccCross != null) gccCross; 88 89 enableParallelBuilding = true; 90 91 installPhase = '' 92 mkdir -p $out 93 make PREFIX=$out VERBOSE=1 install ${crossMakeFlag} 94 (cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .) 95 # libpthread.so may not exist, so I do || true 96 sed -i s@/lib/@$out/lib/@g $out/lib/libc.so $out/lib/libpthread.so || true 97 ''; 98 99 passthru = { 100 # Derivations may check for the existance of this attribute, to know what to link to. 101 libiconv = libiconvReal; 102 }; 103 104 meta = { 105 homepage = http://www.uclibc.org/; 106 description = "A small implementation of the C library"; 107 license = stdenv.lib.licenses.lgpl2; 108 }; 109}