From 66b646d7e70ffd8943fcc4017ffd29942dfb1bcf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 25 Nov 2006 21:49:42 +0000 Subject: [PATCH] * Latest klibc. svn path=/nixpkgs/trunk/; revision=7133 --- pkgs/os-specific/linux/klibc/builder.sh | 10 +++--- pkgs/os-specific/linux/klibc/default.nix | 8 ++--- pkgs/os-specific/linux/klibc/install.patch | 28 +++++++++++++++ .../linux/klibc/klibc-installpath.patch | 34 ------------------- pkgs/top-level/all-packages.nix | 6 ++-- 5 files changed, 41 insertions(+), 45 deletions(-) create mode 100644 pkgs/os-specific/linux/klibc/install.patch delete 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 index 7947969f5f38..d4a9f560e21f 100644 --- a/pkgs/os-specific/linux/klibc/builder.sh +++ b/pkgs/os-specific/linux/klibc/builder.sh @@ -1,11 +1,13 @@ source $stdenv/setup +preBuild=preBuild preBuild() { - kernelhash=$(ls $kernel/lib/modules) - echo $kernelhash - ln -s $kernel/lib/modules/$kernelhash/build linux + mkdir -p linux/include + ln -s $kernelHeaders/include/* linux/include/ } -preBuild=preBuild +makeFlagsArray=(V=1 prefix=$out SHLIBDIR=$out/lib) + +installFlagsArray=("${makeFlagsArray[@]}") genericBuild diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index 5ff10bf96f2f..64ee86a9435a 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, kernel, perl, bison, flexWrapper}: +{stdenv, fetchurl, perl, bison, mktemp}: assert stdenv.isLinux; @@ -9,7 +9,7 @@ stdenv.mkDerivation { url = http://www.kernel.org/pub/linux/libs/klibc/klibc-1.4.tar.bz2; md5 = "f4e0e17fc660e59c39e448fe1d827d36"; }; - inherit kernel; -# buildInputs = [perl bison flexWrapper]; -# patches = [./klibc-installpath.patch]; + inherit (stdenv.glibc) kernelHeaders; + buildInputs = [perl bison mktemp]; + patches = [./install.patch]; } diff --git a/pkgs/os-specific/linux/klibc/install.patch b/pkgs/os-specific/linux/klibc/install.patch new file mode 100644 index 000000000000..a5db5c098565 --- /dev/null +++ b/pkgs/os-specific/linux/klibc/install.patch @@ -0,0 +1,28 @@ +diff -rc klibc-1.4-orig/scripts/Kbuild.install klibc-1.4/scripts/Kbuild.install +*** klibc-1.4-orig/scripts/Kbuild.install 2006-06-19 03:17:15.000000000 +0200 +--- klibc-1.4/scripts/Kbuild.install 2006-11-25 22:41:09.000000000 +0100 +*************** +*** 96,107 **** + $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib + $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin + $(Q)set -e ; for d in linux scsi asm-$(KLIBCARCH) asm-generic $(ASMKLIBCARCH); do \ +! mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)include/$$d ; \ +! for r in $(KLIBCKERNELSRC)/include $(KLIBCKERNELOBJ)/include \ +! $(KLIBCKERNELOBJ)/include2 ; do \ + [ ! -d $$r/$$d ] || \ +! cp -rfL $$r/$$d/. \ +! $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/. ; \ + done ; \ + done + $(Q)cd $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include && ln -sf asm-$(KLIBCARCH) asm +--- 96,105 ---- + $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib + $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin + $(Q)set -e ; for d in linux scsi asm-$(KLIBCARCH) asm-generic $(ASMKLIBCARCH); do \ +! for r in $(KLIBCKERNELSRC)/include ; do \ + [ ! -d $$r/$$d ] || \ +! cp -rd $$r/$$d \ +! $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d ; \ + done ; \ + done + $(Q)cd $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include && ln -sf asm-$(KLIBCARCH) asm diff --git a/pkgs/os-specific/linux/klibc/klibc-installpath.patch b/pkgs/os-specific/linux/klibc/klibc-installpath.patch deleted file mode 100644 index d85454d28272..000000000000 --- a/pkgs/os-specific/linux/klibc/klibc-installpath.patch +++ /dev/null @@ -1,34 +0,0 @@ -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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ed96e820edf4..a342635620c9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2140,9 +2140,9 @@ rec { inherit stdenv MAKEDEV; }; - #klibc = import ../os-specific/linux/klibc { - # inherit fetchurl stdenv kernel perl bison flexWrapper; - #}; + klibc = import ../os-specific/linux/klibc { + inherit fetchurl stdenv perl bison mktemp; + }; mingetty = import ../os-specific/linux/mingetty { inherit fetchurl stdenv;