From 3a0ff0b50d572f366fe72fe9f3cc339447a38062 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Sun, 28 Aug 2005 14:23:30 +0000 Subject: [PATCH] add dietlibc'ed coreutils for the NixOS installer... svn path=/nixpkgs/trunk/; revision=3736 --- pkgs/system/all-packages-generic.nix | 4 ++++ .../misc/coreutils-diet/coreutils-dummy.patch | 24 +++++++++++++++++++ pkgs/tools/misc/coreutils-diet/default.nix | 14 +++++++++++ 3 files changed, 42 insertions(+) create mode 100644 pkgs/tools/misc/coreutils-diet/coreutils-dummy.patch create mode 100644 pkgs/tools/misc/coreutils-diet/default.nix diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 1cab12cdd2d..4cd49c2fcec 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -39,6 +39,10 @@ rec { inherit fetchurl stdenv; }; + coreutilsDiet = (import ../tools/misc/coreutils-diet) { + inherit fetchurl stdenv dietgcc perl; + }; + findutils = (import ../tools/misc/findutils) { inherit fetchurl stdenv coreutils; }; diff --git a/pkgs/tools/misc/coreutils-diet/coreutils-dummy.patch b/pkgs/tools/misc/coreutils-diet/coreutils-dummy.patch new file mode 100644 index 00000000000..bb444bedf0e --- /dev/null +++ b/pkgs/tools/misc/coreutils-diet/coreutils-dummy.patch @@ -0,0 +1,24 @@ +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; diff --git a/pkgs/tools/misc/coreutils-diet/default.nix b/pkgs/tools/misc/coreutils-diet/default.nix new file mode 100644 index 00000000000..3f7d962a0e8 --- /dev/null +++ b/pkgs/tools/misc/coreutils-diet/default.nix @@ -0,0 +1,14 @@ +{stdenv, fetchurl, dietgcc, perl}: + +stdenv.mkDerivation { + name = "coreutils-5.2.1"; + src = fetchurl { + url = http://nix.cs.uu.nl/dist/tarballs/coreutils-5.2.1.tar.bz2; + md5 = "172ee3c315af93d3385ddfbeb843c53f"; + }; + patches = [./coreutils-dummy.patch]; + buildInputs = [perl]; + NIX_GCC = dietgcc; + NIX_GLIBC_FLAGS_SET=1; + NIX_CFLAGS_COMPILE="-D_BSD_SOURCE=1"; +}