* 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

@ -1,24 +0,0 @@
diff -ruN coreutils-5.2.1/src/paste.c coreutils-5.2.1.new/src/paste.c
--- coreutils-5.2.1/src/paste.c 2004-01-23 09:57:02.000000000 +0100
+++ coreutils-5.2.1.new/src/paste.c 2005-08-28 16:03:10.000000000 +0200
@@ -52,13 +52,16 @@
/* Indicates that no delimiter should be added in the current position. */
#define EMPTY_DELIM '\0'
-static FILE dummy_closed;
+/* static FILE dummy_closed; */
/* Element marking a file that has reached EOF and been closed. */
-#define CLOSED (&dummy_closed)
+/* #define CLOSED (&dummy_closed) */
-static FILE dummy_endlist;
+/* static FILE dummy_endlist; */
/* Element marking end of list of open files. */
-#define ENDLIST (&dummy_endlist)
+/* #define ENDLIST (&dummy_endlist) */
+
+#define CLOSED ((FILE *)-1)
+#define ENDLIST ((FILE *)-2)
/* Name this program was run with. */
char *program_name;

@ -1,15 +0,0 @@
{stdenv, fetchurl, dietgcc, perl}:
stdenv.mkDerivation {
name = "coreutils-diet-5.2.1";
src = fetchurl {
url = http://nix.cs.uu.nl/dist/tarballs/coreutils-5.2.1.tar.bz2;
md5 = "172ee3c315af93d3385ddfbeb843c53f";
};
# patch from
# http://invaders.mars-attacks.org/~boklm/browse/doc/srs2005/alink/files/patch-coreutils-5.2.1-alink0.1.diff
patches = [./coreutils-dummy.patch];
buildInputs = [perl];
NIX_GCC = dietgcc;
NIX_CFLAGS_COMPILE="-D_BSD_SOURCE=1";
}

@ -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 {}))

@ -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)

@ -82,7 +82,9 @@ rec {
# These are added *after* the command-line flags, so we'll
# always optimise for size.
NIX_CFLAGS_COMPILE = "-Os -s";
NIX_CFLAGS_COMPILE =
(if args ? NIX_CFLAGS_COMPILE then args.NIX_CFLAGS_COMPILE else "")
+ " -Os -s";
configureFlags =
(if args ? configureFlags then args.configureFlags else "")
@ -96,6 +98,7 @@ rec {
nativeGlibc = false;
};
});
isDietLibC = true;
};
# Applying this to an attribute set will cause nix-env to look
@ -217,8 +220,9 @@ rec {
inherit fetchurl stdenv;
});
coreutilsDiet = import ../tools/misc/coreutils-diet {
inherit fetchurl stdenv dietgcc perl;
coreutilsDiet = import ../tools/misc/coreutils {
inherit fetchurl;
stdenv = useDietLibC stdenv;
};
cpio = import ../tools/archivers/cpio {