From a816f506a23d2fcaf710888f9cb4fca33ec47ca1 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Sat, 27 Aug 2005 20:48:05 +0000 Subject: [PATCH] add klibc svn path=/nixpkgs/trunk/; revision=3723 --- pkgs/os-specific/linux/klibc/builder.sh | 11 ++++++ pkgs/os-specific/linux/klibc/default.nix | 15 ++++++++ .../linux/klibc/klibc-installpath.patch | 34 +++++++++++++++++++ pkgs/system/all-packages-generic.nix | 14 ++++++-- 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 pkgs/os-specific/linux/klibc/builder.sh create mode 100644 pkgs/os-specific/linux/klibc/default.nix create mode 100644 pkgs/os-specific/linux/klibc/klibc-installpath.patch diff --git a/pkgs/os-specific/linux/klibc/builder.sh b/pkgs/os-specific/linux/klibc/builder.sh new file mode 100644 index 00000000000..a8daa6c09cf --- /dev/null +++ b/pkgs/os-specific/linux/klibc/builder.sh @@ -0,0 +1,11 @@ +. $stdenv/setup + +preBuild() { + kernelhash=$(ls $kernel/lib/modules) + echo $kernelhash + ln -s $kernel/lib/modules/$kernelhash/build linux +} + +preBuild=preBuild + +genericBuild diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix new file mode 100644 index 00000000000..97d5996f389 --- /dev/null +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -0,0 +1,15 @@ +{stdenv, fetchurl, kernel, perl, bison, flexWrapper}: + +assert stdenv.system == "i686-linux"; + +stdenv.mkDerivation { + name = "klibc-1.0"; + builder = ./builder.sh; + src = fetchurl { + url = ftp://ftp.kernel.org/pub/linux/libs/klibc/klibc-1.0.tar.bz2; + md5 = "daaa233fb7905cbe110896fcad9bec7f"; + }; + inherit kernel; + buildInputs = [perl bison flexWrapper]; + patches = [./klibc-installpath.patch]; +} diff --git a/pkgs/os-specific/linux/klibc/klibc-installpath.patch b/pkgs/os-specific/linux/klibc/klibc-installpath.patch new file mode 100644 index 00000000000..d85454d2827 --- /dev/null +++ b/pkgs/os-specific/linux/klibc/klibc-installpath.patch @@ -0,0 +1,34 @@ +diff -ruN klibc-1.0/Makefile klibc-1.0.new/Makefile +--- klibc-1.0/Makefile 2005-03-07 19:17:15.000000000 +0100 ++++ klibc-1.0.new/Makefile 2005-08-27 22:40:12.000000000 +0200 +@@ -61,7 +61,8 @@ + mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)include/$$d ; \ + for r in $(KRNLSRC)/include $(KRNLOBJ)/include $(KRNLOBJ)/include2 ; do \ + [ ! -d $$r/$$d ] || \ +- cp -rfL $$r/$$d/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/. ; \ ++ (chmod -R +w $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/.; \ ++ cp -rfL $$r/$$d/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/. ); \ + done ; \ + done + cd $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include && ln -sf asm-$(ARCH) asm +diff -ruN klibc-1.0/MCONFIG klibc-1.0.new/MCONFIG +--- klibc-1.0/MCONFIG 2005-03-06 20:35:22.000000000 +0100 ++++ klibc-1.0.new/MCONFIG 2005-08-27 22:43:06.000000000 +0200 +@@ -12,7 +12,7 @@ + KCROSS ?= $(CROSS) + + # Location for installation +-prefix = /usr ++prefix = $(out) + bindir = $(prefix)/bin + libdir = $(prefix)/lib + mandir = $(prefix)/man +@@ -70,7 +70,7 @@ + # THIS MUST BE AN ABSOLUTE PATH WITH NO FINAL SLASH. + # Leave this empty to make it the root. + # +-SHLIBDIR = /lib ++SHLIBDIR = $(out)/lib + + # Enable this to make perror/strerror return real error messages + # This makes klibc.so and any static binary which uses these functions diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 666583d57ae..b13bcbad01c 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -360,6 +360,10 @@ rec { inherit fetchurl stdenv yacc; }; + flexWrapper = (import ../development/tools/parsing/flex-wrapper) { + inherit stdenv flex ; + }; + flexnew = (import ../development/tools/parsing/flex/flex-new.nix) { inherit fetchurl stdenv yacc; m4 = gnum4; @@ -1097,6 +1101,10 @@ rec { inherit fetchurl stdenv perl; }; + klibc = (import ../os-specific/linux/klibc) { + inherit fetchurl stdenv kernel perl bison flexWrapper; + }; + mingetty = (import ../os-specific/linux/mingetty) { inherit fetchurl stdenv; }; @@ -1105,9 +1113,9 @@ rec { inherit stdenv mingetty shadowutils; }; - nfsUtils = (import ../os-specific/linux/nfs-utils) { - inherit fetchurl stdenv; - }; + #nfsUtils = (import ../os-specific/linux/nfs-utils) { + # inherit fetchurl stdenv; + #}; alsaLib = (import ../os-specific/linux/alsa/library) { inherit fetchurl stdenv;