* Build coreutils on dietlibc.

svn path=/nixpkgs/trunk/; revision=6765
This commit is contained in:
Eelco Dolstra
2006-10-18 15:16:53 +00:00
parent 5947d98f05
commit 6ff020ad3a
5 changed files with 47 additions and 44 deletions

View File

@@ -1,9 +1,12 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
stdenv.mkDerivation ({
name = "coreutils-5.97";
src = fetchurl {
url = http://nix.cs.uu.nl/dist/tarballs/coreutils-5.97.tar.gz;
md5 = "bdec4b75c76ac9bf51b6dd1747d3b06e";
};
}
} // (if stdenv ? isDietLibC then {
NIX_CFLAGS_COMPILE="-D_BSD_SOURCE=1";
patches = [./uclibc.patch];
} else {}))

View File

@@ -0,0 +1,35 @@
diff -rc coreutils-5.97-orig/lib/strftime.c coreutils-5.97/lib/strftime.c
*** coreutils-5.97-orig/lib/strftime.c 2006-10-18 17:10:16.000000000 +0200
--- coreutils-5.97/lib/strftime.c 2006-10-18 17:08:16.000000000 +0200
***************
*** 180,185 ****
--- 180,191 ----
# define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len))
#endif
+ #if FPRINTFTIME
+ #define advance(p, n) ;
+ #else
+ #define advance(p, n) p += _n;
+ #endif
+
#define add(n, f) \
do \
{ \
***************
*** 198,204 ****
memset_space (p, _delta); \
} \
f; \
! p += FPRINTFTIME ? 0 : _n; \
} \
i += _incr; \
} while (0)
--- 204,210 ----
memset_space (p, _delta); \
} \
f; \
! advance(p, n); \
} \
i += _incr; \
} while (0)