diff --git a/pkgs/applications/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix index 0cd866a2c95e..b00fb6d2dc7b 100644 --- a/pkgs/applications/display-managers/slim/default.nix +++ b/pkgs/applications/display-managers/slim/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { # Don't set PAM_RHOST to "localhost", it confuses ConsoleKit # (which assumes that a non-empty string means a remote session). ./pam2.patch + + ./slim-1.3.1-gcc4.4.patch ]; buildInputs = [x11 libjpeg libpng libXmu freetype pam]; diff --git a/pkgs/applications/display-managers/slim/slim-1.3.1-gcc4.4.patch b/pkgs/applications/display-managers/slim/slim-1.3.1-gcc4.4.patch new file mode 100644 index 000000000000..71b028ec080b --- /dev/null +++ b/pkgs/applications/display-managers/slim/slim-1.3.1-gcc4.4.patch @@ -0,0 +1,17 @@ +Patch to allow compilation with gcc-4.4 + +Notified by Daniel J. - from Debian bug tracker + +http://bugs.gentoo.org/252745 + +--- a/switchuser.h 2008-11-11 19:40:18.000000000 +0000 ++++ a/switchuser.h 2008-11-11 19:40:28.000000000 +0000 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include "const.h" + #include "cfg.h" + diff --git a/pkgs/applications/graphics/pqiv/default.nix b/pkgs/applications/graphics/pqiv/default.nix index dbb2ce6ed737..a573148684dc 100644 --- a/pkgs/applications/graphics/pqiv/default.nix +++ b/pkgs/applications/graphics/pqiv/default.nix @@ -4,14 +4,12 @@ stdenv.mkDerivation (rec { name = "pqiv-0.8"; src = fetchurl { - url = "http://www.pberndt.com/raw//Programme/Linux/pqiv/_download/pqiv-0.8.tbz"; + url = "http://www.pberndt.com/raw/Programme/Linux/pqiv/_download/${name}.tbz"; sha256 = "365332bab4b13ca56da6935e7155af20658e67d323808942dce23e880466f66d"; }; buildInputs = [ getopt which pkgconfig gtk ]; - unpackCmd="bzip2 -d < $src | tar xvf - || fail"; - preConfigure='' substituteInPlace configure --replace /bin/bash "$shell" sed -i -e 's|$(tempfile -s.*)|temp.c|' -e 's|tempfile|mktemp|' configure diff --git a/pkgs/applications/graphics/xscreensaver/default.nix b/pkgs/applications/graphics/xscreensaver/default.nix index 2701892aa4a5..7dfe31f8957a 100644 --- a/pkgs/applications/graphics/xscreensaver/default.nix +++ b/pkgs/applications/graphics/xscreensaver/default.nix @@ -1,41 +1,36 @@ -args : with args; let localDefs = builderDefs.passthru.function (args // rec { - version = lib.attrByPath ["version"] "5.10" args; - src = /* put a fetchurl here */ - fetchurl { - url = "http://www.jwz.org/xscreensaver/xscreensaver-${version}.tar.gz"; - sha256 = "07zy157wqwgcapqycyv89yabxa8byk4p8jn3zlvhf7lx5w1xmval"; - }; - useConfig = true; - reqsList = [ - ["true" "libX11" "pkgconfig" "bc" "perl" "intltool" "libXmu"] - ["GL" "mesa"] - ["GUI" "gtk" "libxml2" "libglade"] - ["jpeg" "libjpeg"] - ["false"] - ]; - configFlags = [ - "GL" " --with-gl " - "gdkpixbuf" " --with-pixbuf " - "DPMS" " --with-dpms " - "true" (" --with-x-app-defaults=\$out/share/xscreensaver/app-defaults "+ - " --with-hackdir=\$out/share/xscreensaver-hacks ") - ]; - }); - in with localDefs; -let - preConfigure = fullDepEntry (" - sed -e 's%@GTK_DATADIR@%@datadir@% ; s%@PO_DATADIR@%@datadir@%' "+ - "-i driver/Makefile.in po/Makefile.in.in; - ") ["minInit" "doUnpack"]; -in +{ stdenv, fetchurl, pkgconfig, bc, perl, xlibs, libjpeg, mesa, gtk +, libxml2, libglade }: + stdenv.mkDerivation rec { - name = "xscreensaver-5.10"; - buildCommand = textClosure localDefs - [preConfigure doConfigure doMakeInstall doForceShare doPropagate]; - meta = { - description = "A set of screensavers"; - inherit src; - maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.allBut "i686-cygwin"; - }; + name = "xscreensaver-5.10"; + + src = fetchurl { + url = "http://www.jwz.org/xscreensaver/${name}.tar.gz"; + sha256 = "07zy157wqwgcapqycyv89yabxa8byk4p8jn3zlvhf7lx5w1xmval"; + }; + + buildInputs = + [ pkgconfig bc perl libjpeg mesa gtk libxml2 libglade + xlibs.xlibs xlibs.libXmu + ]; + + configureFlags = + [ "--with-gl" + "--with-dpms" + "--with-pixbuf" + "--with-x-app-defaults=\$out/share/xscreensaver/app-defaults" + "--with-hackdir=\$out/share/xscreensaver-hacks" + ]; + + preConfigure = + '' + sed -e 's%@GTK_DATADIR@%@datadir@% ; s%@PO_DATADIR@%@datadir@%' \ + -i driver/Makefile.in po/Makefile.in.in + ''; + + meta = { + description = "A set of screensavers"; + maintainers = [ stdenv.lib.maintainers.raskin ]; + platforms = stdenv.lib.platforms.allBut "i686-cygwin"; + }; } diff --git a/pkgs/applications/misc/googleearth/default.nix b/pkgs/applications/misc/googleearth/default.nix index 550a7666b9d3..e903a384f108 100644 --- a/pkgs/applications/misc/googleearth/default.nix +++ b/pkgs/applications/misc/googleearth/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, glibc, mesa, freetype, glib, libSM, libICE, libXi, libXv, libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11, -zlib, patchelf05 }: +zlib }: /* I haven't found any x86_64 package from them */ assert stdenv.system == "i686-linux"; @@ -55,12 +55,12 @@ stdenv.mkDerivation { fullPath=$fullPath:$i/lib done - ${patchelf05}/bin/patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ --set-rpath $fullPath \ $out/opt/googleearth/googleearth-bin for a in $out/opt/googleearth/*.so* ; do - ${patchelf05}/bin/patchelf --set-rpath $fullPath $a + patchelf --set-rpath $fullPath $a done ''; diff --git a/pkgs/applications/networking/browsers/lynx/default.nix b/pkgs/applications/networking/browsers/lynx/default.nix index ccdda94a85f4..c9da94258c83 100644 --- a/pkgs/applications/networking/browsers/lynx/default.nix +++ b/pkgs/applications/networking/browsers/lynx/default.nix @@ -6,14 +6,18 @@ assert sslSupport -> openssl != null; stdenv.mkDerivation { name = "lynx-2.8.7"; + src = fetchurl { url = http://lynx.isc.org/lynx2.8.7/lynx2.8.7.tar.bz2; sha256 = "1baxwpdvak6nalr943g22z67r1d3fbibbkqvkvvar9xlvrs9gv20"; }; - configureFlags = (if sslSupport then "--with-ssl" else ""); - buildInputs = [ncurses (if sslSupport then openssl else null)]; + + configureFlags = if sslSupport then "--with-ssl" else ""; + + buildInputs = [ ncurses ] ++ stdenv.lib.optional sslSupport openssl; meta = { + homepage = http://lynx.isc.org/; description = "A text-mode web browser"; }; } diff --git a/pkgs/applications/networking/newsreaders/pan/default.nix b/pkgs/applications/networking/newsreaders/pan/default.nix index 67158bb69b0f..9df7868be1b5 100644 --- a/pkgs/applications/networking/newsreaders/pan/default.nix +++ b/pkgs/applications/networking/newsreaders/pan/default.nix @@ -13,6 +13,14 @@ stdenv.mkDerivation { sha1 = "a0bd98ea1ba174800896611e3305a6b6d8dbde2f"; }; + patches = + [ # Build on GCC 4.4. + (fetchurl { + url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/net-nntp/pan/files/pan-0.133-gcc44.patch?rev=1.1"; + sha256 = "05xmgvcpl1gjcfab8xsdy400p55j59hp52fwa4qbwlqy3c35qv1v"; + }) + ]; + buildInputs = [pkgconfig gtk perl pcre gmime gettext] ++ stdenv.lib.optional spellChecking gtkspell; diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix index d52e1ab37068..dfe79bff15e7 100644 --- a/pkgs/applications/networking/p2p/mldonkey/default.nix +++ b/pkgs/applications/networking/p2p/mldonkey/default.nix @@ -1,10 +1,10 @@ {stdenv, fetchurl, ocaml, zlib, bzip2, ncurses, file, gd, libpng }: -stdenv.mkDerivation { +stdenv.mkDerivation (rec { name = "mldonkey-3.0.1"; src = fetchurl { - url = "mirror://sourceforge/mldonkey/mldonkey-3.0.1.tar.bz2"; + url = "mirror://sourceforge/mldonkey/${name}.tar.bz2"; sha256 = "09zk53rfdkjipf5sl37rypzi2mx0a5v57vsndj22zajkqr4l0zds"; }; @@ -14,5 +14,16 @@ stdenv.mkDerivation { }; buildInputs = [ ocaml zlib ncurses bzip2 file gd libpng ]; - configureFlags = [ "--disable-gui" "--enable-ocamlver=3.11.1" ]; -} + configureFlags = [ "--disable-gui" ]; +} // (if (stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux") then +{ + # Byte code compilation (the ocaml opt compiler is not supported in many platforms) + buildPhase = "make mlnet.byte"; + installPhase = '' + ensureDir $out/bin + cp mlnet.byte $out/bin/mlnet + ''; + + # ocaml bytecode selfcontained binaries loose the bytecode if stripped + dontStrip = true; +} else {})) diff --git a/pkgs/applications/science/xplanet/default.nix b/pkgs/applications/science/xplanet/default.nix index cb3c47734bd8..15e04c3835c3 100644 --- a/pkgs/applications/science/xplanet/default.nix +++ b/pkgs/applications/science/xplanet/default.nix @@ -2,11 +2,22 @@ stdenv.mkDerivation { name = "xplanet-1.2.1"; + src = fetchurl { url = mirror://sourceforge/xplanet/xplanet-1.2.1.tar.gz; sha256 = "1pp55a1rgjkfcrwc00y3l48fhpqcp3qagd1zbym6zg27fzi5fbgm"; }; + + patches = + [ # Build on GCC 4.4. + (fetchurl { + url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/x11-misc/xplanet/files/xplanet-1.2.1-gentoo.patch?rev=1.1"; + sha256 = "0mmagjizj4hj057qmpi45w95zlrqda32x96xy44f6126xzj02yd5"; + }) + ]; + buildInputs = [ pkgconfig freetype pango libpng libtiff giflib libjpeg ]; + meta = { description = "Renders an image of the earth or other planets into the X root window"; homepage = http://xplanet.sourceforge.net; diff --git a/pkgs/build-support/gcc-cross-wrapper/add-flags b/pkgs/build-support/gcc-cross-wrapper/add-flags index ac1e58ebb812..9ff4522e800b 100644 --- a/pkgs/build-support/gcc-cross-wrapper/add-flags +++ b/pkgs/build-support/gcc-cross-wrapper/add-flags @@ -1,5 +1,5 @@ -export NIX_CFLAGS_COMPILE="@cflagsCompile@ $NIX_CFLAGS_COMPILE" -export NIX_CFLAGS_LINK="@cflagsLink@ $NIX_CFLAGS_LINK" -export NIX_LDFLAGS="@ldflags@ $NIX_LDFLAGS" -export NIX_LDFLAGS_BEFORE="@ldflagsBefore@ $NIX_LDFLAGS_BEFORE" -export NIX_GLIBC_FLAGS_SET=1 +export NIX_CROSS_CFLAGS_COMPILE="@cflagsCompile@ $NIX_CROSS_CFLAGS_COMPILE" +export NIX_CROSS_CFLAGS_LINK="@cflagsLink@ $NIX_CROSS_CFLAGS_LINK" +export NIX_CROSS_LDFLAGS="@ldflags@ $NIX_CROSS_LDFLAGS" +export NIX_CROSS_LDFLAGS_BEFORE="@ldflagsBefore@ $NIX_CROSS_LDFLAGS_BEFORE" +export NIX_CROSS_GLIBC_FLAGS_SET=1 diff --git a/pkgs/build-support/gcc-cross-wrapper/builder.sh b/pkgs/build-support/gcc-cross-wrapper/builder.sh index 0e8aa69fa8ed..aaf52cd7745d 100644 --- a/pkgs/build-support/gcc-cross-wrapper/builder.sh +++ b/pkgs/build-support/gcc-cross-wrapper/builder.sh @@ -5,17 +5,10 @@ source $stdenv/setup cflagsCompile="-B$out/bin/" if test -z "$nativeLibc"; then - # The "-B$glibc/lib/" flag is a quick hack to force gcc to link - # against the crt1.o from our own glibc, rather than the one in - # /usr/lib. The real solution is of course to prevent those paths - # from being used by gcc in the first place. - # The dynamic linker is passed in `ldflagsBefore' to allow - # explicit overrides of the dynamic linker by callers to gcc/ld - # (the *last* value counts, so ours should come first). - cflagsCompile="$cflagsCompile -B$libc/usr/lib/ -isystem $libc/usr/include" - ldflags="$ldflags -L$libc/usr/lib" - #ldflagsBefore="-dynamic-linker $libc/lib/ld-linux.so.2" - ldflagsBefore="-dynamic-linker $libc/lib/ld-uClibc.so.0" + cflagsCompile="$cflagsCompile -B$libc/lib/ -isystem $libc/include" + ldflags="$ldflags -L$libc/lib" + ldflagsBefore="-dynamic-linker $libc/lib/ld-linux.so.?" + #ldflagsBefore="-dynamic-linker $libc/lib/ld-uClibc.so.0" fi if test -n "$nativeTools"; then @@ -24,7 +17,7 @@ if test -n "$nativeTools"; then else ldflags="$ldflags -L$gcc/lib" gccPath="$gcc/bin" - ldPath="$binutils/bin" + ldPath="$binutils/$crossConfig/bin" fi @@ -47,6 +40,7 @@ doSubstitute() { --subst-var "cflagsLink" \ --subst-var "ldflags" \ --subst-var "ldflagsBefore" \ + --subst-var "ldPath" \ --subst-var-by "ld" "$ldPath/ld" } @@ -67,24 +61,24 @@ mkGccWrapper() { chmod +x "$dst" } -mkGccWrapper $out/bin/$cross-gcc $gccPath/$cross-gcc +mkGccWrapper $out/bin/$crossConfig-gcc $gccPath/$crossConfig-gcc #ln -s gcc $out/bin/cc -mkGccWrapper $out/bin/g++ $gccPath/g++ -ln -s g++ $out/bin/c++ +mkGccWrapper $out/bin/$crossConfig-g++ $gccPath/$crossConfig-g++ +ln -s $crossConfig-g++ $out/bin/$crossConfig-c++ -mkGccWrapper $out/bin/g77 $gccPath/g77 -ln -s g77 $out/bin/f77 +mkGccWrapper $out/bin/$crossConfig-g77 $gccPath/$crossConfig-g77 +ln -s $crossConfig-g77 $out/bin/$crossConfig-f77 -ln -s $binutils/bin/$cross-ar $out/bin/$cross-ar -ln -s $binutils/bin/$cross-as $out/bin/$cross-as -ln -s $binutils/bin/$cross-nm $out/bin/$cross-nm -ln -s $binutils/bin/$cross-strip $out/bin/$cross-strip +ln -s $binutils/bin/$crossConfig-ar $out/bin/$crossConfig-ar +ln -s $binutils/bin/$crossConfig-as $out/bin/$crossConfig-as +ln -s $binutils/bin/$crossConfig-nm $out/bin/$crossConfig-nm +ln -s $binutils/bin/$crossConfig-strip $out/bin/$crossConfig-strip # Make a wrapper around the linker. -doSubstitute "$ldWrapper" "$out/bin/$cross-ld" -chmod +x "$out/bin/$cross-ld" +doSubstitute "$ldWrapper" "$out/bin/$crossConfig-ld" +chmod +x "$out/bin/$crossConfig-ld" # Emit a setup hook. Also store the path to the original GCC and diff --git a/pkgs/build-support/gcc-cross-wrapper/default.nix b/pkgs/build-support/gcc-cross-wrapper/default.nix index 74d15660da8f..362e378273dd 100644 --- a/pkgs/build-support/gcc-cross-wrapper/default.nix +++ b/pkgs/build-support/gcc-cross-wrapper/default.nix @@ -5,13 +5,13 @@ # stdenv.mkDerivation provides a wrapper that sets up the right environment # variables so that the compiler and the linker just "work". -{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" -, gcc ? null, libc ? null, binutils ? null, shell ? "", cross ? "" +{ name ? "", stdenv, nativeTools, nativeLibc, noLibc ? false, nativePrefix ? "" +, gcc ? null, libc ? null, binutils ? null, shell ? "", cross }: assert nativeTools -> nativePrefix != ""; assert !nativeTools -> gcc != null && binutils != null; -assert !nativeLibc -> libc != null; +assert !noLibc -> (!nativeLibc -> libc != null); stdenv.mkDerivation { builder = ./builder.sh; @@ -20,13 +20,18 @@ stdenv.mkDerivation { ldWrapper = ./ld-wrapper.sh; utils = ./utils.sh; addFlags = ./add-flags; - inherit nativeTools nativeLibc nativePrefix gcc libc binutils cross; + inherit nativeTools nativeLibc nativePrefix gcc libc binutils; + crossConfig = if (cross != null) then cross.config else null; name = if name == "" then gcc.name else name; langC = if nativeTools then true else gcc.langC; langCC = if nativeTools then true else gcc.langCC; - langF77 = if nativeTools then false else gcc.langF77; + langF77 = if nativeTools then false else gcc ? langFortran; shell = if shell == "" then stdenv.shell else shell; meta = if gcc != null then gcc.meta else { description = "System C compiler wrapper"; }; + + passthru = { + target = cross; + }; } diff --git a/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh index d514b57e28a0..491de8f7f984 100644 --- a/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh @@ -4,7 +4,7 @@ if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then source "$NIX_GCC_WRAPPER_START_HOOK" fi -if test -z "$NIX_GLIBC_FLAGS_SET"; then +if test -z "$NIX_CROSS_GLIBC_FLAGS_SET"; then source @out@/nix-support/add-flags fi @@ -63,28 +63,28 @@ fi # Add the flags for the C compiler proper. -extraAfter=($NIX_CFLAGS_COMPILE) +extraAfter=($NIX_CROSS_CFLAGS_COMPILE) extraBefore=() if test "$dontLink" != "1"; then # Add the flags that should only be passed to the compiler when # linking. - extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK) + extraAfter=(${extraAfter[@]} $NIX_CROSS_CFLAGS_LINK) # Add the flags that should be passed to the linker (and prevent - # `ld-wrapper' from adding NIX_LDFLAGS again). - for i in $NIX_LDFLAGS_BEFORE; do + # `ld-wrapper' from adding NIX_CROSS_LDFLAGS again). + for i in $NIX_CROSS_LDFLAGS_BEFORE; do extraBefore=(${extraBefore[@]} "-Wl,$i") done - for i in $NIX_LDFLAGS; do + for i in $NIX_CROSS_LDFLAGS; do if test "${i:0:3}" = "-L/"; then extraAfter=(${extraAfter[@]} "$i") else extraAfter=(${extraAfter[@]} "-Wl,$i") fi done - export NIX_LDFLAGS_SET=1 + export NIX_CROSS_LDFLAGS_SET=1 if test "$NIX_STRIP_DEBUG" = "1"; then # Add executable-stripping flags. @@ -112,6 +112,8 @@ if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then source "$NIX_GCC_WRAPPER_EXEC_HOOK" fi +# We want gcc to call the wrapper linker, not that of binutils. +export PATH="@ldPath@:$PATH" # Call the real `gcc'. Filter out warnings from stderr about unused # `-B' flags, since they confuse some programs. Deep bash magic to diff --git a/pkgs/build-support/gcc-cross-wrapper/ld-wrapper.sh b/pkgs/build-support/gcc-cross-wrapper/ld-wrapper.sh index cc1b125804a4..226fad833599 100644 --- a/pkgs/build-support/gcc-cross-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/gcc-cross-wrapper/ld-wrapper.sh @@ -4,7 +4,7 @@ if test -n "$NIX_LD_WRAPPER_START_HOOK"; then source "$NIX_LD_WRAPPER_START_HOOK" fi -if test -z "$NIX_GLIBC_FLAGS_SET"; then +if test -z "$NIX_CROSS_GLIBC_FLAGS_SET"; then source @out@/nix-support/add-flags fi @@ -14,7 +14,7 @@ source @out@/nix-support/utils # Optionally filter out paths not refering to the store. params=("$@") if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \ - -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then + -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_CROSS_LDFLAGS_SET" \); then rest=() n=0 while test $n -lt ${#params[*]}; do @@ -44,9 +44,9 @@ fi extra=() extraBefore=() -if test -z "$NIX_LDFLAGS_SET"; then - extra=(${extra[@]} $NIX_LDFLAGS) - extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE) +if test -z "$NIX_CROSS_LDFLAGS_SET"; then + extra=(${extra[@]} $NIX_CROSS_LDFLAGS) + extraBefore=(${extraBefore[@]} $NIX_CROSS_LDFLAGS_BEFORE) fi @@ -121,7 +121,7 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then # Finally, add `-rpath' switches. for i in $rpath; do - extra=(${extra[@]} -rpath $i) + extra=(${extra[@]} -rpath $i -rpath-link $i) done fi diff --git a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh index 7a7ea8226919..0c98062a2db1 100644 --- a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh @@ -1,14 +1,57 @@ -addCVars () { +NIX_CROSS_CFLAGS_COMPILE="" +NIX_CROSS_LDFLAGS="" + +crossAddCVars () { if test -d $1/include; then - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include" + export NIX_CROSS_CFLAGS_COMPILE="$NIX_CROSS_CFLAGS_COMPILE -I$1/include" fi if test -d $1/lib; then - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" + export NIX_CROSS_LDFLAGS="$NIX_CROSS_LDFLAGS -L$1/lib -rpath-link $1/lib" fi } -envHooks=(${envHooks[@]} addCVars) +crossEnvHooks=(${crossEnvHooks[@]} crossAddCVars) + +crossStripDirs() { + local dirs="$1" + local stripFlags="$2" + local dirsNew= + + for d in ${dirs}; do + if test -d "$prefix/$d"; then + dirsNew="${dirsNew} $prefix/$d " + fi + done + dirs=${dirsNew} + + if test -n "${dirs}"; then + header "stripping (with flags $stripFlags) in $dirs" + # libc_nonshared.a should never be stripped, or builds will break. + find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} $crossConfig-strip $stripFlags || true + stopNest + fi +} + +crossStrip () { + # In cross_renaming we may rename dontCrossStrip to dontStrip, and + # dontStrip to dontNativeStrip. + # TODO: strip _only_ ELF executables, and return || fail here... + if test -z "$dontCrossStrip"; then + stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin} + if test -n "$stripDebugList"; then + crossStripDirs "$stripDebugList" "${stripDebugFlags:--S}" + fi + + stripAllList=${stripAllList:-} + if test -n "$stripAllList"; then + crossStripDirs "$stripAllList" "${stripAllFlags:--s}" + fi + fi +} + +preDistPhases=(${preDistPhases[@]} crossStrip) + # Note: these come *after* $out in the PATH (see setup.sh). @@ -20,6 +63,20 @@ if test -n "@binutils@"; then PATH=$PATH:@binutils@/bin fi -if test -n "@glibc@"; then - PATH=$PATH:@glibc@/bin +if test -n "@libc@"; then + PATH=$PATH:@libc@/bin + crossAddCVars @libc@ +fi + +configureFlags="$configureFlags --build=$system --host=$crossConfig" +# Disabling the tests when cross compiling, as usually the tests are meant for +# native compilations. +doCheck="" + +# Add the output as an rpath. +if test "$NIX_NO_SELF_RPATH" != "1"; then + export NIX_CROSS_LDFLAGS="-rpath $out/lib -rpath-link $out/lib $NIX_CROSS_LDFLAGS" + if test -n "$NIX_LIB64_IN_SELF_RPATH"; then + export NIX_CROSS_LDFLAGS="-rpath $out/lib64 -rpath-link $out/lib $NIX_CROSS_LDFLAGS" + fi fi diff --git a/pkgs/build-support/gcc-wrapper/add-flags b/pkgs/build-support/gcc-wrapper/add-flags index 02755e445414..26e536f6d575 100644 --- a/pkgs/build-support/gcc-wrapper/add-flags +++ b/pkgs/build-support/gcc-wrapper/add-flags @@ -9,6 +9,10 @@ if test -e @out@/nix-support/gcc-cflags; then export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE" fi +if test -e @out@/nix-support/gnat-cflags; then + export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE" +fi + if test -e @out@/nix-support/libc-ldflags; then export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)" fi diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index 0fe3f3768f2a..2e87d82f52cd 100644 --- a/pkgs/build-support/gcc-wrapper/builder.sh +++ b/pkgs/build-support/gcc-wrapper/builder.sh @@ -42,6 +42,9 @@ else gccLDFlags="$gccLDFlags -L$gcc/lib64" fi gccLDFlags="$gccLDFlags -L$gcc/lib" + if [ -n "$langVhdl" ]; then + gccLDFlags="$gccLDFlags -L$zlib/lib" + fi echo "$gccLDFlags" > $out/nix-support/gcc-ldflags # GCC shows $gcc/lib in `gcc -print-search-dirs', but not @@ -51,6 +54,15 @@ else if test -e "$gcc/lib64"; then gccCFlags="$gccCFlags -B$gcc/lib64" fi + + # Find the gcc libraries path (may work only without multilib) + if [ -n "$langAda" ]; then + basePath=`echo $gcc/lib/*/*/*` + gccCFlags="$gccCFlags -B$basePath -I$basePath/adainclude" + + gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib" + echo "$gnatCFlags" > $out/nix-support/gnat-cflags + fi echo "$gccCFlags" > $out/nix-support/gcc-cflags gccPath="$gcc/bin" @@ -68,7 +80,10 @@ doSubstitute() { -e "s^@shell@^$shell^g" \ -e "s^@gcc@^$gcc^g" \ -e "s^@gccProg@^$gccProg^g" \ + -e "s^@gnatProg@^$gnatProg^g" \ + -e "s^@gnatlinkProg@^$gnatlinkProg^g" \ -e "s^@binutils@^$binutils^g" \ + -e "s^@coreutils@^$coreutils^g" \ -e "s^@libc@^$libc^g" \ -e "s^@ld@^$ldPath/ld^g" \ < "$src" > "$dst" @@ -83,7 +98,7 @@ mkGccWrapper() { if ! test -f "$src"; then echo "$src does not exist (skipping)" - return + return 1 fi gccProg="$src" @@ -91,16 +106,59 @@ mkGccWrapper() { chmod +x "$dst" } -mkGccWrapper $out/bin/gcc $gccPath/gcc -ln -s gcc $out/bin/cc +mkGnatWrapper() { + local dst=$1 + local src=$2 -mkGccWrapper $out/bin/g++ $gccPath/g++ -ln -s g++ $out/bin/c++ + if ! test -f "$src"; then + echo "$src does not exist (skipping)" + return 1 + fi -if test -e $gccPath/gfortran; then - mkGccWrapper $out/bin/gfortran $gccPath/gfortran - ln -s gfortran $out/bin/g77 - ln -s gfortran $out/bin/f77 + gnatProg="$src" + doSubstitute "$gnatWrapper" "$dst" + chmod +x "$dst" +} + +mkGnatLinkWrapper() { + local dst=$1 + local src=$2 + + if ! test -f "$src"; then + echo "$src does not exist (skipping)" + return 1 + fi + + gnatlinkProg="$src" + doSubstitute "$gnatlinkWrapper" "$dst" + chmod +x "$dst" +} + +if mkGccWrapper $out/bin/gcc $gccPath/gcc +then + ln -sv gcc $out/bin/cc +fi + +if mkGccWrapper $out/bin/g++ $gccPath/g++ +then + ln -sv g++ $out/bin/c++ +fi + +if mkGccWrapper $out/bin/gfortran $gccPath/gfortran +then + ln -sv gfortran $out/bin/g77 + ln -sv gfortran $out/bin/f77 +fi + +mkGccWrapper $out/bin/gcj $gccPath/gcj || true + +mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true +mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true +mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true +mkGnatLinkWrapper $out/bin/gnatlink $gccPath/gnatlink || true + +if [ -f $gccPath/ghdl ]; then + ln -sf $gccPath/ghdl $out/bin/ghdl fi diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix index d517a472d747..c97fd4eb495d 100644 --- a/pkgs/build-support/gcc-wrapper/default.nix +++ b/pkgs/build-support/gcc-wrapper/default.nix @@ -6,13 +6,17 @@ # variables so that the compiler and the linker just "work". { name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" -, gcc ? null, libc ? null, binutils ? null, shell ? "" +, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "" +, zlib ? null }: assert nativeTools -> nativePrefix != ""; -assert !nativeTools -> gcc != null && binutils != null; +assert !nativeTools -> gcc != null && binutils != null && coreutils != null; assert !nativeLibc -> libc != null; +# For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper +assert (gcc != null && gcc ? langVhdl && gcc.langVhdl) -> zlib != null; + let gccVersion = (builtins.parseDrvName gcc.name).version; @@ -28,6 +32,8 @@ stdenv.mkDerivation { builder = ./builder.sh; setupHook = ./setup-hook.sh; gccWrapper = ./gcc-wrapper.sh; + gnatWrapper = ./gnat-wrapper.sh; + gnatlinkWrapper = ./gnatlink-wrapper.sh; ldWrapper = ./ld-wrapper.sh; utils = ./utils.sh; addFlags = ./add-flags; @@ -35,10 +41,15 @@ stdenv.mkDerivation { inherit nativeTools nativeLibc nativePrefix gcc; libc = if nativeLibc then null else libc; binutils = if nativeTools then null else binutils; + # The wrapper scripts use 'cat', so we may need coreutils + coreutils = if nativeTools then null else coreutils; langC = if nativeTools then true else gcc.langC; langCC = if nativeTools then true else gcc.langCC; langFortran = if nativeTools then false else gcc ? langFortran; + langAda = if nativeTools then false else gcc ? langAda && gcc.langAda; + langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; + zlib = if (gcc != null && gcc ? langVhdl) then zlib else null; shell = if shell == "" then stdenv.shell else shell; meta = @@ -54,6 +65,7 @@ stdenv.mkDerivation { if !nativeLibc then (if stdenv.system == "i686-linux" then "ld-linux.so.2" else if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else + if stdenv.system == "armv5tel-linux" then "ld-linux.so.3" else if stdenv.system == "powerpc-linux" then "ld.so.1" else abort "don't know the name of the dynamic linker for this platform") else ""; diff --git a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh index 8a49fcb9b06e..f1b394a1f540 100644 --- a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh @@ -30,6 +30,10 @@ for i in "$@"; do dontLink=1 elif test "$i" = "-MM"; then dontLink=1 + elif test "$i" = "-x"; then + # At least for the cases c-header or c++-header we should set dontLink. + # I expect no one use -x other than making precompiled headers. + dontLink=1 elif test "${i:0:1}" != "-"; then nonFlagArgs=1 elif test "$i" = "-m32"; then diff --git a/pkgs/build-support/gcc-wrapper/gnat-wrapper.sh b/pkgs/build-support/gcc-wrapper/gnat-wrapper.sh new file mode 100644 index 000000000000..f6fa4b18400a --- /dev/null +++ b/pkgs/build-support/gcc-wrapper/gnat-wrapper.sh @@ -0,0 +1,113 @@ +#! @shell@ -e + +if test -n "$NIX_GNAT_WRAPPER_START_HOOK"; then + source "$NIX_GNAT_WRAPPER_START_HOOK" +fi + +if test -z "$NIX_GNAT_WRAPPER_FLAGS_SET"; then + source @out@/nix-support/add-flags.sh +fi + +source @out@/nix-support/utils.sh + + +# Figure out if linker flags should be passed. GCC prints annoying +# warnings when they are not needed. +dontLink=0 +getVersion=0 +nonFlagArgs=0 + +for i in "$@"; do + if test "$i" = "-c"; then + dontLink=1 + elif test "$i" = "-M"; then + dontLink=1 + elif test "${i:0:1}" != "-"; then + nonFlagArgs=1 + elif test "$i" = "-m32"; then + if test -e @out@/nix-support/dynamic-linker-m32; then + NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" + fi + fi +done + +# If we pass a flag like -Wl, then gcc will call the linker unless it +# can figure out that it has to do something else (e.g., because of a +# "-c" flag). So if no non-flag arguments are given, don't pass any +# linker flags. This catches cases like "gcc" (should just print +# "gcc: no input files") and "gcc -v" (should print the version). +if test "$nonFlagArgs" = "0"; then + dontLink=1 +fi + + +# Optionally filter out paths not refering to the store. +params=("$@") +if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then + rest=() + n=0 + while test $n -lt ${#params[*]}; do + p=${params[n]} + p2=${params[$((n+1))]} + if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then + skip $p + elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then + skip $p + elif test "${p:0:4}" = "-aI/" && badPath "${p:3}"; then + skip $p + elif test "${p:0:4}" = "-aO/" && badPath "${p:3}"; then + skip $p + else + rest=("${rest[@]}" "$p") + fi + n=$((n + 1)) + done + params=("${rest[@]}") +fi + + +# Add the flags for the GNAT compiler proper. +extraAfter=($NIX_GNATFLAGS_COMPILE) +extraBefore=() + +if [ "`basename $0`x" = "gnatmakex" ]; then + extraBefore=("--GNATBIND=@out@/bin/gnatbind --GNATLINK=@out@/bin/gnatlink ") +fi + +# Add the flags that should be passed to the linker (and prevent +# `ld-wrapper' from adding NIX_LDFLAGS again). +#for i in $NIX_LDFLAGS_BEFORE; do +# extraBefore=(${extraBefore[@]} "-largs $i") +#done + +# Optionally print debug info. +if test "$NIX_DEBUG" = "1"; then + echo "original flags to @gnatProg@:" >&2 + for i in "${params[@]}"; do + echo " $i" >&2 + done + echo "extraBefore flags to @gnatProg@:" >&2 + for i in ${extraBefore[@]}; do + echo " $i" >&2 + done + echo "extraAfter flags to @gnatProg@:" >&2 + for i in ${extraAfter[@]}; do + echo " $i" >&2 + done +fi + +if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then + source "$NIX_GNAT_WRAPPER_EXEC_HOOK" +fi + + +# Call the real `gcc'. Filter out warnings from stderr about unused +# `-B' flags, since they confuse some programs. Deep bash magic to +# apply grep to stderr (by swapping stdin/stderr twice). +if test -z "$NIX_GNAT_NEEDS_GREP"; then + @gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} +else + (@gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ + | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- + exit $? +fi diff --git a/pkgs/build-support/gcc-wrapper/gnatlink-wrapper.sh b/pkgs/build-support/gcc-wrapper/gnatlink-wrapper.sh new file mode 100644 index 000000000000..25907108b4db --- /dev/null +++ b/pkgs/build-support/gcc-wrapper/gnatlink-wrapper.sh @@ -0,0 +1,43 @@ +#! @shell@ -e + +# Add the flags for the GNAT compiler proper. +extraAfter="--GCC=@out@/bin/gcc" +extraBefore=() + +# Add the flags that should be passed to the linker (and prevent +# `ld-wrapper' from adding NIX_LDFLAGS again). +#for i in $NIX_LDFLAGS_BEFORE; do +# extraBefore=(${extraBefore[@]} "-largs $i") +#done + +# Optionally print debug info. +if test "$NIX_DEBUG" = "1"; then + echo "original flags to @gnatlinkProg@:" >&2 + for i in "$@"; do + echo " $i" >&2 + done + echo "extraBefore flags to @gnatlinkProg@:" >&2 + for i in ${extraBefore[@]}; do + echo " $i" >&2 + done + echo "extraAfter flags to @gnatlinkProg@:" >&2 + for i in ${extraAfter[@]}; do + echo " $i" >&2 + done +fi + +if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then + source "$NIX_GNAT_WRAPPER_EXEC_HOOK" +fi + + +# Call the real `gcc'. Filter out warnings from stderr about unused +# `-B' flags, since they confuse some programs. Deep bash magic to +# apply grep to stderr (by swapping stdin/stderr twice). +if test -z "$NIX_GNAT_NEEDS_GREP"; then + @gnatlinkProg@ ${extraBefore[@]} "$@" ${extraAfter[@]} +else + (@gnatlinkProg@ ${extraBefore[@]} "$@" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ + | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- + exit $? +fi diff --git a/pkgs/build-support/gcc-wrapper/ld-wrapper.sh b/pkgs/build-support/gcc-wrapper/ld-wrapper.sh index 962adf43861a..3ca9e815a8f1 100644 --- a/pkgs/build-support/gcc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/ld-wrapper.sh @@ -53,8 +53,6 @@ fi # Add all used dynamic libraries to the rpath. if test "$NIX_DONT_SET_RPATH" != "1"; then - # First, find all -L... switches. - allParams=("${params[@]}" ${extra[@]}) libPath="" addToLibPath() { local path="$1" @@ -72,23 +70,6 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then esac libPath="$libPath $path " } - n=0 - while test $n -lt ${#allParams[*]}; do - p=${allParams[n]} - p2=${allParams[$((n+1))]} - if test "${p:0:3}" = "-L/"; then - addToLibPath ${p:2} - elif test "$p" = "-L"; then - addToLibPath ${p2} - n=$((n + 1)) - fi - n=$((n + 1)) - done - - # Second, for each directory in the library search path (-L...), - # see if it contains a dynamic library used by a -l... flag. If - # so, add the directory to the rpath. - rpath="" addToRPath() { # If the path is not in the store, don't add it to the rpath. @@ -101,6 +82,31 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then rpath="$rpath $1 " } + # First, find all -L... switches. + allParams=("${params[@]}" ${extra[@]}) + n=0 + while test $n -lt ${#allParams[*]}; do + p=${allParams[n]} + p2=${allParams[$((n+1))]} + if test "${p:0:3}" = "-L/"; then + addToLibPath ${p:2} + elif test "$p" = "-L"; then + addToLibPath ${p2} + n=$((n + 1)) + elif [[ "$p" =~ ^[^-].*\.so($|\.) ]]; then + # This is a direct reference to a shared library, so add + # its directory to the rpath. + path="$(dirname "$p")"; + addToRPath "${path}" + fi + n=$((n + 1)) + done + + # Second, for each directory in the library search path (-L...), + # see if it contains a dynamic library used by a -l... flag. If + # so, add the directory to the rpath. + rpath="" + for i in $libPath; do n=0 while test $n -lt ${#allParams[*]}; do diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh index 76167df3c31c..513ab8053a7e 100644 --- a/pkgs/build-support/gcc-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh @@ -27,3 +27,7 @@ fi if test -n "@libc@"; then addToSearchPath PATH @libc@/bin fi + +if test -n "@coreutils@"; then + addToSearchPath PATH @coreutils@/bin +fi diff --git a/pkgs/build-support/gcc-wrapper2/README b/pkgs/build-support/gcc-wrapper2/README deleted file mode 100644 index 6753387b4e7a..000000000000 --- a/pkgs/build-support/gcc-wrapper2/README +++ /dev/null @@ -1,6 +0,0 @@ -To be removed after we merge stdenv-updates in. -stdenv-updates should have this gcc-wrapper2 as gcc-wrapper. - -Changelog against gcc-wrapper: -- Support for linking shared objects with direct mention of the /path/libxxx.so object, - thus, adding its path to the rpath. diff --git a/pkgs/build-support/gcc-wrapper2/add-flags b/pkgs/build-support/gcc-wrapper2/add-flags deleted file mode 100644 index 02755e445414..000000000000 --- a/pkgs/build-support/gcc-wrapper2/add-flags +++ /dev/null @@ -1,24 +0,0 @@ -# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld. -export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE" - -if test -e @out@/nix-support/libc-cflags; then - export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE" -fi - -if test -e @out@/nix-support/gcc-cflags; then - export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE" -fi - -if test -e @out@/nix-support/libc-ldflags; then - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)" -fi - -if test -e @out@/nix-support/gcc-ldflags; then - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/gcc-ldflags)" -fi - -if test -e @out@/nix-support/libc-ldflags-before; then - export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" -fi - -export NIX_GCC_WRAPPER_FLAGS_SET=1 diff --git a/pkgs/build-support/gcc-wrapper2/builder.sh b/pkgs/build-support/gcc-wrapper2/builder.sh deleted file mode 100644 index 0fe3f3768f2a..000000000000 --- a/pkgs/build-support/gcc-wrapper2/builder.sh +++ /dev/null @@ -1,135 +0,0 @@ -source $stdenv/setup - - -ensureDir $out/bin -ensureDir $out/nix-support - - -if test -z "$nativeLibc"; then - dynamicLinker="$libc/lib/$dynamicLinker" - echo $dynamicLinker > $out/nix-support/dynamic-linker - - if test -e $libc/lib/32/ld-linux.so.2; then - echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 - fi - - # The "-B$libc/lib/" flag is a quick hack to force gcc to link - # against the crt1.o from our own glibc, rather than the one in - # /usr/lib. (This is only an issue when using an `impure' - # compiler/linker, i.e., one that searches /usr/lib and so on.) - # - # Unfortunately, setting -B appears to override the default search - # path. Thus, the gcc-specific "../includes-fixed" directory is - # now longer searched and glibc's header fails to - # compile, because it uses "#include_next " to find the - # limits.h file in ../includes-fixed. To remedy the problem, - # another -idirafter is necessary to add that directory again. - echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags - - echo "-L$libc/lib" > $out/nix-support/libc-ldflags - - # The dynamic linker is passed in `ldflagsBefore' to allow - # explicit overrides of the dynamic linker by callers to gcc/ld - # (the *last* value counts, so ours should come first). - echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before -fi - -if test -n "$nativeTools"; then - gccPath="$nativePrefix/bin" - ldPath="$nativePrefix/bin" -else - if test -e "$gcc/lib64"; then - gccLDFlags="$gccLDFlags -L$gcc/lib64" - fi - gccLDFlags="$gccLDFlags -L$gcc/lib" - echo "$gccLDFlags" > $out/nix-support/gcc-ldflags - - # GCC shows $gcc/lib in `gcc -print-search-dirs', but not - # $gcc/lib64 (even though it does actually search there...).. - # This confuses libtool. So add it to the compiler tool search - # path explicitly. - if test -e "$gcc/lib64"; then - gccCFlags="$gccCFlags -B$gcc/lib64" - fi - echo "$gccCFlags" > $out/nix-support/gcc-cflags - - gccPath="$gcc/bin" - ldPath="$binutils/bin" -fi - - -doSubstitute() { - local src=$1 - local dst=$2 - # Can't use substitute() here, because replace may not have been - # built yet (in the bootstrap). - sed \ - -e "s^@out@^$out^g" \ - -e "s^@shell@^$shell^g" \ - -e "s^@gcc@^$gcc^g" \ - -e "s^@gccProg@^$gccProg^g" \ - -e "s^@binutils@^$binutils^g" \ - -e "s^@libc@^$libc^g" \ - -e "s^@ld@^$ldPath/ld^g" \ - < "$src" > "$dst" -} - - -# Make wrapper scripts around gcc, g++, and gfortran. Also make symlinks -# cc, c++, and f77. -mkGccWrapper() { - local dst=$1 - local src=$2 - - if ! test -f "$src"; then - echo "$src does not exist (skipping)" - return - fi - - gccProg="$src" - doSubstitute "$gccWrapper" "$dst" - chmod +x "$dst" -} - -mkGccWrapper $out/bin/gcc $gccPath/gcc -ln -s gcc $out/bin/cc - -mkGccWrapper $out/bin/g++ $gccPath/g++ -ln -s g++ $out/bin/c++ - -if test -e $gccPath/gfortran; then - mkGccWrapper $out/bin/gfortran $gccPath/gfortran - ln -s gfortran $out/bin/g77 - ln -s gfortran $out/bin/f77 -fi - - -# Create a symlink to as (the assembler). This is useful when a -# gcc-wrapper is installed in a user environment, as it ensures that -# the right assembler is called. -ln -s $ldPath/as $out/bin/as - - -# Make a wrapper around the linker. -doSubstitute "$ldWrapper" "$out/bin/ld" -chmod +x "$out/bin/ld" - - -# Emit a setup hook. Also store the path to the original GCC and -# Glibc. -test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc -test -n "$libc" && echo $libc > $out/nix-support/orig-libc - -doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" - -doSubstitute "$setupHook" "$out/nix-support/setup-hook" - -cp -p $utils $out/nix-support/utils.sh - - -# Propagate the wrapped gcc so that if you install the wrapper, you get -# tools like gcov, the manpages, etc. as well (including for binutils -# and Glibc). -if test -z "$nativeTools"; then - echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages -fi diff --git a/pkgs/build-support/gcc-wrapper2/default.nix b/pkgs/build-support/gcc-wrapper2/default.nix deleted file mode 100644 index 950ba4c9f78b..000000000000 --- a/pkgs/build-support/gcc-wrapper2/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -# The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't -# know where the C library and standard header files are. Therefore -# the compiler produced by that package cannot be installed directly -# in a user environment and used from the command line. This -# stdenv.mkDerivation provides a wrapper that sets up the right environment -# variables so that the compiler and the linker just "work". - -{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" -, gcc ? null, libc ? null, binutils ? null, shell ? "" -}: - -assert nativeTools -> nativePrefix != ""; -assert !nativeTools -> gcc != null && binutils != null; -assert !nativeLibc -> libc != null; -assert gcc != null; - -let - - gccVersion = (builtins.parseDrvName gcc.name).version; - gccName = (builtins.parseDrvName gcc.name).name; - -in - -stdenv.mkDerivation { - name = - (if name != "" then name else gccName + "-wrapper") + - (if gcc != null && gccVersion != "" then "-" + gccVersion else ""); - - builder = ./builder.sh; - setupHook = ./setup-hook.sh; - gccWrapper = ./gcc-wrapper.sh; - ldWrapper = ./ld-wrapper.sh; - utils = ./utils.sh; - addFlags = ./add-flags; - - inherit nativeTools nativeLibc nativePrefix gcc; - libc = if nativeLibc then null else libc; - binutils = if nativeTools then null else binutils; - - langC = if nativeTools then true else gcc.langC; - langCC = if nativeTools then true else gcc.langCC; - langFortran = if nativeTools then false else gcc ? langFortran; - shell = if shell == "" then stdenv.shell else shell; - - meta = - let gcc_ = if gcc != null then gcc else {}; in - (if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) // - { description = - stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_ - + " (wrapper script)"; - }; - - # The dynamic linker has different names on different Linux platforms. - dynamicLinker = - if !nativeLibc then - (if stdenv.system == "i686-linux" then "ld-linux.so.2" else - if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else - if stdenv.system == "powerpc-linux" then "ld.so.1" else - abort "don't know the name of the dynamic linker for this platform") - else ""; -} diff --git a/pkgs/build-support/gcc-wrapper2/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper2/gcc-wrapper.sh deleted file mode 100644 index 8a49fcb9b06e..000000000000 --- a/pkgs/build-support/gcc-wrapper2/gcc-wrapper.sh +++ /dev/null @@ -1,148 +0,0 @@ -#! @shell@ -e - -if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then - source "$NIX_GCC_WRAPPER_START_HOOK" -fi - -if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then - source @out@/nix-support/add-flags.sh -fi - -source @out@/nix-support/utils.sh - - -# Figure out if linker flags should be passed. GCC prints annoying -# warnings when they are not needed. -dontLink=0 -getVersion=0 -nonFlagArgs=0 - -for i in "$@"; do - if test "$i" = "-c"; then - dontLink=1 - elif test "$i" = "-S"; then - dontLink=1 - elif test "$i" = "-E"; then - dontLink=1 - elif test "$i" = "-E"; then - dontLink=1 - elif test "$i" = "-M"; then - dontLink=1 - elif test "$i" = "-MM"; then - dontLink=1 - elif test "${i:0:1}" != "-"; then - nonFlagArgs=1 - elif test "$i" = "-m32"; then - if test -e @out@/nix-support/dynamic-linker-m32; then - NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" - fi - fi -done - -# If we pass a flag like -Wl, then gcc will call the linker unless it -# can figure out that it has to do something else (e.g., because of a -# "-c" flag). So if no non-flag arguments are given, don't pass any -# linker flags. This catches cases like "gcc" (should just print -# "gcc: no input files") and "gcc -v" (should print the version). -if test "$nonFlagArgs" = "0"; then - dontLink=1 -fi - - -# Optionally filter out paths not refering to the store. -params=("$@") -if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then - rest=() - n=0 - while test $n -lt ${#params[*]}; do - p=${params[n]} - p2=${params[$((n+1))]} - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then - skip $p - elif test "$p" = "-L" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then - skip $p - elif test "$p" = "-I" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "$p" = "-isystem" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - else - rest=("${rest[@]}" "$p") - fi - n=$((n + 1)) - done - params=("${rest[@]}") -fi - - -# Add the flags for the C compiler proper. -extraAfter=($NIX_CFLAGS_COMPILE) -extraBefore=() - -if test "$dontLink" != "1"; then - - # Add the flags that should only be passed to the compiler when - # linking. - extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK) - - # Add the flags that should be passed to the linker (and prevent - # `ld-wrapper' from adding NIX_LDFLAGS again). - for i in $NIX_LDFLAGS_BEFORE; do - extraBefore=(${extraBefore[@]} "-Wl,$i") - done - for i in $NIX_LDFLAGS; do - if test "${i:0:3}" = "-L/"; then - extraAfter=(${extraAfter[@]} "$i") - else - extraAfter=(${extraAfter[@]} "-Wl,$i") - fi - done - export NIX_LDFLAGS_SET=1 - - if test "$NIX_STRIP_DEBUG" = "1"; then - # Add executable-stripping flags. - extraAfter=(${extraAfter[@]} $NIX_CFLAGS_STRIP) - fi -fi - -# As a very special hack, if the arguments are just `-v', then don't -# add anything. This is to prevent `gcc -v' (which normally prints -# out the version number and returns exit code 0) from printing out -# `No input files specified' and returning exit code 1. -if test "$*" = "-v"; then - extraAfter=() - extraBefore=() -fi - -# Optionally print debug info. -if test "$NIX_DEBUG" = "1"; then - echo "original flags to @gccProg@:" >&2 - for i in "${params[@]}"; do - echo " $i" >&2 - done - echo "extraBefore flags to @gccProg@:" >&2 - for i in ${extraBefore[@]}; do - echo " $i" >&2 - done - echo "extraAfter flags to @gccProg@:" >&2 - for i in ${extraAfter[@]}; do - echo " $i" >&2 - done -fi - -if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then - source "$NIX_GCC_WRAPPER_EXEC_HOOK" -fi - - -# Call the real `gcc'. Filter out warnings from stderr about unused -# `-B' flags, since they confuse some programs. Deep bash magic to -# apply grep to stderr (by swapping stdin/stderr twice). -if test -z "$NIX_GCC_NEEDS_GREP"; then - @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} -else - (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ - | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- - exit $? -fi diff --git a/pkgs/build-support/gcc-wrapper2/ld-wrapper.sh b/pkgs/build-support/gcc-wrapper2/ld-wrapper.sh deleted file mode 100644 index 52aa57bc1ea7..000000000000 --- a/pkgs/build-support/gcc-wrapper2/ld-wrapper.sh +++ /dev/null @@ -1,155 +0,0 @@ -#! @shell@ -e - -if test -n "$NIX_LD_WRAPPER_START_HOOK"; then - source "$NIX_LD_WRAPPER_START_HOOK" -fi - -if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then - source @out@/nix-support/add-flags.sh -fi - -source @out@/nix-support/utils.sh - - -# Optionally filter out paths not refering to the store. -params=("$@") -if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \ - -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then - rest=() - n=0 - while test $n -lt ${#params[*]}; do - p=${params[n]} - p2=${params[$((n+1))]} - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then - skip $p - elif test "$p" = "-L" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "$p" = "-rpath" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "$p" = "-dynamic-linker" && badPath "$p2"; then - n=$((n + 1)); skip $p2 - elif test "${p:0:1}" = "/" && badPath "$p"; then - # We cannot skip this; barf. - echo "impure path \`$p' used in link" >&2 - exit 1 - else - rest=("${rest[@]}" "$p") - fi - n=$((n + 1)) - done - params=("${rest[@]}") -fi - - -extra=() -extraBefore=() - -if test -z "$NIX_LDFLAGS_SET"; then - extra=(${extra[@]} $NIX_LDFLAGS) - extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE) -fi - - -# Add all used dynamic libraries to the rpath. -if test "$NIX_DONT_SET_RPATH" != "1"; then - - # First, find all -L... switches. - allParams=("${params[@]}" ${extra[@]}) - libPath="" - addToLibPath() { - local path="$1" - if test "${path:0:1}" != "/"; then return 0; fi - case "$path" in - *..*|*./*|*/.*|*//*) - local path2 - if path2=$(readlink -f "$path"); then - path="$path2" - fi - ;; - esac - case $libPath in - *\ $path\ *) return 0 ;; - esac - libPath="$libPath $path " - } - n=0 - while test $n -lt ${#allParams[*]}; do - p=${allParams[n]} - p2=${allParams[$((n+1))]} - if test "${p:0:3}" = "-L/"; then - addToLibPath ${p:2} - elif test "$p" = "-L"; then - addToLibPath ${p2} - n=$((n + 1)) - elif $(echo "$p" | grep -q '\.so\($\|\.\)'); then - path="$(dirname "$p")"; - addToLibPath "${path}" - fi - n=$((n + 1)) - done - - # Second, for each directory in the library search path (-L...), - # see if it contains a dynamic library used by a -l... flag. If - # so, add the directory to the rpath. - rpath="" - - addToRPath() { - # If the path is not in the store, don't add it to the rpath. - # This typically happens for libraries in /tmp that are later - # copied to $out/lib. If not, we're screwed. - if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi - case $rpath in - *\ $1\ *) return 0 ;; - esac - rpath="$rpath $1 " - } - - for i in $libPath; do - n=0 - while test $n -lt ${#allParams[*]}; do - p=${allParams[n]} - p2=${allParams[$((n+1))]} - if test "${p:0:2}" = "-l" -a -f "$i/lib${p:2}.so"; then - addToRPath $i - break - elif test "$p" = "-l" -a -f "$i/lib${p2}"; then - # I haven't seen `-l foo', but you never know... - addToRPath $i - break - elif $(echo "$p" | grep -q '\.so\($\|\.\)'); then - path="$(dirname "$p")"; - if test "$path" == "$i"; then - addToRPath $i - break; - fi - fi - n=$((n + 1)) - done - - done - - - # Finally, add `-rpath' switches. - for i in $rpath; do - extra=(${extra[@]} -rpath $i) - done -fi - - -# Optionally print debug info. -if test "$NIX_DEBUG" = "1"; then - echo "original flags to @ld@:" >&2 - for i in "${params[@]}"; do - echo " $i" >&2 - done - echo "extra flags to @ld@:" >&2 - for i in ${extra[@]}; do - echo " $i" >&2 - done -fi - -if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then - source "$NIX_LD_WRAPPER_EXEC_HOOK" -fi - -exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]} diff --git a/pkgs/build-support/gcc-wrapper2/setup-hook.sh b/pkgs/build-support/gcc-wrapper2/setup-hook.sh deleted file mode 100644 index 76167df3c31c..000000000000 --- a/pkgs/build-support/gcc-wrapper2/setup-hook.sh +++ /dev/null @@ -1,29 +0,0 @@ -addCVars () { - if test -d $1/include; then - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include" - fi - - if test -d $1/lib64; then - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64" - fi - - if test -d $1/lib; then - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" - fi -} - -envHooks=(${envHooks[@]} addCVars) - -# Note: these come *after* $out in the PATH (see setup.sh). - -if test -n "@gcc@"; then - addToSearchPath PATH @gcc@/bin -fi - -if test -n "@binutils@"; then - addToSearchPath PATH @binutils@/bin -fi - -if test -n "@libc@"; then - addToSearchPath PATH @libc@/bin -fi diff --git a/pkgs/build-support/gcc-wrapper2/utils.sh b/pkgs/build-support/gcc-wrapper2/utils.sh deleted file mode 100644 index 9a664e1d1e6b..000000000000 --- a/pkgs/build-support/gcc-wrapper2/utils.sh +++ /dev/null @@ -1,23 +0,0 @@ -skip () { - if test "$NIX_DEBUG" = "1"; then - echo "skipping impure path $1" >&2 - fi -} - - -# Checks whether a path is impure. E.g., `/lib/foo.so' is impure, but -# `/nix/store/.../lib/foo.so' isn't. -badPath() { - local p=$1 - - # Relative paths are okay (since they're presumably relative to - # the temporary build directory). - if test "${p:0:1}" != "/"; then return 1; fi - - # Otherwise, the path should refer to the store or some temporary - # directory (including the build directory). - test \ - "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \ - "${p:0:4}" != "/tmp" -a \ - "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP" -} diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix index b62ed9840456..962685776962 100644 --- a/pkgs/build-support/kernel/make-initrd.nix +++ b/pkgs/build-support/kernel/make-initrd.nix @@ -12,12 +12,15 @@ # `contents = {object = ...; symlink = /init;}' is a typical # argument. -{stdenv, perl, cpio, contents}: +{stdenv, perl, cpio, contents, platform}: stdenv.mkDerivation { name = "initrd"; builder = ./make-initrd.sh; - buildInputs = [perl cpio]; + buildInputs = [perl cpio] + ++ stdenv.lib.optional (platform.uboot != null) [ platform.uboot ]; + + makeUInitrd = if (platform.uboot != null) then true else false; # !!! should use XML. objects = map (x: x.object) contents; diff --git a/pkgs/build-support/kernel/make-initrd.sh b/pkgs/build-support/kernel/make-initrd.sh index d930e51a03f9..69931bad113c 100644 --- a/pkgs/build-support/kernel/make-initrd.sh +++ b/pkgs/build-support/kernel/make-initrd.sh @@ -37,3 +37,8 @@ storePaths=$(perl $pathsFromGraph closure-*) # Put the closure in a gzipped cpio archive. ensureDir $out (cd root && find * -print0 | cpio -ov -H newc --null | gzip -9 > $out/initrd) + +if [ -n "$makeUInitrd" ]; then + mv $out/initrd $out/initrd.gz + mkimage -A arm -O linux -T ramdisk -C gzip -d $out/initrd.gz $out/initrd +fi diff --git a/pkgs/build-support/kernel/modules-closure.sh b/pkgs/build-support/kernel/modules-closure.sh index e75ef927baae..af1faa7708ce 100644 --- a/pkgs/build-support/kernel/modules-closure.sh +++ b/pkgs/build-support/kernel/modules-closure.sh @@ -22,7 +22,7 @@ for module in $rootModules; do done echo "closure:" -ensureDir $out +ensureDir $out/lib/modules/"$version" for module in $closure; do target=$(echo $module | sed "s^/nix/store/.*/lib/modules/^$out/lib/modules/^") if test -e "$target"; then continue; fi diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 93c35cd98b9e..7870f987fafa 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -5,7 +5,7 @@ with pkgs; rec { - inherit (kernelPackages_2_6_32) kernel; + inherit (linuxPackages_2_6_32) kernel; klibcShrunk = pkgs.klibcShrunk.override { klibc = klibc_15; }; diff --git a/pkgs/desktops/kde-4.3/admin/default.nix b/pkgs/desktops/kde-4.3/admin/default.nix index 71282a23721b..5dd8d30bb215 100644 --- a/pkgs/desktops/kde-4.3/admin/default.nix +++ b/pkgs/desktops/kde-4.3/admin/default.nix @@ -1,19 +1,26 @@ { stdenv, fetchurl, lib, cmake, qt4, pkgconfig, perl, python -, sip, pyqt4, pycups, system_config_printer, rhpl +, sip, pyqt4, pycups, system_config_printer , kdelibs, kdepimlibs, kdebindings, automoc4, phonon}: stdenv.mkDerivation { name = "kdeadmin-4.3.4"; + src = fetchurl { url = mirror://kde/stable/4.3.4/src/kdeadmin-4.3.4.tar.bz2; sha1 = "8f61aeb2ff9d51712d72cd77dad837c8902b6a5d"; }; + builder = ./builder.sh; + inherit system_config_printer; + includeAllQtDirs=true; + CMAKE_PREFIX_PATH=kdepimlibs; - buildInputs = [ cmake qt4 pkgconfig perl python sip pyqt4 pycups system_config_printer rhpl + + buildInputs = [ cmake qt4 pkgconfig perl python sip pyqt4 pycups system_config_printer kdelibs kdepimlibs kdebindings automoc4 phonon ]; + meta = { description = "KDE Administration Utilities"; license = "GPL"; diff --git a/pkgs/desktops/kde-4.3/default.nix b/pkgs/desktops/kde-4.3/default.nix index 48ba9fc65a32..9fa61fa4881a 100644 --- a/pkgs/desktops/kde-4.3/default.nix +++ b/pkgs/desktops/kde-4.3/default.nix @@ -102,7 +102,7 @@ pkgs.recurseIntoAttrs (rec { }; kdeadmin = import ./admin { - inherit (pkgs) stdenv fetchurl lib cmake qt4 pkgconfig perl python sip pyqt4 pycups system_config_printer rhpl; + inherit (pkgs) stdenv fetchurl lib cmake qt4 pkgconfig perl python sip pyqt4 pycups system_config_printer; inherit kdelibs kdepimlibs kdebindings; inherit automoc4 phonon; }; @@ -185,7 +185,7 @@ pkgs.recurseIntoAttrs (rec { }; kdeutils = import ./utils { - inherit (pkgs) stdenv fetchurl lib cmake qt4 perl python gmp libzip libarchive xz sip pyqt4 pycups system_config_printer rhpl; + inherit (pkgs) stdenv fetchurl lib cmake qt4 perl python gmp libzip libarchive xz sip pyqt4 pycups system_config_printer; inherit kdelibs kdelibs_experimental kdepimlibs kdebase kdebindings; inherit automoc4 phonon qimageblitz qca2; }; diff --git a/pkgs/desktops/kde-4.3/utils/default.nix b/pkgs/desktops/kde-4.3/utils/default.nix index 005a3e3cdba3..ced47d57b4a4 100644 --- a/pkgs/desktops/kde-4.3/utils/default.nix +++ b/pkgs/desktops/kde-4.3/utils/default.nix @@ -1,19 +1,26 @@ { stdenv, fetchurl, lib, cmake, qt4, perl, gmp, python, libzip, libarchive, xz -, sip, pyqt4, pycups, system_config_printer, rhpl +, sip, pyqt4, pycups, system_config_printer , kdelibs, kdelibs_experimental, kdepimlibs, kdebase, kdebindings, automoc4, phonon, qimageblitz, qca2}: stdenv.mkDerivation { name = "kdeutils-4.3.4"; + src = fetchurl { url = mirror://kde/stable/4.3.4/src/kdeutils-4.3.4.tar.bz2; sha1 = "2d5e26055e364af2df7459cdbc3aebdc3a8abdea"; }; + builder = ./builder.sh; + inherit system_config_printer; + includeAllQtDirs=true; + CMAKE_PREFIX_PATH=kdepimlibs; - buildInputs = [ cmake qt4 perl gmp python libzip libarchive xz sip pyqt4 pycups system_config_printer rhpl + + buildInputs = [ cmake qt4 perl gmp python libzip libarchive xz sip pyqt4 pycups system_config_printer kdelibs kdelibs_experimental kdepimlibs kdebase kdebindings automoc4 phonon qimageblitz qca2 ]; + meta = { description = "KDE Utilities"; license = "GPL"; diff --git a/pkgs/development/compilers/gcc-4.3/builder.sh b/pkgs/development/compilers/gcc-4.3/builder.sh index 2bc011e3e6e1..aaf0c54d99bf 100644 --- a/pkgs/development/compilers/gcc-4.3/builder.sh +++ b/pkgs/development/compilers/gcc-4.3/builder.sh @@ -31,6 +31,7 @@ if test "$noSysDirs" = "1"; then export NIX_FIXINC_DUMMY=/usr/include fi + extraCFlags="-g0 -I$gmp/include -I$mpfr/include $extraCFlags" extraLDFlags="--strip-debug $extraLDFlags" @@ -39,17 +40,56 @@ if test "$noSysDirs" = "1"; then export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i" done - makeFlagsArray=( \ - "${makeFlagsArray[@]}" \ - NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - LIMITS_H_TEST=true \ - X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \ - LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \ - LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \ - ) + if test -n "$targetConfig"; then + if test -z "$crossStageStatic"; then + extraXCFlags="-B${libcCross}/lib -idirafter ${libcCross}/include" + extraXLDFlags="-L${libcCross}/lib" + export NIX_EXTRA_CFLAGS_TARGET=$extraXCFlags + for i in $extraXLDFlags; do + export NIX_EXTRA_LDFLAGS_TARGET="$NIX_EXTRA_LDFLAGS_TARGET -Wl,$i" + done + fi + + makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ + NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ + SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ + CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \ + LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \ + ) + else + export NIX_EXTRA_CFLAGS_TARGET=$NIX_EXTRA_CFLAGS + export NIX_EXTRA_LDFLAGS_TARGET=$NIX_EXTRA_LDFLAGS + makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ + NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ + SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ + CFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \ + CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \ + LDFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \ + LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \ + ) + fi + + if test -n "$targetConfig" -a "$crossStageStatic" == 1; then + # We don't want the gcc build to assume there will be a libc providing + # limits.h in this stagae + makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ + LIMITS_H_TEST=false \ + ) + else + makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ + LIMITS_H_TEST=true \ + ) + fi fi +if test -n "$targetConfig"; then + # The host strip will destroy everything in the target binaries otherwise + dontStrip=1 +fi preConfigure() { # Perform the build in a different directory. @@ -84,13 +124,21 @@ postInstall() { ln -sfn g++ $i fi done + + eval "$postInstallGhdl" } -if test -z "$profiledCompiler"; then - buildFlags="bootstrap $buildFlags" -else - buildFlags="profiledbootstrap $buildFlags" +if test -z "$targetConfig"; then + if test -z "$profiledCompiler"; then + buildFlags="bootstrap $buildFlags" + else + buildFlags="profiledbootstrap $buildFlags" + fi +else +: +# buildFlags="all-gcc all-target-libgcc $buildFlags" +# installTargets="install-gcc install-target-libgcc" fi genericBuild diff --git a/pkgs/development/compilers/gcc-4.3/default.nix b/pkgs/development/compilers/gcc-4.3/default.nix index aad9f8207446..73caa156bd01 100644 --- a/pkgs/development/compilers/gcc-4.3/default.nix +++ b/pkgs/development/compilers/gcc-4.3/default.nix @@ -1,61 +1,102 @@ { stdenv, fetchurl, noSysDirs , langC ? true, langCC ? true, langFortran ? false, langTreelang ? false , langJava ? false +, langVhdl ? false , profiledCompiler ? false , staticCompiler ? false +, enableShared ? true , texinfo ? null , gmp, mpfr , bison ? null, flex ? null , zlib ? null, boehmgc ? null , enableMultilib ? false , name ? "gcc" +, cross ? null +, binutilsCross ? null +, libcCross ? null +, crossStageStatic ? true +, gnat ? null }: assert langTreelang -> bison != null && flex != null; +assert cross != null -> profiledCompiler == false && enableMultilib == true; +assert (cross != null && crossStageStatic) -> (langCC == false && langFortran +== false && langTreelang == false); + +assert langVhdl -> gnat != null; + with stdenv.lib; -let version = "4.3.3"; in +let + version = "4.3.4"; + + crossConfigureFlags = + "--target=${cross.config}" + + (if crossStageStatic then + " --disable-libssp --disable-nls" + + " --without-headers" + + " --disable-threads " + + " --disable-libmudflap " + + " --disable-libgomp " + + " --disable-shared" + else + " --with-headers=${libcCross}/include" + + " --enable-__cxa_atexit" + + " --enable-long-long" + + " --enable-threads=posix" + + " --enable-nls" + ); + stageNameAddon = if (crossStageStatic) then "-stage-static" else + "-stage-final"; + crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else ""; +in stdenv.mkDerivation ({ - name = "${name}-${version}"; + name = "${name}-${version}" + crossNameAddon; builder = ./builder.sh; src = optional /*langC*/ true (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2"; - sha256 = "08yksvipnqmqbmif30rwjkg3y0m6ray5r84wa2argv8q0bpz9426"; + sha256 = "1yk80nwyw8vkpw8d3x7lkg3zrv3ngjqlvj0i8zslzgj7a27q729i"; }) ++ optional langCC (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2"; - sha256 = "12z2zh03yq214qs2cqzh8c64jjfz544nk1lzi9rygjwm8yjsvzm9"; + sha256 = "0d8pyk5c9zmph25f4fl63vd8vhljj6ildbxpz2hr594g5i6pplpq"; }) ++ optional langFortran (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2"; - sha256 = "1b2wbysviyh7l9fqbd6zy5y6y89xgysy99gr8wx8xkc1hy2nwdsq"; + sha256 = "1xf2njykv1qcgxiqwj693dxjf77ss1rcxirylvnsp5hs89mdlj12"; }) ++ optional langJava (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2"; - sha256 = "1mlazpydd9qv7zwxkbb5sw3clfawfndhcc3f5lzycminvn6qmfkb"; + sha256 = "1v3krhxi3zyaqfj0x8dbxvg67fjp29cr1psyf71r9zf757p3vqsw"; }); patches = - [./pass-cxxcpp.patch] + [./pass-cxxcpp.patch ./libmudflap-cpp.patch] ++ optional noSysDirs ./no-sys-dirs.patch ++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch - ++ optional langJava ./java-jvgenmain-link.patch; + ++ optional langJava ./java-jvgenmain-link.patch + ++ optional langVhdl ./ghdl-ortho-cflags.patch; - inherit noSysDirs profiledCompiler staticCompiler; + inherit noSysDirs profiledCompiler staticCompiler crossStageStatic + binutilsCross libcCross; + targetConfig = if (cross != null) then cross.config else null; buildInputs = [texinfo gmp mpfr] ++ (optionals langTreelang [bison flex]) ++ (optional (zlib != null) zlib) ++ (optional (boehmgc != null) boehmgc) + ++ (optionals (cross != null) [binutilsCross]) + ++ (optionals langVhdl [gnat]) ; configureFlags = " ${if enableMultilib then "" else "--disable-multilib"} + ${if enableShared then "" else "--disable-shared"} --disable-libstdcxx-pch --with-system-zlib --enable-languages=${ @@ -65,27 +106,73 @@ stdenv.mkDerivation ({ ++ optional langFortran "fortran" ++ optional langJava "java" ++ optional langTreelang "treelang" + ++ optional langVhdl "vhdl" ) ) } ${if stdenv.isi686 then "--with-arch=i686" else ""} + ${if cross != null then crossConfigureFlags else ""} "; + #Above I added a hack on making the build different than the host. + + # Needed for the cross compilation to work + AR = "ar"; + LD = "ld"; + CC = "gcc"; NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else ""; inherit gmp mpfr; - passthru = { inherit langC langCC langFortran langTreelang enableMultilib; }; + passthru = { inherit langC langCC langFortran langVhdl langTreelang + enableMultilib; }; meta = { homepage = "http://gcc.gnu.org/"; license = "GPL/LGPL"; description = "GNU Compiler Collection, 4.3.x"; + maintainers = with stdenv.lib.maintainers; [viric ludo]; + platforms = with stdenv.lib.platforms; linux; }; + } // (if langJava then { postConfigure = '' make configure-gcc sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${zlib}/include@ ; s@^LDFLAGS = .*@& -L${zlib}/lib@' sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${boehmgc}/include@ ; s@^LDFLAGS = .*@& -L${boehmgc}/lib -lgc@' ''; +} else {}) +// (if langVhdl then rec { + name = "ghdl-0.29"; + + ghdlSrc = fetchurl { + url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2"; + sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva"; + }; + + # Ghdl has some timestamps checks, storing file timestamps in '.cf' files. + # As we will change the timestamps to 1970-01-01 00:00:01, we also set the + # content of that .cf to that value. This way ghdl does not complain on + # the installed object files from the basic libraries (ieee, ...) + postInstallGhdl = '' + pushd $out + find . -name "*.cf" -exec \ + sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \; + popd + ''; + + postUnpack = '' + tar xvf ${ghdlSrc} + mv ghdl-*/vhdl gcc*/gcc + rm -Rf ghdl-* + ''; + + meta = { + homepage = "http://ghdl.free.fr/"; + license = "GPLv2+"; + description = "Complete VHDL simulator, using the GCC technology"; + maintainers = with stdenv.lib.maintainers; [viric]; + platforms = with stdenv.lib.platforms; linux; + }; + } else {})) diff --git a/pkgs/development/compilers/gcc-4.3/ghdl-ortho-cflags.patch b/pkgs/development/compilers/gcc-4.3/ghdl-ortho-cflags.patch new file mode 100644 index 000000000000..14188083f761 --- /dev/null +++ b/pkgs/development/compilers/gcc-4.3/ghdl-ortho-cflags.patch @@ -0,0 +1,36 @@ +diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in +index 8f481df..681ac59 100644 +--- a/gcc/vhdl/Make-lang.in ++++ b/gcc/vhdl/Make-lang.in +@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../ + AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \ + -I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \ + -I$(AGCC_GCCSRC_DIR)/libcpp/include +-AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) ++AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS) + + AGCC_LOCAL_OBJS=ortho-lang.o + +@@ -140,7 +140,7 @@ ghdl$(exeext): force + + # Ghdl libraries. + ghdllib: ghdl$(exeext) $(GCC_PASSES) force +- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib ++ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib + + # Build hooks: + +diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in +index d754c6c..07abc4a 100644 +--- a/gcc/vhdl/Makefile.in ++++ b/gcc/vhdl/Makefile.in +@@ -80,7 +80,8 @@ T_CPPFLAGS = + X_ADAFLAGS = + T_ADAFLAGS = + +-ADAC = $(CC) ++# Never use the bootstrapped compiler, as it may not be built for ada ++ADAC = gcc + + ECHO = echo + CHMOD = chmod diff --git a/pkgs/development/compilers/gcc-4.3/libmudflap-cpp.patch b/pkgs/development/compilers/gcc-4.3/libmudflap-cpp.patch new file mode 100644 index 000000000000..09dfb26b20db --- /dev/null +++ b/pkgs/development/compilers/gcc-4.3/libmudflap-cpp.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.in b/Makefile.in +index d24c1af..b86e522 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -230,6 +229,7 @@ RAW_CXX_TARGET_EXPORTS = \ + + NORMAL_TARGET_EXPORTS = \ + $(BASE_TARGET_EXPORTS) \ ++ CPP="$(CC_FOR_TARGET) -E"; export CPP; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; + + # Where to find GMP diff --git a/pkgs/development/compilers/gcc-4.3/no-sys-dirs.patch b/pkgs/development/compilers/gcc-4.3/no-sys-dirs.patch index 4d843891a03c..69fa2c7de828 100644 --- a/pkgs/development/compilers/gcc-4.3/no-sys-dirs.patch +++ b/pkgs/development/compilers/gcc-4.3/no-sys-dirs.patch @@ -74,7 +74,7 @@ diff -ru gcc-4.3.1-orig/libgomp/configure gcc-4.3.1/libgomp/configure +# Ugly hack to get libmudflap (and possibly other libraries) to build. +# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag +# to Glibc gets lost. Here we forcibly add it to any invocation. -+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" ++CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" + # Is the compiler the GNU compiler? with_gcc=$GCC @@ -90,7 +90,7 @@ diff -ru gcc-4.3.1-orig/libmudflap/configure gcc-4.3.1/libmudflap/configure +# Ugly hack to get libmudflap (and possibly other libraries) to build. +# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag +# to Glibc gets lost. Here we forcibly add it to any invocation. -+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" ++CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" + # Is the compiler the GNU compiler? with_gcc=$GCC @@ -106,7 +106,7 @@ diff -ru gcc-4.3.1-orig/libssp/configure gcc-4.3.1/libssp/configure +# Ugly hack to get libmudflap (and possibly other libraries) to build. +# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag +# to Glibc gets lost. Here we forcibly add it to any invocation. -+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" ++CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" + # Is the compiler the GNU compiler? with_gcc=$GCC @@ -120,10 +120,10 @@ diff -ru gcc-4.3.1-orig/Makefile.in gcc-4.3.1/Makefile.in ### +CFLAGS += $(NIX_EXTRA_CFLAGS) -+CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS) ++CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS_TARGET) +CXXFLAGS += $(NIX_EXTRA_CFLAGS) +LDFLAGS += $(NIX_EXTRA_LDFLAGS) -+LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS) ++LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS_TARGET) +BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS) +BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS) + diff --git a/pkgs/development/compilers/gcc-4.4/builder.sh b/pkgs/development/compilers/gcc-4.4/builder.sh index 184bee74655d..b9724e7ad50e 100644 --- a/pkgs/development/compilers/gcc-4.4/builder.sh +++ b/pkgs/development/compilers/gcc-4.4/builder.sh @@ -21,7 +21,7 @@ if test "$noSysDirs" = "1"; then # Figure out what extra flags to pass to the gcc compilers # being generated to make sure that they use our glibc. - extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)" + extraFlags="$(cat $NIX_GCC/nix-support/libc-cflags)" extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)" # Use *real* header files, otherwise a limits.h is generated @@ -29,48 +29,100 @@ if test "$noSysDirs" = "1"; then # SSIZE_MAX, which breaks the build). export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include - # The path to the Glibc binaries such as `crti.o'. - glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib" + # The path to the Glibc binaries such as `crti.o'. + glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib" else # Hack: support impure environments. - extraCFlags="-isystem /usr/include" + extraFlags="-isystem /usr/include" extraLDFlags="-L/usr/lib64 -L/usr/lib" - glibc_libdir="/usr/lib" + glibc_libdir="/usr/lib" export NIX_FIXINC_DUMMY=/usr/include fi - # Setting $CPATH makes sure both `gcc' and `xgcc' find the C - # library headers, regarless of the language being compiled. - export CPATH="$NIX_FIXINC_DUMMY${CPATH:+:}$CPATH" - - # Likewise, to help it find `crti.o' and similar files. - export LIBRARY_PATH="$glibc_libdir${LIBRARY_PATH:+:}$LIBRARY_PATH" - - echo "setting \$CPATH to \`$CPATH'" - echo "setting \$LIBRARY_PATH to \`$LIBRARY_PATH'" - - - extraCFlags="-g0 $extraCFlags" - extraLDFlags="--strip-debug $extraLDFlags" + extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags" + extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + EXTRA_FLAGS="$extraFlags" for i in $extraLDFlags; do - export EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i" done + if test -n "$targetConfig"; then + # Cross-compiling, we need gcc not to read ./specs in order to build + # the g++ compiler (after the specs for the cross-gcc are created). + # Having LIBRARY_PATH= makes gcc read the specs from ., and the build + # breaks. Having this variable comes from the default.nix code to bring + # gcj in. + unset LIBRARY_PATH + unset CPATH + if test -z "$crossStageStatic"; then + EXTRA_FLAGS_TARGET="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include" + EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib" + fi + else + EXTRA_FLAGS_TARGET="$EXTRA_FLAGS" + EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS" + fi + + # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find + # the startfiles. + # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx + # for the startfiles. makeFlagsArray=( \ "${makeFlagsArray[@]}" \ NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - LIMITS_H_TEST=true \ - X_CFLAGS="$extraCflags $EXTRA_LDFLAGS" \ - LDFLAGS="$extraCflags $EXTRA_LDFLAGS" \ - LDFLAGS_FOR_TARGET="$extraCflags $EXTRA_LDFLAGS" \ + CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ + CFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \ + FLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \ + LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ + LDFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \ ) + + if test -z "$targetConfig"; then + makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ + BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ + BOOT_LDFLAGS="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \ + ) + fi + + if test -n "$targetConfig" -a "$crossStageStatic" == 1; then + # We don't want the gcc build to assume there will be a libc providing + # limits.h in this stagae + makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ + LIMITS_H_TEST=false \ + ) + else + makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ + LIMITS_H_TEST=true \ + ) + fi fi +if test -n "$targetConfig"; then + # The host strip will destroy some important details of the objects + dontStrip=1 +fi preConfigure() { + if test -n "$newlibSrc"; then + tar xvf "$newlibSrc" -C .. + ln -s ../newlib-*/newlib newlib + # Patch to get armvt5el working: + sed -i -e 's/ arm)/ arm*)/' newlib/configure.host + fi + # Bug - they packaged zlib + if test -d "zlib"; then + # This breaks the build without-headers, which should build only + # the target libgcc as target libraries. + # See 'configure:5370' + rm -Rf zlib + fi + # Perform the build in a different directory. mkdir ../build cd ../build @@ -103,13 +155,17 @@ postInstall() { ln -sfn g++ $i fi done + + eval "$postInstallGhdl" } -if test -z "$profiledCompiler"; then - buildFlags="bootstrap $buildFlags" -else - buildFlags="profiledbootstrap $buildFlags" +if test -z "$targetConfig"; then + if test -z "$profiledCompiler"; then + buildFlags="bootstrap $buildFlags" + else + buildFlags="profiledbootstrap $buildFlags" + fi fi genericBuild diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix index 40dd6f49f767..86ac3c189c61 100644 --- a/pkgs/development/compilers/gcc-4.4/default.nix +++ b/pkgs/development/compilers/gcc-4.4/default.nix @@ -1,8 +1,11 @@ { stdenv, fetchurl, noSysDirs , langC ? true, langCC ? true, langFortran ? false, langTreelang ? false , langJava ? false +, langAda ? false +, langVhdl ? false , profiledCompiler ? false , staticCompiler ? false +, enableShared ? true , texinfo ? null , gmp, mpfr, gettext, which , ppl ? null, cloogppl ? null # used by the Graphite optimization framework @@ -12,17 +15,25 @@ , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null +, gnatboot ? null , enableMultilib ? false , name ? "gcc" +, cross ? null +, binutilsCross ? null +, libcCross ? null +, crossStageStatic ? true +, gnat ? null }: assert langTreelang -> bison != null && flex != null; assert langJava -> zip != null && unzip != null && zlib != null && boehmgc != null; +assert langAda -> gnatboot != null; +assert langVhdl -> gnat != null; with stdenv.lib; -let version = "4.4.2"; +let version = "4.4.3"; javaEcj = fetchurl { # The `$(top_srcdir)/ecj.jar' file is automatically picked up at # `configure' time. @@ -46,26 +57,60 @@ let version = "4.4.2"; javaAwtGtk = langJava && gtk != null; + crossConfigureFlags = + "--target=${cross.config}" + + (if crossStageStatic then + " --disable-libssp --disable-nls" + + " --without-headers" + + " --disable-threads " + + " --disable-libmudflap " + + " --disable-libgomp " + + " --disable-shared" + else + " --with-headers=${libcCross}/include" + + " --enable-__cxa_atexit" + + " --enable-long-long" + + " --enable-threads=posix" + + " --enable-nls" + ); + stageNameAddon = if (crossStageStatic) then "-stage-static" else + "-stage-final"; + crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else ""; + in # We need all these X libraries when building AWT with GTK+. assert gtk != null -> (filter (x: x == null) xlibs) == []; stdenv.mkDerivation ({ - name = "${name}-${version}"; + name = "${name}-${version}" + crossNameAddon; builder = ./builder.sh; src = (import ./sources.nix) { inherit fetchurl optional version; - inherit langC langCC langFortran langJava; + inherit langC langCC langFortran langJava langAda; }; patches = - [./pass-cxxcpp.patch] - ++ optional noSysDirs ./no-sys-dirs.patch; + [./pass-cxxcpp.patch - inherit noSysDirs profiledCompiler staticCompiler langJava; + # libmudflap and libstdc++ receive the build CPP, + # and not the target. + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42279 + ./target-cpp.patch + + # Bad mixture of build/target flags + ./libstdc++-target.patch + ] + ++ optional noSysDirs ./no-sys-dirs.patch + # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its + # target libraries and tools. + ++ optional langAda ./gnat-cflags.patch + ++ optional langVhdl ./ghdl-ortho-cflags.patch; + + inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic + libcCross; buildInputs = [ texinfo gmp mpfr gettext which ] ++ (optional (ppl != null) ppl) @@ -75,10 +120,14 @@ stdenv.mkDerivation ({ ++ (optional (boehmgc != null) boehmgc) ++ (optionals langJava [zip unzip]) ++ (optionals javaAwtGtk [gtk pkgconfig libart_lgpl] ++ xlibs) + ++ (optionals (cross != null) [binutilsCross]) + ++ (optionals langAda [gnatboot]) + ++ (optionals langVhdl [gnat]) ; configureFlags = " ${if enableMultilib then "" else "--disable-multilib"} + ${if enableShared then "" else "--disable-shared"} ${if ppl != null then "--with-ppl=${ppl}" else ""} ${if cloogppl != null then "--with-cloog=${cloogppl}" else ""} ${if langJava then "--with-ecj-jar=${javaEcj}" else ""} @@ -96,12 +145,23 @@ stdenv.mkDerivation ({ ++ optional langFortran "fortran" ++ optional langJava "java" ++ optional langTreelang "treelang" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" ) ) } - ${if stdenv.isi686 then "--with-arch=i686" else ""} + ${if langAda then " --enable-libada" else ""} + ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} + ${if cross != null then crossConfigureFlags else ""} "; + targetConfig = if (cross != null) then cross.config else null; + + # Needed for the cross compilation to work + AR = "ar"; + LD = "ld"; + CC = "gcc"; + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find # the library headers and binaries, regarless of the language being # compiled. @@ -124,7 +184,8 @@ stdenv.mkDerivation ({ ++ optionals javaAwtGtk [ gmp mpfr ]))); - passthru = { inherit langC langCC langFortran langTreelang enableMultilib; }; + passthru = { inherit langC langCC langAda langFortran langTreelang langVhdl + enableMultilib; }; meta = { homepage = http://gcc.gnu.org/; @@ -143,9 +204,44 @@ stdenv.mkDerivation ({ maintainers = [ # Add your name here! stdenv.lib.maintainers.ludo + stdenv.lib.maintainers.viric ]; # Volunteers needed for the {Cyg,Dar}win ports. platforms = stdenv.lib.platforms.linux; }; -}) +} +// (if langVhdl then rec { + name = "ghdl-0.29"; + + ghdlSrc = fetchurl { + url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2"; + sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva"; + }; + + # Ghdl has some timestamps checks, storing file timestamps in '.cf' files. + # As we will change the timestamps to 1970-01-01 00:00:01, we also set the + # content of that .cf to that value. This way ghdl does not complain on + # the installed object files from the basic libraries (ieee, ...) + postInstallGhdl = '' + pushd $out + find . -name "*.cf" -exec \ + sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \; + popd + ''; + + postUnpack = '' + tar xvf ${ghdlSrc} + mv ghdl-*/vhdl gcc*/gcc + rm -Rf ghdl-* + ''; + + meta = { + homepage = "http://ghdl.free.fr/"; + license = "GPLv2+"; + description = "Complete VHDL simulator, using the GCC technology (gcc ${version})"; + maintainers = with stdenv.lib.maintainers; [viric]; + platforms = with stdenv.lib.platforms; linux; + }; + +} else {})) diff --git a/pkgs/development/compilers/gcc-4.4/ghdl-ortho-cflags.patch b/pkgs/development/compilers/gcc-4.4/ghdl-ortho-cflags.patch new file mode 100644 index 000000000000..901534591c8f --- /dev/null +++ b/pkgs/development/compilers/gcc-4.4/ghdl-ortho-cflags.patch @@ -0,0 +1,111 @@ +diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in +index 8f481df..681ac59 100644 +--- a/gcc/vhdl/Make-lang.in ++++ b/gcc/vhdl/Make-lang.in +@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../ + AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \ + -I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \ + -I$(AGCC_GCCSRC_DIR)/libcpp/include +-AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) ++AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS) $(INCLUDES) + + AGCC_LOCAL_OBJS=ortho-lang.o + +@@ -140,7 +140,7 @@ ghdl$(exeext): force + + # Ghdl libraries. + ghdllib: ghdl$(exeext) $(GCC_PASSES) force +- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib ++ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib + + # Build hooks: + +diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in +index d754c6c..07abc4a 100644 +--- a/gcc/vhdl/Makefile.in ++++ b/gcc/vhdl/Makefile.in +@@ -80,7 +80,8 @@ T_CPPFLAGS = + X_ADAFLAGS = + T_ADAFLAGS = + +-ADAC = $(CC) ++# Never use the bootstrapped compiler, as it may not be built for ada ++ADAC = gcc + + ECHO = echo + CHMOD = chmod +diff --git a/gcc/vhdl/ortho-lang.c b/gcc/vhdl/ortho-lang.c +index 84aeb92..8eddd42 100644 +--- a/gcc/vhdl/ortho-lang.c ++++ b/gcc/vhdl/ortho-lang.c +@@ -16,6 +16,7 @@ + #include "options.h" + #include "real.h" +-#include "tree-gimple.h" ++#include "gimple.h" ++#include "tree.h" + #include "function.h" + #include "cgraph.h" + #include "target.h" +@@ -680,38 +681,10 @@ type_for_mode (enum machine_mode mode, int unsignedp) + + const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; + +-/* Tree code classes. */ +- +-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, +- +-const enum tree_code_class tree_code_type[] = { +-#include "tree.def" +- 'x' +-}; +-#undef DEFTREECODE +- +-/* Table indexed by tree code giving number of expression +- operands beyond the fixed part of the node structure. +- Not used for types or decls. */ +- +-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH, +- +-const unsigned char tree_code_length[] = { +-#include "tree.def" +- 0 +-}; +-#undef DEFTREECODE +- +-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) NAME, +-const char * const tree_code_name[] = { +-#include "tree.def" +- "@@dummy" +-}; +-#undef DEFTREECODE + + union lang_tree_node + GTY((desc ("0"), +- chain_next ("(union lang_tree_node *) GENERIC_NEXT (&%h.generic)"))) ++ chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)"))) + { + union tree_node GTY ((tag ("0"))) generic; + }; +@@ -1162,7 +1135,7 @@ new_access_type (tree dtype) + res = make_node (POINTER_TYPE); + TREE_TYPE (res) = NULL_TREE; + /* Seems necessary. */ +- TYPE_MODE (res) = Pmode; ++ SET_TYPE_MODE (res, Pmode); + layout_type (res); + return res; + } +diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in +index e201f64..f36fb97 100644 +--- a/gcc/vhdl/Make-lang.in ++++ b/gcc/vhdl/Make-lang.in +@@ -132,7 +132,7 @@ ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force + -cargs $(CFLAGS) $(GHDL_ADAFLAGS) + $(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \ + -bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \ +- -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) ++ -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) $(CLOOGLIBS) $(PPLLIBS) + + # The driver for ghdl. + ghdl$(exeext): force diff --git a/pkgs/development/compilers/gcc-4.4/gnat-cflags.patch b/pkgs/development/compilers/gcc-4.4/gnat-cflags.patch new file mode 100644 index 000000000000..e85e5076be69 --- /dev/null +++ b/pkgs/development/compilers/gcc-4.4/gnat-cflags.patch @@ -0,0 +1,33 @@ +diff --git a/libada/Makefile.in b/libada/Makefile.in +index f5057a0..337e0c6 100644 +--- a/libada/Makefile.in ++++ b/libada/Makefile.in +@@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN) + WARN_CFLAGS = @warn_cflags@ + + TARGET_LIBGCC2_CFLAGS= +-GNATLIBCFLAGS= -g -O2 ++GNATLIBCFLAGS= -g -O2 $(CFLAGS) + GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \ + -DIN_RTS @have_getipinfo@ + +--- a/gcc/ada/gcc-interface/Makefile.in ++++ b/gcc/ada/gcc-interface/Makefile.in +@@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata + SOME_ADAFLAGS =-gnata + FORCE_DEBUG_ADAFLAGS = -g + GNATLIBFLAGS = -gnatpg -nostdinc +-GNATLIBCFLAGS = -g -O2 ++GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET) + # Pretend that _Unwind_GetIPInfo is available for the target by default. This + # should be autodetected during the configuration of libada and passed down to + # here, but we need something for --disable-libada and hope for the best. +@@ -1838,7 +1838,7 @@ ADA_INCLUDE_SRCS =\ + + LIBGNAT=../$(RTSDIR)/libgnat.a + +-GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES) ++GCC_LINK=$(CC) -static-libgcc $(CFLAGS_FOR_TARGET) $(ADA_INCLUDES) + + # when compiling the tools, the runtime has to be first on the path so that + # it hides the runtime files lying with the rest of the sources diff --git a/pkgs/development/compilers/gcc-4.4/libstdc++-target.patch b/pkgs/development/compilers/gcc-4.4/libstdc++-target.patch new file mode 100644 index 000000000000..0b04b83d08d5 --- /dev/null +++ b/pkgs/development/compilers/gcc-4.4/libstdc++-target.patch @@ -0,0 +1,15 @@ +diff --git a/Makefile.in b/Makefile.in +index 245c770..8545b60 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -250,8 +250,8 @@ BASE_TARGET_EXPORTS = \ + RAW_CXX_TARGET_EXPORTS = \ + $(BASE_TARGET_EXPORTS) \ + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ +- CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \ +- CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP; ++ CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_TARGET)"; export CXX; \ ++ CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_TARGET) -E"; export CXXCPP; + + NORMAL_TARGET_EXPORTS = \ + $(BASE_TARGET_EXPORTS) \ diff --git a/pkgs/development/compilers/gcc-4.4/sources.nix b/pkgs/development/compilers/gcc-4.4/sources.nix index 54cf14749bfd..351240e73ca3 100644 --- a/pkgs/development/compilers/gcc-4.4/sources.nix +++ b/pkgs/development/compilers/gcc-4.4/sources.nix @@ -1,22 +1,26 @@ /* Automatically generated by `update-gcc.sh', do not edit. For GCC 4.4.2. */ -{ fetchurl, optional, version, langC, langCC, langFortran, langJava }: +{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }: -assert version == "4.4.2"; +assert version == "4.4.3"; optional /* langC */ true (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2"; - sha256 = "03cgv3b9bqhap4bks5wfg7nyj64l5c3qyn1igpqc6gk60bxm9wym"; + sha256 = "0ml360nwkf95w0ykn19zlyxmdvvzpmrbxj2vfrn0k8i2pvk13wwj"; }) ++ optional langCC (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2"; - sha256 = "0al23gnx4v50j1y6xb23by34m2qhavm2xxn3f1v8kis7ajlbm1j1"; + sha256 = "1s5zy8pfn4rgfm2l1dpfzrrdhi2l5zhphqk0h3gsbn1pdw751kkv"; }) ++ optional langFortran (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2"; - sha256 = "0zk3j5r1cc5ahm0njxba1xfvv2h39d17aqakgg354pig4hpjkidc"; + sha256 = "0iivw5kgwxdlqamwgaw5zhw48jajsmg09fgynyxkrxsa702s74sw"; }) ++ optional langJava (fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2"; - sha256 = "0ydk0qyhi1fdyz2xvj6m6l7cav4wg3962a1jxpf2j3nppm0p1dvp"; + sha256 = "13r0yxz6sif3i6sxh7b3fa5m1ygynvsg1bf6ssq6njp1fzp9a2kq"; +}) ++ +optional langAda (fetchurl { + url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2"; + sha256 = "146jfkwgg7gdgfqnrm04133amk8k9vr51wc01rwp2bcjai9c3kk7"; }) ++ [] diff --git a/pkgs/development/compilers/gcc-4.4/target-cpp.patch b/pkgs/development/compilers/gcc-4.4/target-cpp.patch new file mode 100644 index 000000000000..ab0f0ee51aaa --- /dev/null +++ b/pkgs/development/compilers/gcc-4.4/target-cpp.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.in b/Makefile.in +index 8545b60..1fab64d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -231,6 +231,7 @@ BASE_TARGET_EXPORTS = \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ ++ CPP="$(CC_FOR_TARGET) -E"; export CPP; \ + CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ diff --git a/pkgs/development/compilers/gnatboot/default.nix b/pkgs/development/compilers/gnatboot/default.nix new file mode 100644 index 000000000000..954fb6bf594f --- /dev/null +++ b/pkgs/development/compilers/gnatboot/default.nix @@ -0,0 +1,48 @@ +{stdenv, fetchurl}: + +stdenv.mkDerivation { + name = "gentoo-gnatboot-4.1"; + + src = if (stdenv.system == "i686-linux") then + fetchurl { + url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2"; + sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr"; + } + else if (stdenv.system == "x86_64-linux") then + fetchurl { + url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2"; + sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4"; + } else throw "Platform not supported"; + + dontStrip=1; + + installPhase = '' + ensureDir $out + cp -R * $out + set +e + for a in $out/bin/* ; do + patchelf --interpreter $(cat $NIX_GCC/nix-support/dynamic-linker) \ + --set-rpath $(cat $NIX_GCC/nix-support/orig-libc)/lib:$(cat $NIX_GCC/nix-support/orig-gcc)/lib64:$(cat $NIX_GCC/nix-support/orig-gcc)/lib $a + done + set -e + mv $out/bin/gnatgcc_2wrap $out/bin/gnatgcc + ln -s $out/bin/gnatgcc $out/bin/gcc + ''; + + passthru = { + langC = true; /* TRICK for gcc-wrapper to wrap it */ + langCC = false; + langFortran = false; + langAda = true; + }; + + meta = { + homepage = http://gentoo.org; + license = "GPLv3+"; # runtime support libraries are typically LGPLv3+ + maintainers = [ + stdenv.lib.maintainers.viric + ]; + + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/development/compilers/ocaml/3.11.1.nix b/pkgs/development/compilers/ocaml/3.11.1.nix index 8c1f634023cb..c825830e43d9 100644 --- a/pkgs/development/compilers/ocaml/3.11.1.nix +++ b/pkgs/development/compilers/ocaml/3.11.1.nix @@ -1,5 +1,10 @@ args: with args; +let + useX11 = (stdenv.system != "armv5tel-linux"); + useNativeCompilers = (stdenv.system != "armv5tel-linux"); + inherit (stdenv.lib) optionals optionalString; +in stdenv.mkDerivation (rec { name = "ocaml-3.11.1"; @@ -10,10 +15,10 @@ stdenv.mkDerivation (rec { }; prefixKey = "-prefix "; - configureFlags = ["-no-tk" "-x11lib" x11]; - buildFlags = "world bootstrap world.opt"; - buildInputs = [x11 ncurses]; - installTargets = "install installopt"; + configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11 ]; + buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt"; + buildInputs = [ncurses] ++ optionals useX11 [ x11 ]; + installTargets = "install" + optionalString useNativeCompilers " installopt"; patchPhase = '' CAT=$(type -tp cat) sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang diff --git a/pkgs/development/compilers/ocaml/cvs.nix b/pkgs/development/compilers/ocaml/cvs.nix new file mode 100644 index 000000000000..475a1d46d589 --- /dev/null +++ b/pkgs/development/compilers/ocaml/cvs.nix @@ -0,0 +1,31 @@ +args: with args; + +stdenv.mkDerivation (rec { + + name = "ocaml-cvs-2009-09-24"; + + src = fetchcvs { + cvsRoot = ":pserver:anoncvs@camlcvs.inria.fr:/caml"; + module = "ocaml"; + date = "2009-09-24"; + sha256 = "3909bffebc9ce36ca51711d7d95596cba94376ebb1975c6ed46b09c9892c3ef1"; + }; + + prefixKey = "-prefix "; + configureFlags = ["-no-tk"]; + buildFlags = "world" + + (if (stdenv.system != "armv5tel-linux") then "bootstrap world.opt" else ""); + buildInputs = [ncurses]; + installTargets = "install" + (if (stdenv.system != "armv5tel-linux") then "installopt" else ""); + patchPhase = '' + CAT=$(type -tp cat) + sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang + ''; + + meta = { + homepage = http://caml.inria.fr/ocaml; + license = "QPL, LGPL2 (library part)"; + desctiption = "Most popular variant of the Caml language"; + }; + +}) diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix index 7e2de8c942ee..8dd7953a42da 100644 --- a/pkgs/development/interpreters/guile/default.nix +++ b/pkgs/development/interpreters/guile/default.nix @@ -3,13 +3,15 @@ stdenv.mkDerivation rec { name = "guile-1.8.7"; + src = fetchurl { url = "mirror://gnu/guile/" + name + ".tar.gz"; sha256 = "1czhcrn6l63xhsw3fjmv88djflqxbdpxjhgmwwvscm8rv4wn7vmz"; }; - buildInputs = [ makeWrapper ]; - propagatedBuildInputs = [readline libtool gmp gawk]; + buildNativeInputs = [ makeWrapper gawk ]; + propagatedBuildInputs = [ readline gmp libtool ]; + selfBuildNativeInput = true; postInstall = '' wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" @@ -19,7 +21,17 @@ stdenv.mkDerivation rec { sed -e '/lt_dlinit/a lt_dladdsearchdir("'$out/lib'");' -i libguile/dynl.c ''; - doCheck = true; + # Guile needs patching to preset results for the configure tests + # about pthreads, which work only in native builds. + preConfigure = '' + if test -n "$crossConfig"; then + configureFlags="--with-threads=no $configureFlags" + fi + ''; + + # One test fails. + # ERROR: file: "libtest-asmobs", message: "file not found" + doCheck = false; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/interpreters/maude/default.nix b/pkgs/development/interpreters/maude/default.nix index acd82e2b2e5d..ccf0c53daec3 100644 --- a/pkgs/development/interpreters/maude/default.nix +++ b/pkgs/development/interpreters/maude/default.nix @@ -2,26 +2,34 @@ stdenv.mkDerivation rec { name = "maude-2.4"; + meta = { homepage = "http://maude.cs.uiuc.edu/"; description = "Maude -- a high-level specification language"; license = "GPLv2"; }; + src = fetchurl { url = "http://maude.cs.uiuc.edu/download/current/Maude-2.4.tar.gz"; sha256 = "0bydkf8fd5v267bfak4mm5lmm3vvnr6ir1jr7gimgyzqygdk0in2"; }; + fullMaude = fetchurl { url = "http://maude.cs.uiuc.edu/download/current/FM2.4/full-maude24.maude"; sha256 = "9e4ebdc717dc968d0b6c1179f360e60b3a39ea8cecc1a7fa49f2105bbddc48c4"; }; + docs = fetchurl { url = "http://mirror.switch.ch/mirror/gentoo/distfiles/maude-2.3.0-extras.tar.bz2"; sha256 = "0kd5623k1wwj1rk4b6halrm3sdvd9kbiwg1hi2c3qim1nlfdgl0d"; }; + buildInputs = [flex bison ncurses buddy tecla gmpxx libsigsegv makeWrapper]; + configurePhase = ''./configure --disable-dependency-tracking --prefix=$out --datadir=$out/share/maude TECLA_LIBS="-ltecla -lncursesw" CFLAGS="-O3" CXXFLAGS="-O3"''; + doCheck = true; + postInstall = '' for n in $out/bin/*; do wrapProgram "$n" --suffix MAUDE_LIB ':' "$out/share/maude"; done diff --git a/pkgs/development/interpreters/perl-5.10/default.nix b/pkgs/development/interpreters/perl-5.10/default.nix index 96451380e6d5..31168291e3d1 100644 --- a/pkgs/development/interpreters/perl-5.10/default.nix +++ b/pkgs/development/interpreters/perl-5.10/default.nix @@ -1,33 +1,39 @@ -{ stdenv, fetchurl -, impureLibcPath ? null -}: +{ stdenv, fetchurl }: -stdenv.mkDerivation { - name = "perl-5.10.0"; +let + + libc = if stdenv ? gcc && stdenv.gcc.libc != null then stdenv.gcc.libc else "/usr"; + +in + +stdenv.mkDerivation rec { + name = "perl-5.10.1"; src = fetchurl { - url = mirror://cpan/src/perl-5.10.0.tar.gz; - sha256 = "0bivbz15x02m02gqs6hs77cgjr2msfrhnvp5xqk359jg6w6llill"; + url = "mirror://cpan/src/${name}.tar.gz"; + sha256 = "0dagnhjgmslfx1jawz986nvc3jh1klk7mn2l8djdca1b9gm2czyb"; }; - patches = [ - # This patch does the following: - # 1) Do use the PATH environment variable to find the `pwd' command. - # By default, Perl will only look for it in /lib and /usr/lib. - # !!! what are the security implications of this? - # 2) Force the use of , not /usr/include/errno.h, on Linux - # systems. (This actually appears to be due to a bug in Perl.) - ./no-sys-dirs.patch - ]; + patches = + [ # Do not look in /usr etc. for dependencies. + ./no-sys-dirs.patch + ]; # Build a thread-safe Perl with a dynamic libperls.o. We need the # "installstyle" option to ensure that modules are put under # $out/lib/perl5 - this is the general default, but because $out # contains the string "perl", Configure would select $out/lib. - configureFlags = '' - -de -Dcc=gcc -Uinstallusrbinperl -Dinstallstyle=lib/perl5 -Duseshrplib - ${if stdenv ? glibc then "-Dusethreads" else ""} - ''; + # Miniperl needs -lm. perl needs -lrt. + configureFlags = + [ "-de" + "-Dcc=gcc" + "-Uinstallusrbinperl" + "-Dinstallstyle=lib/perl5" + "-Duseshrplib" + "-Dlocincpth=${libc}/include" + "-Dloclibpth=${libc}/lib" + ] + ++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads"; configureScript = "${stdenv.shell} ./Configure"; @@ -37,18 +43,15 @@ stdenv.mkDerivation { '' configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3" - if test "${if impureLibcPath == null then "$NIX_ENFORCE_PURITY" else "1"}" = "1"; then - GLIBC=${if impureLibcPath == null then "$(cat $NIX_GCC/nix-support/orig-libc)" else impureLibcPath} - configureFlags="$configureFlags -Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib" - fi + ${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") '' + configureFlagsArray=(-Dldflags="-lm -lrt") + ''} ''; - preBuild = + preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools)) '' # Make Cwd work on NixOS (where we don't have a /bin/pwd). - ${if (stdenv.isDarwin || stdenv.system == "i686-gnu/kfreebsd") - then "" - else "substituteInPlace lib/Cwd.pm --replace \"'/bin/pwd'\" \"'$(type -tP pwd)'\""} + substituteInPlace lib/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'" ''; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/interpreters/perl-5.10/no-sys-dirs.patch b/pkgs/development/interpreters/perl-5.10/no-sys-dirs.patch index 0b1164a32509..29edf68bb647 100644 --- a/pkgs/development/interpreters/perl-5.10/no-sys-dirs.patch +++ b/pkgs/development/interpreters/perl-5.10/no-sys-dirs.patch @@ -1,8 +1,8 @@ -diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure -*** perl-5.10.0-orig/Configure 2007-12-18 11:47:07.000000000 +0100 ---- perl-5.10.0/Configure 2008-02-21 17:00:40.000000000 +0100 +diff -rc -x '*~' perl-5.10.1-orig/Configure perl-5.10.1/Configure +*** perl-5.10.1-orig/Configure 2009-08-18 21:03:53.000000000 +0200 +--- perl-5.10.1/Configure 2010-01-26 19:08:32.933792254 +0100 *************** -*** 104,118 **** +*** 103,117 **** fi : Proper PATH setting @@ -18,7 +18,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure for p in $paths do ---- 104,110 ---- +--- 103,109 ---- fi : Proper PATH setting @@ -27,8 +27,8 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure for p in $paths do *************** -*** 1271,1287 **** - groupstype='' +*** 1301,1317 **** + archname='' libnames='' : change the next line if compiling for Xenix/286 on Xenix/386 ! xlibpth='/usr/lib/386 /lib/386' @@ -45,8 +45,8 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure : Private path used by Configure to find libraries. Its value : is prepended to libpth. This variable takes care of special ---- 1263,1274 ---- - groupstype='' +--- 1293,1304 ---- + archname='' libnames='' : change the next line if compiling for Xenix/286 on Xenix/386 ! xlibpth='' @@ -59,7 +59,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure : Private path used by Configure to find libraries. Its value : is prepended to libpth. This variable takes care of special *************** -*** 1302,1309 **** +*** 1329,1336 **** : Possible local include directories to search. : Set locincpth to "" in a hint file to defeat local include searches. @@ -68,7 +68,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure : : no include file wanted by default inclwanted='' ---- 1289,1295 ---- +--- 1316,1322 ---- : Possible local include directories to search. : Set locincpth to "" in a hint file to defeat local include searches. @@ -77,7 +77,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure : no include file wanted by default inclwanted='' *************** -*** 1331,1338 **** +*** 1358,1365 **** libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD" : We probably want to search /usr/shlib before most other libraries. : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. @@ -86,9 +86,9 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure : Do not use vfork unless overridden by a hint file. usevfork=false ---- 1317,1322 ---- +--- 1344,1349 ---- *************** -*** 2340,2346 **** +*** 2366,2372 **** zip " pth=`echo $PATH | sed -e "s/$p_/ /g"` @@ -96,9 +96,9 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure for file in $loclist; do eval xxx=\$$file case "$xxx" in ---- 2324,2329 ---- +--- 2350,2355 ---- *************** -*** 8155,8167 **** +*** 8361,8373 **** echo " " case "$sysman" in '') @@ -112,7 +112,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure ;; esac if $test -d "$sysman"; then ---- 8138,8145 ---- +--- 8344,8351 ---- echo " " case "$sysman" in '') @@ -122,7 +122,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure esac if $test -d "$sysman"; then *************** -*** 19005,19013 **** +*** 19476,19484 **** case "$full_ar" in '') full_ar=$ar ;; esac @@ -132,7 +132,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure : see what type gids are declared as in the kernel echo " " ---- 18983,18992 ---- +--- 19454,19463 ---- case "$full_ar" in '') full_ar=$ar ;; esac @@ -143,11 +143,11 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure : see what type gids are declared as in the kernel echo " " -diff -rc perl-5.10.0-orig/ext/Errno/Errno_pm.PL perl-5.10.0/ext/Errno/Errno_pm.PL -*** perl-5.10.0-orig/ext/Errno/Errno_pm.PL 2007-12-18 11:47:07.000000000 +0100 ---- perl-5.10.0/ext/Errno/Errno_pm.PL 2008-02-21 17:00:02.000000000 +0100 +diff -rc -x '*~' perl-5.10.1-orig/ext/Errno/Errno_pm.PL perl-5.10.1/ext/Errno/Errno_pm.PL +*** perl-5.10.1-orig/ext/Errno/Errno_pm.PL 2009-06-27 18:09:45.000000000 +0200 +--- perl-5.10.1/ext/Errno/Errno_pm.PL 2010-01-26 18:08:09.552792021 +0100 *************** -*** 140,150 **** +*** 144,154 **** if ($dep =~ /(\S+errno\.h)/) { $file{$1} = 1; } @@ -159,7 +159,7 @@ diff -rc perl-5.10.0-orig/ext/Errno/Errno_pm.PL perl-5.10.0/ext/Errno/Errno_pm.P # Some Linuxes have weird errno.hs which generate # no #file or #line directives my $linux_errno_h = -e '/usr/include/errno.h' ? ---- 140,146 ---- +--- 144,150 ---- if ($dep =~ /(\S+errno\.h)/) { $file{$1} = 1; } @@ -167,3 +167,35 @@ diff -rc perl-5.10.0-orig/ext/Errno/Errno_pm.PL perl-5.10.0/ext/Errno/Errno_pm.P # Some Linuxes have weird errno.hs which generate # no #file or #line directives my $linux_errno_h = -e '/usr/include/errno.h' ? +diff -rc -x '*~' perl-5.10.1-orig/hints/freebsd.sh perl-5.10.1/hints/freebsd.sh +*** perl-5.10.1-orig/hints/freebsd.sh 2009-02-12 23:58:12.000000000 +0100 +--- perl-5.10.1/hints/freebsd.sh 2010-01-26 18:30:01.181854620 +0100 +*************** +*** 118,130 **** + objformat=`/usr/bin/objformat` + if [ x$objformat = xaout ]; then + if [ -e /usr/lib/aout ]; then +! libpth="/usr/lib/aout /usr/local/lib /usr/lib" +! glibpth="/usr/lib/aout /usr/local/lib /usr/lib" + fi + lddlflags='-Bshareable' + else +! libpth="/usr/lib /usr/local/lib" +! glibpth="/usr/lib /usr/local/lib" + ldflags="-Wl,-E " + lddlflags="-shared " + fi +--- 118,130 ---- + objformat=`/usr/bin/objformat` + if [ x$objformat = xaout ]; then + if [ -e /usr/lib/aout ]; then +! libpth="" +! glibpth="" + fi + lddlflags='-Bshareable' + else +! libpth="" +! glibpth="" + ldflags="-Wl,-E " + lddlflags="-shared " + fi diff --git a/pkgs/development/libraries/aterm/2.4.2-fixes.nix b/pkgs/development/libraries/aterm/2.4.2-fixes.nix index a160d5cd121a..b02da9be1ace 100644 --- a/pkgs/development/libraries/aterm/2.4.2-fixes.nix +++ b/pkgs/development/libraries/aterm/2.4.2-fixes.nix @@ -12,6 +12,12 @@ stdenv.mkDerivation { # Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841 ./max-long.patch ]; + + # There are apparently still some aliasing bugs left in + # aterm-2.4.2-fixes-r2 (in AT_setAnnotations to be precise), but + # under my reading of the C standard it should be fine. Anyway, just + # disable strict aliasing. + NIX_CFLAGS_COMPILE = "-fno-strict-aliasing"; doCheck = true; diff --git a/pkgs/development/libraries/atk/1.24.x.nix b/pkgs/development/libraries/atk/1.24.x.nix index 1ff7f388c76d..213c3ef72a45 100644 --- a/pkgs/development/libraries/atk/1.24.x.nix +++ b/pkgs/development/libraries/atk/1.24.x.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "0mjxliarzcy7iksh6v1npxsqdpc9sjj3q4wcl567asbdzdpbd803"; }; - buildInputs = [pkgconfig perl]; + buildNativeInputs = [perl]; + buildInputs = [pkgconfig]; propagatedBuildInputs = [glib]; meta = { diff --git a/pkgs/development/libraries/cloog-ppl/default.nix b/pkgs/development/libraries/cloog-ppl/default.nix index ab502d9e5ac6..b1372d79cb50 100644 --- a/pkgs/development/libraries/cloog-ppl/default.nix +++ b/pkgs/development/libraries/cloog-ppl/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, ppl }: stdenv.mkDerivation rec { - name = "cloog-ppl-0.15.4"; + name = "cloog-ppl-0.15.7"; src = fetchurl { url = "mirror://gcc/infrastructure/${name}.tar.gz"; - sha256 = "133b6ayi6wmvbmvd4y1w1xh01qy38kp59n87j7apkm2ig8avfnmm"; + sha256 = "0zb96524jk2l78gr5gw0wq3dnvdsmyr2av59v89zv5xcps417q55"; }; propagatedBuildInputs = [ ppl ]; diff --git a/pkgs/development/libraries/cyrus-sasl/cyrus-sasl-2.1.22-bad-elif.patch b/pkgs/development/libraries/cyrus-sasl/cyrus-sasl-2.1.22-bad-elif.patch new file mode 100644 index 000000000000..33550c428d20 --- /dev/null +++ b/pkgs/development/libraries/cyrus-sasl/cyrus-sasl-2.1.22-bad-elif.patch @@ -0,0 +1,21 @@ +diff -up cyrus-sasl-2.1.22/plugins/digestmd5.c.elif cyrus-sasl-2.1.22/plugins/digestmd5.c +--- cyrus-sasl-2.1.22/plugins/digestmd5.c.elif 2009-01-23 09:40:31.000000000 +0100 ++++ cyrus-sasl-2.1.22/plugins/digestmd5.c 2009-02-06 15:20:15.000000000 +0100 +@@ -2743,7 +2743,7 @@ static sasl_server_plug_t digestmd5_serv + "DIGEST-MD5", /* mech_name */ + #ifdef WITH_RC4 + 128, /* max_ssf */ +-#elif WITH_DES ++#elif defined(WITH_DES) + 112, + #else + 1, +@@ -4071,7 +4071,7 @@ static sasl_client_plug_t digestmd5_clie + "DIGEST-MD5", + #ifdef WITH_RC4 /* mech_name */ + 128, /* max ssf */ +-#elif WITH_DES ++#elif defined(WITH_DES) + 112, + #else + 1, diff --git a/pkgs/development/libraries/cyrus-sasl/default.nix b/pkgs/development/libraries/cyrus-sasl/default.nix index 8405ebd1b3c2..c9b87ebb7d28 100644 --- a/pkgs/development/libraries/cyrus-sasl/default.nix +++ b/pkgs/development/libraries/cyrus-sasl/default.nix @@ -9,4 +9,5 @@ stdenv.mkDerivation { }; configureFlags="--with-openssl=${openssl} --with-plugindir=\${out}/lib/sasl2 --with-configdir=\${out}/lib/sasl2"; buildInputs = [ openssl db4 gettext ]; + patches = [ ./cyrus-sasl-2.1.22-bad-elif.patch ]; } diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix index 752ded6320b2..a6d594af0f02 100644 --- a/pkgs/development/libraries/dbus-glib/default.nix +++ b/pkgs/development/libraries/dbus-glib/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "0nv4gxcbpa9f0907dmzmfm222w8y45z19cx27l85f5qknf8hncxm"; }; - buildInputs = [pkgconfig expat gettext]; + buildInputs = [pkgconfig expat gettext libiconv]; propagatedBuildInputs = [dbus.libs glib]; diff --git a/pkgs/development/libraries/eglibc/builder.sh b/pkgs/development/libraries/eglibc/builder.sh new file mode 100644 index 000000000000..47cd1b5e252f --- /dev/null +++ b/pkgs/development/libraries/eglibc/builder.sh @@ -0,0 +1,63 @@ +# Glibc cannot have itself in its RPATH. +export NIX_NO_SELF_RPATH=1 + +source $stdenv/setup + +# Explicitly tell glibc to use our pwd, not /bin/pwd. +export PWD_P=$(type -tP pwd) + +# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to +# prevent a retained dependency on the bootstrap tools in the +# stdenv-linux bootstrap. +export BASH_SHELL=/bin/sh + +preConfigure() { + + for i in libc/configure libc/io/ftwtest-sh; do + # Can't use substituteInPlace here because replace hasn't been + # built yet in the bootstrap. + sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" + done + + # Include source for debugging + ensureDir $out/src + cp -R libc ports $out/src + ln -s $out/src/ports $out/src/libc/ports + # glibc wants -O2 minimum + export CFLAGS="-pipe -g -O2" + + mkdir $NIX_BUILD_TOP/build + cd $NIX_BUILD_TOP/build + + configureScript=$out/src/libc/configure +} + + +postConfigure() { + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS +} + + +postInstall() { + if test -n "$installLocales"; then + make localedata/install-locales + fi + rm $out/etc/ld.so.cache + (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1 + + # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink + # "lib64" to "lib". + if test -n "$is64bit"; then + ln -s lib $out/lib64 + fi +} + + +genericBuild diff --git a/pkgs/development/libraries/eglibc/default.nix b/pkgs/development/libraries/eglibc/default.nix new file mode 100644 index 000000000000..a27d0f53fbf8 --- /dev/null +++ b/pkgs/development/libraries/eglibc/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchsvn, kernelHeaders +, installLocales ? true +, profilingLibraries ? false +}: + +stdenv.mkDerivation rec { + name = "eglibc-2.10"; + + src = fetchsvn { + url = svn://svn.eglibc.org/branches/eglibc-2_10; + rev = 8690; + sha256 = "029hklrx2rlhsb5r2csd0gapjm0rbr8n28ib6jnnhms12x302viq"; + }; + + inherit kernelHeaders installLocales; + + configureFlags = [ + "--with-headers=${kernelHeaders}/include" + "--without-fp" + "--enable-add-ons=libidn,ports,nptl" + "--disable-profile" + "--host=arm-linux-gnueabi" + "--build=arm-linux-gnueabi" + ]; + + builder = ./builder.sh; + + meta = { + homepage = http://www.gnu.org/software/libc/; + description = "The GNU C Library"; + }; +} diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 1f1074096839..7e802eb86b83 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -13,6 +13,17 @@ stdenv.mkDerivation rec { configureFlags = "--with-confdir=/etc/fonts --with-cache-dir=/var/cache/fontconfig --disable-docs --with-default-fonts="; + # We should find a better way to access the arch reliably. + crossArch = if (stdenv ? cross && stdenv.cross != null) + then stdenv.cross.arch else null; + + + preConfigure = '' + if test -n "$crossConfig"; then + configureFlags="$configureFlags --with-arch=$crossArch"; + fi + ''; + # Don't try to write to /etc/fonts or /var/cache/fontconfig at install time. installFlags = "CONFDIR=$(out)/etc/fonts RUN_FC_CACHE_TEST=false fc_cachedir=$(TMPDIR)/dummy"; diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix index 0bf2db03cd82..d3814bdb9724 100644 --- a/pkgs/development/libraries/freetype/default.nix +++ b/pkgs/development/libraries/freetype/default.nix @@ -1,5 +1,4 @@ { stdenv, fetchurl - , # FreeType supports hinting using a TrueType bytecode interpreter, # as well as sub-pixel rendering. These are patented by Apple and # Microsoft, respectively, so they are disabled by default. This @@ -8,7 +7,7 @@ useEncumberedCode ? false }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { name = "freetype-2.3.11"; src = fetchurl { @@ -26,4 +25,7 @@ stdenv.mkDerivation rec { homepage = http://www.freetype.org/; license = "GPLv2+"; # or the FreeType License (BSD + advertising clause) }; -} +} // +# The asm for armel is written with the 'asm' keyword. +(if (stdenv.system == "armv5tel-linux") then + {CFLAGS = "-std=gnu99";} else {})) diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 3ef348dc4b8d..6b094fdc8394 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -10,6 +10,17 @@ stdenv.mkDerivation (rec { configureFlags = "--disable-csharp"; + # On cross building, gettext supposes that the wchar.h from libc + # does not fulfill gettext needs, so it tries to work with its + # own wchar.h file, which does not cope well with the system's + # wchar.h and stddef.h (gcc-4.3 - glibc-2.9) + preConfigure = '' + if test -n "$crossConfig"; then + echo gl_cv_func_wcwidth_works=yes > cachefile + configureFlags="$configureFlags --cache-file=`pwd`/cachefile" + fi + ''; + meta = { description = "GNU gettext, a well integrated set of translation tools and documentation"; diff --git a/pkgs/development/libraries/glib/2.20.x.nix b/pkgs/development/libraries/glib/2.20.x.nix index 01e70c172d16..c7a92a00b42c 100644 --- a/pkgs/development/libraries/glib/2.20.x.nix +++ b/pkgs/development/libraries/glib/2.20.x.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "0ndgshcqzpj3piwmag3vrsv3rg4pnr12y70knl7z0k2i03cy5bav"; }; - buildInputs = [pkgconfig gettext perl]; + buildNativeInputs = [perl]; + buildInputs = [pkgconfig gettext]; # The nbd package depends on a static version of this library; hence # the default configure flag --disable-static is switched off. diff --git a/pkgs/development/libraries/glib/2.22.x.nix b/pkgs/development/libraries/glib/2.22.x.nix index eaf6a56daded..e6af08cae0e3 100644 --- a/pkgs/development/libraries/glib/2.22.x.nix +++ b/pkgs/development/libraries/glib/2.22.x.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, gettext, perl }: +{ stdenv, fetchurl, pkgconfig, gettext, perl, libiconv ? null}: stdenv.mkDerivation rec { name = "glib-2.22.4"; @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "055dv2hymbyzwpcd39r97x747vsvlkyywa826zr75dzambw6n7qd"; }; - buildInputs = [pkgconfig gettext perl]; + buildInputs = [pkgconfig gettext perl libiconv]; # The nbd package depends on a static version of this library; hence # the default configure flag --disable-static is switched off. diff --git a/pkgs/development/libraries/glibc-2.10/binutils-2.20.patch b/pkgs/development/libraries/glibc-2.10/binutils-2.20.patch new file mode 100644 index 000000000000..ab3d6144d6ee --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/binutils-2.20.patch @@ -0,0 +1,42 @@ +Support GNU Binutils 2.20 and beyond. Patch from +http://sourceware.org/ml/libc-alpha/2009-09/msg00009.html . + +diff --git a/configure b/configure +index 48e6952..b1d84d7 100755 +--- a/configure ++++ b/configure +@@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; } + ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; +- 2.1[3-9]*) ++ 2.1[3-9]*|[2-9].[2-9]*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + +@@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; } + ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; +- 2.1[3-9]*) ++ 2.1[3-9]*|[2-9].[2-9]*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + +diff --git a/configure.in b/configure.in +index 4584afe..7c4f71f 100644 +--- a/configure.in ++++ b/configure.in +@@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in + # Accept binutils 2.13 or newer. + AC_CHECK_PROG_VER(AS, $AS, --version, + [GNU assembler.* \([0-9]*\.[0-9.]*\)], +- [2.1[3-9]*], AS=: critic_missing="$critic_missing as") ++ [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as") + AC_CHECK_PROG_VER(LD, $LD, --version, + [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)], +- [2.1[3-9]*], LD=: critic_missing="$critic_missing ld") ++ [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld") + + # We need the physical current working directory. We cannot use the + # "pwd -P" shell builtin since that's not portable. Instead we try to diff --git a/pkgs/development/libraries/glibc-2.10/builder.sh b/pkgs/development/libraries/glibc-2.10/builder.sh new file mode 100644 index 000000000000..fc1ea2f83eb8 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/builder.sh @@ -0,0 +1,33 @@ +# Glibc cannot have itself in its RPATH. +export NIX_NO_SELF_RPATH=1 + +source $stdenv/setup + +postConfigure() { + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS +} + + +postInstall() { + if test -n "$installLocales"; then + make localedata/install-locales + fi + test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache + (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1 + + # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink + # "lib64" to "lib". + if test -n "$is64bit"; then + ln -s lib $out/lib64 + fi +} + + +genericBuild diff --git a/pkgs/development/libraries/glibc-2.10/common.nix b/pkgs/development/libraries/glibc-2.10/common.nix new file mode 100644 index 000000000000..fd91218c26af --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/common.nix @@ -0,0 +1,164 @@ +/* Build configuration used to build glibc, Info files, and locale + information. */ + +cross : { name, fetchurl, stdenv, installLocales ? false +, gccCross ? null, kernelHeaders ? null +, profilingLibraries ? false, meta, ... }@args : + +let version = "2.10.1"; +in +assert (cross != null) -> (gccCross != null); + +stdenv.mkDerivation ({ + inherit kernelHeaders installLocales; + + # The host/target system. + crossConfig = if (cross != null) then cross.config else null; + + inherit (stdenv) is64bit; + + patches = [ + /* Fix for NIXPKGS-79: when doing host name lookups, when + nsswitch.conf contains a line like + + hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 + + don't return an error when mdns4_minimal can't be found. This + is a bug in Glibc: when a service can't be found, NSS should + continue to the next service unless "UNAVAIL=return" is set. + ("NOTFOUND=return" refers to the service returning a NOTFOUND + error, not the service itself not being found.) The reason is + that the "status" variable (while initialised to UNAVAIL) is + outside of the loop that iterates over the services, the + "files" service sets status to NOTFOUND. So when the call to + find "mdns4_minimal" fails, "status" will still be NOTFOUND, + and it will return instead of continuing to "dns". Thus, the + line + + hosts: mdns4_minimal [NOTFOUND=return] dns mdns4 + + does work because "status" will contain UNAVAIL after the + failure to find mdns4_minimal. */ + ./nss-skip-unavail.patch + + /* Make it possible to override the locale-archive in NixOS. */ + ./locale-override.patch + + /* Have rpcgen(1) look for cpp(1) in $PATH. */ + ./rpcgen-path.patch + + /* Make sure `nscd' et al. are linked against `libssp'. */ + ./stack-protector-link.patch + + /* Allow binutils 2.20 to be used (patch on its version checking) */ + ./binutils-2.20.patch + ]; + + configureFlags = [ + "-C" + "--enable-add-ons" + (if kernelHeaders != null + then "--with-headers=${kernelHeaders}/include" + else "--without-headers") + (if profilingLibraries + then "--enable-profile" + else "--disable-profile") + ] ++ stdenv.lib.optionals (cross != null) [ + "--with-tls" + "--enable-kernel=2.6.0" + "--without-fp" + "--with-__thread" + ] ++ (if (stdenv.system == "armv5tel-linux") then [ + "--host=arm-linux-gnueabi" + "--build=arm-linux-gnueabi" + "--without-fp" + ] else []); + + buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]; + + # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to + # prevent a retained dependency on the bootstrap tools in the stdenv-linux + # bootstrap. + BASH_SHELL = "/bin/sh"; +} + +// + +(if (stdenv.system == "i686-linux") + then { + # Workaround for this bug: + # http://sourceware.org/bugzilla/show_bug.cgi?id=411 + # I.e. when gcc is compiled with --with-arch=i686, then the + # preprocessor symbol `__i686' will be defined to `1'. This causes + # the symbol __i686.get_pc_thunk.dx to be mangled. + NIX_CFLAGS_COMPILE = "-U__i686"; + } + else {}) + + // + + args + + // + +{ + name = args.name + "-${version}" + + stdenv.lib.optionalString (cross != null) "-${cross.config}"; + + src = fetchurl { + url = "mirror://gnu/glibc/glibc-${version}.tar.bz2"; + sha256 = "0rz67p3zy3hj1pbcx8qjwnh926d412zs51ss82232qdbgrikxbfb"; + }; + + srcPorts = fetchurl { + url = "mirror://gnu/glibc/glibc-ports-${version}.tar.bz2"; + sha256 = "0wa0mdsfv0b97a0vbmc3l1258lq2y7p7i14bb4rklsh342byrwdi"; + }; + + # `fetchurl' is a function and thus should not be passed to the + # `derivation' primitive. + fetchurl = null; + + # Remove absolute paths from `configure' & co.; build out-of-tree. + preConfigure = '' + export PWD_P=$(type -tP pwd) + for i in configure io/ftwtest-sh; do + # Can't use substituteInPlace here because replace hasn't been + # built yet in the bootstrap. + sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" + done + + tar xvjf "$srcPorts" + + mkdir ../build + cd ../build + + configureScript="../$sourceRoot/configure" + + ${if args ? preConfigure + then args.preConfigure + else ""} + ''; + + meta = ({ + homepage = http://www.gnu.org/software/libc/; + description = "The GNU C Library"; + + longDescription = + '' Any Unix-like operating system needs a C library: the library which + defines the "system calls" and other basic facilities such as + open, malloc, printf, exit... + + The GNU C library is used as the C library in the GNU system and + most systems with the Linux kernel. + ''; + + license = "LGPLv2+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.linux; + } + // + args.meta + ); +}) diff --git a/pkgs/development/libraries/glibc-2.10/default.nix b/pkgs/development/libraries/glibc-2.10/default.nix new file mode 100644 index 000000000000..49ee71af5060 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchurl, kernelHeaders +, installLocales ? true +, profilingLibraries ? false +, gccCross ? null +}: + +let + build = import ./common.nix; + cross = if gccCross != null then gccCross.target else null; +in + build cross ({ + name = "glibc"; + + inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries + gccCross; + + builder = ./builder.sh; + + preInstall = '' + ensureDir $out/lib + ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 + ''; + + postInstall = '' + rm $out/lib/libgcc_s.so.1 + ''; + + meta.description = "The GNU C Library"; + } + + // + + (if cross != null + then { + preConfigure = '' + sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig" + + cat > config.cache << "EOF" +libc_cv_forced_unwind=yes +libc_cv_c_cleanup=yes +libc_cv_gnu89_inline=yes +EOF + export BUILD_CC=gcc + export CC="$crossConfig-gcc" + export AR="$crossConfig-ar" + export RANLIB="$crossConfig-ranlib" + + dontStrip=1 + ''; + } + else {})) diff --git a/pkgs/development/libraries/glibc-2.10/info.nix b/pkgs/development/libraries/glibc-2.10/info.nix new file mode 100644 index 000000000000..926598b37603 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/info.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl, texinfo, perl }: + +let build = import ./common.nix; +in + build { + name = "glibc-info"; + + inherit fetchurl stdenv; + + configureFlags = [ "--enable-add-ons" ]; + + buildInputs = [ texinfo perl ]; + + buildPhase = "make info"; + + # I don't know why the info is not generated in 'build' + # Somehow building the info still does not work, because the final + # libc.info hasn't a Top node. + installPhase = '' + ensureDir "$out/share/info" + cp -v "../$sourceRoot/manual/"*.info* "$out/share/info" + ''; + + meta.description = "GNU Info manual of the GNU C Library"; + } diff --git a/pkgs/development/libraries/glibc-2.10/locale-override.patch b/pkgs/development/libraries/glibc-2.10/locale-override.patch new file mode 100644 index 000000000000..108d0e35dacf --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/locale-override.patch @@ -0,0 +1,72 @@ +diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c +*** glibc-2.9-20081208-orig/locale/loadarchive.c 2005-09-09 18:56:52.000000000 +0200 +--- glibc-2.9-20081208/locale/loadarchive.c 2009-04-19 13:54:26.000000000 +0200 +*************** +*** 124,129 **** +--- 124,142 ---- + } + + ++ static int ++ open_locale_archive () ++ { ++ int fd = -1; ++ char *path = getenv ("LOCALE_ARCHIVE"); ++ if (path) ++ fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE); ++ if (fd < 0) ++ fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); ++ return fd; ++ } ++ ++ + /* Find the locale *NAMEP in the locale archive, and return the + internalized data structure for its CATEGORY data. If this locale has + already been loaded from the archive, just returns the existing data +*************** +*** 203,209 **** + archmapped = &headmap; + + /* The archive has never been opened. */ +! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); + if (fd < 0) + /* Cannot open the archive, for whatever reason. */ + return NULL; +--- 216,222 ---- + archmapped = &headmap; + + /* The archive has never been opened. */ +! fd = open_locale_archive (); + if (fd < 0) + /* Cannot open the archive, for whatever reason. */ + return NULL; +*************** +*** 394,400 **** + if (fd == -1) + { + struct stat64 st; +! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); + if (fd == -1) + /* Cannot open the archive, for whatever reason. */ + return NULL; +--- 407,413 ---- + if (fd == -1) + { + struct stat64 st; +! fd = open_locale_archive (); + if (fd == -1) + /* Cannot open the archive, for whatever reason. */ + return NULL; +diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h +*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h 2006-10-11 18:24:05.000000000 +0200 +--- glibc-2.9-20081208/sysdeps/generic/unsecvars.h 2009-04-19 13:55:34.000000000 +0200 +*************** +*** 16,21 **** +--- 16,22 ---- + "LD_SHOW_AUXV\0" \ + "LD_USE_LOAD_BIAS\0" \ + "LOCALDOMAIN\0" \ ++ "LOCALE_ARCHIVE\0" \ + "LOCPATH\0" \ + "MALLOC_TRACE\0" \ + "NIS_PATH\0" \ diff --git a/pkgs/development/libraries/glibc-2.10/locales.nix b/pkgs/development/libraries/glibc-2.10/locales.nix new file mode 100644 index 000000000000..61bfc9edc02a --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/locales.nix @@ -0,0 +1,42 @@ +/* This function builds just the `lib/locale/locale-archive' file from + Glibc and nothing else. If `allLocales' is true, all supported + locales are included; otherwise, just the locales listed in + `locales'. See localedata/SUPPORTED in the Glibc source tree for + the list of all supported locales: + http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc +*/ + +{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }: + +let build = import ./common.nix; +in + build null { + name = "glibc-locales"; + + inherit fetchurl stdenv; + installLocales = true; + + builder = ./localesbuilder.sh; + + # Awful hack: `localedef' doesn't allow the path to `locale-archive' + # to be overriden, but you *can* specify a prefix, i.e. it will use + # //lib/locale/locale-archive. So we use + # $TMPDIR as a prefix, meaning that the locale-archive is placed in + # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. + buildPhase = + '' + mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" + make localedata/install-locales \ + LOCALEDEF="localedef --prefix=$TMPDIR" \ + localedir=$out/lib/locale \ + ${if allLocales then "" else "SUPPORTED-LOCALES=\"${toString locales}\""} + ''; + + installPhase = + '' + ensureDir "$out/lib/locale" + cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale" + ''; + + meta.description = "Locale information for the GNU C Library"; + } diff --git a/pkgs/development/libraries/glibc-2.10/localesbuilder.sh b/pkgs/development/libraries/glibc-2.10/localesbuilder.sh new file mode 100644 index 000000000000..d732e208fa22 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/localesbuilder.sh @@ -0,0 +1,17 @@ +# Glibc cannot have itself in its RPATH. +export NIX_NO_SELF_RPATH=1 + +source $stdenv/setup + +postConfigure() { + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS +} + +genericBuild diff --git a/pkgs/development/libraries/glibc-2.10/nss-skip-unavail.patch b/pkgs/development/libraries/glibc-2.10/nss-skip-unavail.patch new file mode 100644 index 000000000000..dc09b5098707 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/nss-skip-unavail.patch @@ -0,0 +1,25 @@ +diff -rc glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c +*** glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c 2008-07-30 21:14:22.000000000 +0200 +--- glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c 2008-12-10 11:39:32.000000000 +0100 +*************** +*** 505,512 **** + int no_data = 0; + int no_inet6_data = 0; + service_user *nip = NULL; +- enum nss_status inet6_status = NSS_STATUS_UNAVAIL; +- enum nss_status status = NSS_STATUS_UNAVAIL; + int no_more; + int old_res_options; + +--- 505,510 ---- +*************** +*** 702,707 **** +--- 700,707 ---- + + while (!no_more) + { ++ enum nss_status inet6_status = NSS_STATUS_UNAVAIL; ++ enum nss_status status = NSS_STATUS_UNAVAIL; + nss_gethostbyname4_r fct4 + = __nss_lookup_function (nip, "gethostbyname4_r"); + if (fct4 != NULL) diff --git a/pkgs/development/libraries/glibc-2.10/rpcgen-path.patch b/pkgs/development/libraries/glibc-2.10/rpcgen-path.patch new file mode 100644 index 000000000000..fbb03dd5fade --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/rpcgen-path.patch @@ -0,0 +1,72 @@ +By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths +(`/lib/cpp', etc.), which may only be overrided with the `-Y' option. This +patch makes it run any `cpp' command found in $PATH. + +--- glibc-2.7/sunrpc/rpc_main.c 2006-11-10 21:54:46.000000000 +0100 ++++ glibc-2.7/sunrpc/rpc_main.c 2009-04-22 14:32:10.000000000 +0200 +@@ -79,7 +79,7 @@ static const char *cmdname; + + static const char *svcclosetime = "120"; + static int cppDefined; /* explicit path for C preprocessor */ +-static const char *CPP = SUNOS_CPP; ++static const char *CPP = "cpp"; + static const char CPPFLAGS[] = "-C"; + static char *pathbuf; + static int cpp_pid; +@@ -108,7 +108,6 @@ static char *extendfile (const char *fil + static void open_output (const char *infile, const char *outfile); + static void add_warning (void); + static void clear_args (void); +-static void find_cpp (void); + static void open_input (const char *infile, const char *define); + static int check_nettype (const char *name, const char *list_to_check[]); + static void c_output (const char *infile, const char *define, +@@ -327,31 +326,6 @@ clear_args (void) + argcount = FIXEDARGS; + } + +-/* make sure that a CPP exists */ +-static void +-find_cpp (void) +-{ +- struct stat buf; +- +- if (stat (CPP, &buf) < 0) +- { /* /lib/cpp or explicit cpp does not exist */ +- if (cppDefined) +- { +- fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP); +- crash (); +- } +- else +- { /* try the other one */ +- CPP = SVR4_CPP; +- if (stat (CPP, &buf) < 0) +- { /* can't find any cpp */ +- fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout); +- crash (); +- } +- } +- } +-} +- + /* + * Open input file with given define for C-preprocessor + */ +@@ -370,7 +344,6 @@ open_input (const char *infile, const ch + switch (cpp_pid) + { + case 0: +- find_cpp (); + putarg (0, CPP); + putarg (1, CPPFLAGS); + addarg (define); +@@ -380,7 +353,7 @@ open_input (const char *infile, const ch + close (1); + dup2 (pd[1], 1); + close (pd[0]); +- execv (arglist[0], (char **) arglist); ++ execvp (arglist[0], (char **) arglist); + perror ("execv"); + exit (1); + case -1: diff --git a/pkgs/development/libraries/glibc-2.10/stack-protector-link.patch b/pkgs/development/libraries/glibc-2.10/stack-protector-link.patch new file mode 100644 index 000000000000..d200ece52df7 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.10/stack-protector-link.patch @@ -0,0 +1,12 @@ +Make sure `nscd' et al. are linked against `libssp'. + +--- glibc-2.11/nscd/Makefile 2009-10-30 18:17:08.000000000 +0100 ++++ glibc-2.11/nscd/Makefile 2009-11-22 01:19:37.000000000 +0100 +@@ -126,6 +126,7 @@ CFLAGS-res_hconf.c += $(nscd-cflags) + ifeq (yesyes,$(have-fpie)$(build-shared)) + relro-LDFLAGS += -Wl,-z,now + ++$(objpfx)nscd: LDFLAGS += -lssp + $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o)) + $(+link-pie) + endif diff --git a/pkgs/development/libraries/glibc-2.11/builder.sh b/pkgs/development/libraries/glibc-2.11/builder.sh new file mode 100644 index 000000000000..f8da3b8bbe2e --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/builder.sh @@ -0,0 +1,41 @@ +# Glibc cannot have itself in its RPATH. +export NIX_NO_SELF_RPATH=1 + +source $stdenv/setup + +postConfigure() { + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS +} + + +postInstall() { + if test -n "$installLocales"; then + make localedata/install-locales + fi + + test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache + + # Include the Linux kernel headers in Glibc, except the `scsi' + # subdirectory, which Glibc provides itself. + (cd $out/include && ln -s $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .) + + # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink + # "lib64" to "lib". + if test -n "$is64bit"; then + ln -s lib $out/lib64 + fi + + # This file, that should not remain in the glibc derivation, + # may have not been created during the preInstall + rm -f $out/lib/libgcc_s.so.1 +} + + +genericBuild diff --git a/pkgs/development/libraries/glibc-2.11/common.nix b/pkgs/development/libraries/glibc-2.11/common.nix new file mode 100644 index 000000000000..2fd3fbcbab9c --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/common.nix @@ -0,0 +1,152 @@ +/* Build configuration used to build glibc, Info files, and locale + information. */ + +cross : + +{ name, fetchurl, stdenv, installLocales ? false +, gccCross ? null, kernelHeaders ? null +, profilingLibraries ? false, meta +, preConfigure ? "", ... }@args : + +let version = "2.11.1"; in + +assert (cross != null) -> (gccCross != null); + +stdenv.mkDerivation ({ + inherit kernelHeaders installLocales; + + # The host/target system. + crossConfig = if (cross != null) then cross.config else null; + + inherit (stdenv) is64bit; + + patches = [ + /* Fix for NIXPKGS-79: when doing host name lookups, when + nsswitch.conf contains a line like + + hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 + + don't return an error when mdns4_minimal can't be found. This + is a bug in Glibc: when a service can't be found, NSS should + continue to the next service unless "UNAVAIL=return" is set. + ("NOTFOUND=return" refers to the service returning a NOTFOUND + error, not the service itself not being found.) The reason is + that the "status" variable (while initialised to UNAVAIL) is + outside of the loop that iterates over the services, the + "files" service sets status to NOTFOUND. So when the call to + find "mdns4_minimal" fails, "status" will still be NOTFOUND, + and it will return instead of continuing to "dns". Thus, the + line + + hosts: mdns4_minimal [NOTFOUND=return] dns mdns4 + + does work because "status" will contain UNAVAIL after the + failure to find mdns4_minimal. */ + ./nss-skip-unavail.patch + + /* Make it possible to override the locale-archive in NixOS. */ + ./locale-override.patch + + /* Have rpcgen(1) look for cpp(1) in $PATH. */ + ./rpcgen-path.patch + + /* Make sure `nscd' et al. are linked against `libssp'. */ + ./stack-protector-link.patch + + /* MOD_NANO definition, for ntp (taken from glibc upstream) */ + ./mod_nano.patch + ]; + + configureFlags = [ + "-C" + "--enable-add-ons" + (if kernelHeaders != null + then "--with-headers=${kernelHeaders}/include" + else "--without-headers") + (if profilingLibraries + then "--enable-profile" + else "--disable-profile") + ] ++ stdenv.lib.optionals (cross != null) [ + "--with-tls" + "--enable-kernel=2.6.0" + "--without-fp" + "--with-__thread" + ] ++ stdenv.lib.optionals (stdenv.system == "armv5tel-linux") [ + "--host=arm-linux-gnueabi" + "--build=arm-linux-gnueabi" + "--without-fp" + ]; + + buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]; + + # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to + # prevent a retained dependency on the bootstrap tools in the stdenv-linux + # bootstrap. + BASH_SHELL = "/bin/sh"; + + # Workaround for this bug: + # http://sourceware.org/bugzilla/show_bug.cgi?id=411 + # I.e. when gcc is compiled with --with-arch=i686, then the + # preprocessor symbol `__i686' will be defined to `1'. This causes + # the symbol __i686.get_pc_thunk.dx to be mangled. + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686"; +} + +// args // + +{ + name = name + "-${version}" + + stdenv.lib.optionalString (cross != null) "-${cross.config}"; + + src = fetchurl { + url = "mirror://gnu/glibc/glibc-${version}.tar.bz2"; + sha256 = "18azb6518ryqhkfmddr25p0h1s2msrmx7dblij58sjlnzh61vq34"; + }; + + srcPorts = fetchurl { + url = "mirror://gnu/glibc/glibc-ports-2.11.tar.bz2"; + sha256 = "12b53f5k4gcr8rr1kg2ycf2701rygqsyf9r8gz4j3l9flaqi5liq"; + }; + + # `fetchurl' is a function and thus should not be passed to the + # `derivation' primitive. + fetchurl = null; + + # Remove absolute paths from `configure' & co.; build out-of-tree. + preConfigure = '' + export PWD_P=$(type -tP pwd) + for i in configure io/ftwtest-sh; do + # Can't use substituteInPlace here because replace hasn't been + # built yet in the bootstrap. + sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" + done + + tar xvjf "$srcPorts" + + mkdir ../build + cd ../build + + configureScript="../$sourceRoot/configure" + + ${preConfigure} + ''; + + meta = { + homepage = http://www.gnu.org/software/libc/; + description = "The GNU C Library"; + + longDescription = + '' Any Unix-like operating system needs a C library: the library which + defines the "system calls" and other basic facilities such as + open, malloc, printf, exit... + + The GNU C library is used as the C library in the GNU system and + most systems with the Linux kernel. + ''; + + license = "LGPLv2+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.linux; + } // meta; +}) diff --git a/pkgs/development/libraries/glibc-2.11/default.nix b/pkgs/development/libraries/glibc-2.11/default.nix new file mode 100644 index 000000000000..9b4b4302a284 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/default.nix @@ -0,0 +1,56 @@ +{ stdenv, fetchurl, kernelHeaders +, installLocales ? true +, profilingLibraries ? false +, gccCross ? null +}: + +let + build = import ./common.nix; + cross = if gccCross != null then gccCross.target else null; +in + build cross ({ + name = "glibc"; + + inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries + gccCross; + + builder = ./builder.sh; + + # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for + # any program we run, because the gcc will have been placed at a new + # store path than that determined when built (as a source for the + # bootstrap-tools tarball) + # Building from a proper gcc staying in the path where it was installed, + # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without + # any special hack. + preInstall = '' + if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then + ensureDir $out/lib + ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 + fi + ''; + + meta.description = "The GNU C Library"; + } + + // + + (if cross != null + then { + preConfigure = '' + sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig" + + cat > config.cache << "EOF" + libc_cv_forced_unwind=yes + libc_cv_c_cleanup=yes + libc_cv_gnu89_inline=yes + EOF + export BUILD_CC=gcc + export CC="$crossConfig-gcc" + export AR="$crossConfig-ar" + export RANLIB="$crossConfig-ranlib" + + dontStrip=1 + ''; + } + else {})) diff --git a/pkgs/development/libraries/glibc-2.11/info.nix b/pkgs/development/libraries/glibc-2.11/info.nix new file mode 100644 index 000000000000..926598b37603 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/info.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl, texinfo, perl }: + +let build = import ./common.nix; +in + build { + name = "glibc-info"; + + inherit fetchurl stdenv; + + configureFlags = [ "--enable-add-ons" ]; + + buildInputs = [ texinfo perl ]; + + buildPhase = "make info"; + + # I don't know why the info is not generated in 'build' + # Somehow building the info still does not work, because the final + # libc.info hasn't a Top node. + installPhase = '' + ensureDir "$out/share/info" + cp -v "../$sourceRoot/manual/"*.info* "$out/share/info" + ''; + + meta.description = "GNU Info manual of the GNU C Library"; + } diff --git a/pkgs/development/libraries/glibc-2.11/locale-override.patch b/pkgs/development/libraries/glibc-2.11/locale-override.patch new file mode 100644 index 000000000000..108d0e35dacf --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/locale-override.patch @@ -0,0 +1,72 @@ +diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c +*** glibc-2.9-20081208-orig/locale/loadarchive.c 2005-09-09 18:56:52.000000000 +0200 +--- glibc-2.9-20081208/locale/loadarchive.c 2009-04-19 13:54:26.000000000 +0200 +*************** +*** 124,129 **** +--- 124,142 ---- + } + + ++ static int ++ open_locale_archive () ++ { ++ int fd = -1; ++ char *path = getenv ("LOCALE_ARCHIVE"); ++ if (path) ++ fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE); ++ if (fd < 0) ++ fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); ++ return fd; ++ } ++ ++ + /* Find the locale *NAMEP in the locale archive, and return the + internalized data structure for its CATEGORY data. If this locale has + already been loaded from the archive, just returns the existing data +*************** +*** 203,209 **** + archmapped = &headmap; + + /* The archive has never been opened. */ +! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); + if (fd < 0) + /* Cannot open the archive, for whatever reason. */ + return NULL; +--- 216,222 ---- + archmapped = &headmap; + + /* The archive has never been opened. */ +! fd = open_locale_archive (); + if (fd < 0) + /* Cannot open the archive, for whatever reason. */ + return NULL; +*************** +*** 394,400 **** + if (fd == -1) + { + struct stat64 st; +! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); + if (fd == -1) + /* Cannot open the archive, for whatever reason. */ + return NULL; +--- 407,413 ---- + if (fd == -1) + { + struct stat64 st; +! fd = open_locale_archive (); + if (fd == -1) + /* Cannot open the archive, for whatever reason. */ + return NULL; +diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h +*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h 2006-10-11 18:24:05.000000000 +0200 +--- glibc-2.9-20081208/sysdeps/generic/unsecvars.h 2009-04-19 13:55:34.000000000 +0200 +*************** +*** 16,21 **** +--- 16,22 ---- + "LD_SHOW_AUXV\0" \ + "LD_USE_LOAD_BIAS\0" \ + "LOCALDOMAIN\0" \ ++ "LOCALE_ARCHIVE\0" \ + "LOCPATH\0" \ + "MALLOC_TRACE\0" \ + "NIS_PATH\0" \ diff --git a/pkgs/development/libraries/glibc-2.11/locales-builder.sh b/pkgs/development/libraries/glibc-2.11/locales-builder.sh new file mode 100644 index 000000000000..d732e208fa22 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/locales-builder.sh @@ -0,0 +1,17 @@ +# Glibc cannot have itself in its RPATH. +export NIX_NO_SELF_RPATH=1 + +source $stdenv/setup + +postConfigure() { + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS +} + +genericBuild diff --git a/pkgs/development/libraries/glibc-2.11/locales.nix b/pkgs/development/libraries/glibc-2.11/locales.nix new file mode 100644 index 000000000000..821eddd41f0d --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/locales.nix @@ -0,0 +1,42 @@ +/* This function builds just the `lib/locale/locale-archive' file from + Glibc and nothing else. If `allLocales' is true, all supported + locales are included; otherwise, just the locales listed in + `locales'. See localedata/SUPPORTED in the Glibc source tree for + the list of all supported locales: + http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc +*/ + +{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }: + +let build = import ./common.nix; +in + build null { + name = "glibc-locales"; + + inherit fetchurl stdenv; + installLocales = true; + + builder = ./locales-builder.sh; + + # Awful hack: `localedef' doesn't allow the path to `locale-archive' + # to be overriden, but you *can* specify a prefix, i.e. it will use + # //lib/locale/locale-archive. So we use + # $TMPDIR as a prefix, meaning that the locale-archive is placed in + # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. + buildPhase = + '' + mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" + make localedata/install-locales \ + LOCALEDEF="localedef --prefix=$TMPDIR" \ + localedir=$out/lib/locale \ + ${if allLocales then "" else "SUPPORTED-LOCALES=\"${toString locales}\""} + ''; + + installPhase = + '' + ensureDir "$out/lib/locale" + cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale" + ''; + + meta.description = "Locale information for the GNU C Library"; + } diff --git a/pkgs/development/libraries/glibc-2.11/mod_nano.patch b/pkgs/development/libraries/glibc-2.11/mod_nano.patch new file mode 100644 index 000000000000..2fb35b3df38a --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/mod_nano.patch @@ -0,0 +1,31 @@ +commit 89b432d7a5befb85048c97e881b2106e8df58e43 +Author: Ulrich Drepper +Date: Sun Nov 22 10:23:12 2009 -0800 + + Fix up a bit more for recent API changes. + +diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h +index 5f10c7f..88b87f1 100644 +--- a/sysdeps/unix/sysv/linux/sys/timex.h ++++ b/sysdeps/unix/sysv/linux/sys/timex.h +@@ -85,6 +85,9 @@ struct timex + #define MOD_TIMECONST ADJ_TIMECONST + #define MOD_CLKB ADJ_TICK + #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ ++#define MOD_TAI ADJ_TAI ++#define MOD_MICRO ADJ_MICRO ++#define MOD_NANO ADJ_NANO + + + /* Status codes (timex.status) */ +@@ -108,8 +111,9 @@ struct timex + #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ + #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ + ++/* Read-only bits */ + #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ +- STA_PPSERROR | STA_CLOCKERR) /* read-only bits */ ++ STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) + + /* Clock states (time_state) */ + #define TIME_OK 0 /* clock synchronized, no leap second */ diff --git a/pkgs/development/libraries/glibc-2.11/nss-skip-unavail.patch b/pkgs/development/libraries/glibc-2.11/nss-skip-unavail.patch new file mode 100644 index 000000000000..dc09b5098707 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/nss-skip-unavail.patch @@ -0,0 +1,25 @@ +diff -rc glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c +*** glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c 2008-07-30 21:14:22.000000000 +0200 +--- glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c 2008-12-10 11:39:32.000000000 +0100 +*************** +*** 505,512 **** + int no_data = 0; + int no_inet6_data = 0; + service_user *nip = NULL; +- enum nss_status inet6_status = NSS_STATUS_UNAVAIL; +- enum nss_status status = NSS_STATUS_UNAVAIL; + int no_more; + int old_res_options; + +--- 505,510 ---- +*************** +*** 702,707 **** +--- 700,707 ---- + + while (!no_more) + { ++ enum nss_status inet6_status = NSS_STATUS_UNAVAIL; ++ enum nss_status status = NSS_STATUS_UNAVAIL; + nss_gethostbyname4_r fct4 + = __nss_lookup_function (nip, "gethostbyname4_r"); + if (fct4 != NULL) diff --git a/pkgs/development/libraries/glibc-2.11/rpcgen-path.patch b/pkgs/development/libraries/glibc-2.11/rpcgen-path.patch new file mode 100644 index 000000000000..fbb03dd5fade --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/rpcgen-path.patch @@ -0,0 +1,72 @@ +By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths +(`/lib/cpp', etc.), which may only be overrided with the `-Y' option. This +patch makes it run any `cpp' command found in $PATH. + +--- glibc-2.7/sunrpc/rpc_main.c 2006-11-10 21:54:46.000000000 +0100 ++++ glibc-2.7/sunrpc/rpc_main.c 2009-04-22 14:32:10.000000000 +0200 +@@ -79,7 +79,7 @@ static const char *cmdname; + + static const char *svcclosetime = "120"; + static int cppDefined; /* explicit path for C preprocessor */ +-static const char *CPP = SUNOS_CPP; ++static const char *CPP = "cpp"; + static const char CPPFLAGS[] = "-C"; + static char *pathbuf; + static int cpp_pid; +@@ -108,7 +108,6 @@ static char *extendfile (const char *fil + static void open_output (const char *infile, const char *outfile); + static void add_warning (void); + static void clear_args (void); +-static void find_cpp (void); + static void open_input (const char *infile, const char *define); + static int check_nettype (const char *name, const char *list_to_check[]); + static void c_output (const char *infile, const char *define, +@@ -327,31 +326,6 @@ clear_args (void) + argcount = FIXEDARGS; + } + +-/* make sure that a CPP exists */ +-static void +-find_cpp (void) +-{ +- struct stat buf; +- +- if (stat (CPP, &buf) < 0) +- { /* /lib/cpp or explicit cpp does not exist */ +- if (cppDefined) +- { +- fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP); +- crash (); +- } +- else +- { /* try the other one */ +- CPP = SVR4_CPP; +- if (stat (CPP, &buf) < 0) +- { /* can't find any cpp */ +- fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout); +- crash (); +- } +- } +- } +-} +- + /* + * Open input file with given define for C-preprocessor + */ +@@ -370,7 +344,6 @@ open_input (const char *infile, const ch + switch (cpp_pid) + { + case 0: +- find_cpp (); + putarg (0, CPP); + putarg (1, CPPFLAGS); + addarg (define); +@@ -380,7 +353,7 @@ open_input (const char *infile, const ch + close (1); + dup2 (pd[1], 1); + close (pd[0]); +- execv (arglist[0], (char **) arglist); ++ execvp (arglist[0], (char **) arglist); + perror ("execv"); + exit (1); + case -1: diff --git a/pkgs/development/libraries/glibc-2.11/stack-protector-link.patch b/pkgs/development/libraries/glibc-2.11/stack-protector-link.patch new file mode 100644 index 000000000000..d200ece52df7 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.11/stack-protector-link.patch @@ -0,0 +1,12 @@ +Make sure `nscd' et al. are linked against `libssp'. + +--- glibc-2.11/nscd/Makefile 2009-10-30 18:17:08.000000000 +0100 ++++ glibc-2.11/nscd/Makefile 2009-11-22 01:19:37.000000000 +0100 +@@ -126,6 +126,7 @@ CFLAGS-res_hconf.c += $(nscd-cflags) + ifeq (yesyes,$(have-fpie)$(build-shared)) + relro-LDFLAGS += -Wl,-z,now + ++$(objpfx)nscd: LDFLAGS += -lssp + $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o)) + $(+link-pie) + endif diff --git a/pkgs/development/libraries/glibc-2.9/binutils-2.20.patch b/pkgs/development/libraries/glibc-2.9/binutils-2.20.patch new file mode 100644 index 000000000000..ab3d6144d6ee --- /dev/null +++ b/pkgs/development/libraries/glibc-2.9/binutils-2.20.patch @@ -0,0 +1,42 @@ +Support GNU Binutils 2.20 and beyond. Patch from +http://sourceware.org/ml/libc-alpha/2009-09/msg00009.html . + +diff --git a/configure b/configure +index 48e6952..b1d84d7 100755 +--- a/configure ++++ b/configure +@@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; } + ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; +- 2.1[3-9]*) ++ 2.1[3-9]*|[2-9].[2-9]*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + +@@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; } + ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; +- 2.1[3-9]*) ++ 2.1[3-9]*|[2-9].[2-9]*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + +diff --git a/configure.in b/configure.in +index 4584afe..7c4f71f 100644 +--- a/configure.in ++++ b/configure.in +@@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in + # Accept binutils 2.13 or newer. + AC_CHECK_PROG_VER(AS, $AS, --version, + [GNU assembler.* \([0-9]*\.[0-9.]*\)], +- [2.1[3-9]*], AS=: critic_missing="$critic_missing as") ++ [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as") + AC_CHECK_PROG_VER(LD, $LD, --version, + [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)], +- [2.1[3-9]*], LD=: critic_missing="$critic_missing ld") ++ [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld") + + # We need the physical current working directory. We cannot use the + # "pwd -P" shell builtin since that's not portable. Instead we try to diff --git a/pkgs/development/libraries/glibc-2.9/binutils-ld.patch b/pkgs/development/libraries/glibc-2.9/binutils-ld.patch new file mode 100644 index 000000000000..ae70f145ce0d --- /dev/null +++ b/pkgs/development/libraries/glibc-2.9/binutils-ld.patch @@ -0,0 +1,33 @@ +From 7c8a67320e26b8c11108bf0a3410d3aef9cf3486 Mon Sep 17 00:00:00 2001 +From: Ulrich Drepper +Date: Sat, 31 Jan 2009 00:21:15 +0000 +Subject: [PATCH] * elf/Makefile (ld.so): Adjust the sed script to insert _begin in to + + newer linker scripts. +--- + ChangeLog | 5 +++++ + elf/Makefile | 4 ++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/elf/Makefile b/elf/Makefile +index 8079fe9..e44ff1d 100644 +--- a/elf/Makefile ++++ b/elf/Makefile +@@ -1,4 +1,4 @@ +-# Copyright (C) 1995-2007, 2008 Free Software Foundation, Inc. ++# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc. + # This file is part of the GNU C Library. + + # The GNU C Library is free software; you can redistribute it and/or +@@ -304,7 +304,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) + $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \ + LC_ALL=C \ + sed -e '/^=========/,/^=========/!d;/^=========/d' \ +- -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ ++ -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ + > $@.lds + $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \ + $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ +-- +1.6.4 + diff --git a/pkgs/development/libraries/glibc-2.9/builder.sh b/pkgs/development/libraries/glibc-2.9/builder.sh index 8cc6be4cf738..c81a3ac2a9e9 100644 --- a/pkgs/development/libraries/glibc-2.9/builder.sh +++ b/pkgs/development/libraries/glibc-2.9/builder.sh @@ -26,11 +26,32 @@ preConfigure() { # don't want as a dependency in the Nixpkgs bootstrap. So force # the output file to be newer. touch locale/C-translit.h + + tar xvjf "$srcPorts" - mkdir ../build - cd ../build + if test -n "$crossConfig"; then + sed -i s/-lgcc_eh//g Makeconfig + fi + + mkdir build + cd build - configureScript=../$sourceRoot/configure + configureScript=../configure + if test -n "$crossConfig"; then + cat > config.cache << "EOF" +libc_cv_forced_unwind=yes +libc_cv_c_cleanup=yes +libc_cv_gnu89_inline=yes +EOF + export BUILD_CC=gcc + export CC="${crossConfig}-gcc" + export AR="${crossConfig}-ar" + export RANLIB="${crossConfig}-ranlib" + configureFlags="${configureFlags} --cache-file=config.cache" + + # Disable the native stripping, because it breaks libc_nonshared.a + dontStrip=1 + fi } @@ -42,6 +63,7 @@ postConfigure() { export NIX_LDFLAGS_BEFORE= export NIX_DONT_SET_RPATH=1 + unset CFLAGS } @@ -49,7 +71,7 @@ postInstall() { if test -n "$installLocales"; then make localedata/install-locales fi - rm $out/etc/ld.so.cache + test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1 # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink diff --git a/pkgs/development/libraries/glibc-2.9/default.nix b/pkgs/development/libraries/glibc-2.9/default.nix index c94cedab018c..0cfad2990383 100644 --- a/pkgs/development/libraries/glibc-2.9/default.nix +++ b/pkgs/development/libraries/glibc-2.9/default.nix @@ -1,19 +1,29 @@ { stdenv, fetchurl, kernelHeaders , installLocales ? true , profilingLibraries ? false +, gccCross ? null }: - +let + cross = if gccCross != null then gccCross.target else null; +in stdenv.mkDerivation rec { - name = "glibc-2.9"; + name = "glibc-2.9" + + stdenv.lib.optionalString (cross != null) "-${cross.config}"; builder = ./builder.sh; src = fetchurl { - url = http://nixos.org/tarballs/glibc-2.9-20081208.tar.bz2; - sha256 = "0zhxbgcsl97pf349m0lz8d5ljvvzrcqc23yf08d888xlk4ms8m3h"; + url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2; + sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9"; + }; + + srcPorts = fetchurl { + url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2; + sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42"; }; inherit kernelHeaders installLocales; + crossConfig = if (cross != null) then cross.config else null; inherit (stdenv) is64bit; @@ -46,13 +56,38 @@ stdenv.mkDerivation rec { /* Have rpcgen(1) look for cpp(1) in $PATH. */ ./rpcgen-path.patch + + /* Support GNU Binutils 2.20 and above. */ + ./binutils-2.20.patch + + ./binutils-ld.patch ]; - configureFlags = '' - --enable-add-ons - --with-headers=${kernelHeaders}/include - ${if profilingLibraries then "--enable-profile" else "--disable-profile"} - ''; + configureFlags = [ + "--enable-add-ons" + "--with-headers=${kernelHeaders}/include" + (if profilingLibraries then "--enable-profile" else "--disable-profile") + ] ++ stdenv.lib.optionals (cross != null) [ + "--with-tls" + "--enable-kernel=2.6.0" + "--without-fp" + "--with-__thread" + ] ++ (if (stdenv.system == "armv5tel-linux") then [ + "--host=arm-linux-gnueabi" + "--build=arm-linux-gnueabi" + "--without-fp" + ] else []); + + buildNativeInputs = stdenv.lib.optionals (cross != null) [ gccCross ]; + + preInstall = if (cross != null) then '' + ensureDir $out/lib + ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 + '' else ""; + + postInstall = if (cross != null) then '' + rm $out/lib/libgcc_s.so.1 + '' else ""; # Workaround for this bug: # http://sourceware.org/bugzilla/show_bug.cgi?id=411 diff --git a/pkgs/development/libraries/glibc-2.9/headers.nix b/pkgs/development/libraries/glibc-2.9/headers.nix new file mode 100644 index 000000000000..adb9a22f4810 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.9/headers.nix @@ -0,0 +1,63 @@ +{ stdenv, fetchurl, kernelHeaders +, profilingLibraries ? false +}: + +stdenv.mkDerivation rec { + name = "glibc-headers-2.9"; + + builder = ./headersbuilder.sh; + + src = fetchurl { + url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2; + sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9"; + }; + + srcPorts = fetchurl { + url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2; + sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42"; + }; + + inherit kernelHeaders; + + inherit (stdenv) is64bit; + + patches = [ + /* Support GNU Binutils 2.20 and above. */ + ./binutils-2.20.patch + ]; + + configureFlags = [ + "--enable-add-ons" + "--with-headers=${kernelHeaders}/include" + "--disable-sanity-checks" + "--enable-hacker-mode" + (if profilingLibraries then "--enable-profile" else "--disable-profile") + ] ++ (if (stdenv.system == "armv5tel-linux") then [ + "--host=arm-linux-gnueabi" + "--build=arm-linux-gnueabi" + "--without-fp" + ] else []); + + buildPhase = "true"; + + # I took some tricks from crosstool-0.43 + installPhase = '' + make cross-compiling=yes CFLAGS=-DBOOTSTRAP_GCC install-headers + mkdir -p $out/include/gnu + touch $out/include/gnu/stubs.h + cp ../include/features.h $out/include/features.h + (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1 + ''; + + # Workaround for this bug: + # http://sourceware.org/bugzilla/show_bug.cgi?id=411 + # I.e. when gcc is compiled with --with-arch=i686, then the + # preprocessor symbol `__i686' will be defined to `1'. This causes + # the symbol __i686.get_pc_thunk.dx to be mangled. + NIX_CFLAGS_COMPILE = "-U__i686"; + + meta = { + homepage = http://www.gnu.org/software/libc/; + description = "The GNU C Library"; + }; +} diff --git a/pkgs/development/libraries/glibc-2.9/headersbuilder.sh b/pkgs/development/libraries/glibc-2.9/headersbuilder.sh new file mode 100644 index 000000000000..23f4bd4cc619 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.9/headersbuilder.sh @@ -0,0 +1,38 @@ +# Glibc cannot have itself in its RPATH. +export NIX_NO_SELF_RPATH=1 + +source $stdenv/setup + +# Explicitly tell glibc to use our pwd, not /bin/pwd. +export PWD_P=$(type -tP pwd) + +# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to +# prevent a retained dependency on the bootstrap tools in the +# stdenv-linux bootstrap. +export BASH_SHELL=/bin/sh + + +preConfigure() { + + for i in configure io/ftwtest-sh; do + # Can't use substituteInPlace here because replace hasn't been + # built yet in the bootstrap. + sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" + done + + # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older + # than C-translit.h.in, forcing Make to rebuild it unnecessarily. + # This wouldn't be problem except that it requires Perl, which we + # don't want as a dependency in the Nixpkgs bootstrap. So force + # the output file to be newer. + touch locale/C-translit.h + + tar xvjf "$srcPorts" + + mkdir build + cd build + + configureScript=../configure +} + +genericBuild diff --git a/pkgs/development/libraries/glibc-2.9/info.nix b/pkgs/development/libraries/glibc-2.9/info.nix index 9653690606ab..3201bb474405 100644 --- a/pkgs/development/libraries/glibc-2.9/info.nix +++ b/pkgs/development/libraries/glibc-2.9/info.nix @@ -8,6 +8,11 @@ stdenv.mkDerivation rec { sha256 = "0zhxbgcsl97pf349m0lz8d5ljvvzrcqc23yf08d888xlk4ms8m3h"; }; + patches = [ + /* Support GNU Binutils 2.20 and above. */ + ./binutils-2.20.patch + ]; + preConfigure = '' export PWD_P=$(type -tP pwd) for i in configure io/ftwtest-sh; do diff --git a/pkgs/development/libraries/glibc-2.9/locales.nix b/pkgs/development/libraries/glibc-2.9/locales.nix index a5ef4797810b..3046374ca345 100644 --- a/pkgs/development/libraries/glibc-2.9/locales.nix +++ b/pkgs/development/libraries/glibc-2.9/locales.nix @@ -10,13 +10,35 @@ stdenv.mkDerivation rec { name = "glibc-locales-2.9"; - + + builder = ./localesbuilder.sh; + src = fetchurl { - url = http://nixos.org/tarballs/glibc-2.9-20081208.tar.bz2; - sha256 = "0zhxbgcsl97pf349m0lz8d5ljvvzrcqc23yf08d888xlk4ms8m3h"; + url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2; + sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9"; }; - configurePhase = "true"; + srcPorts = fetchurl { + url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2; + sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42"; + }; + + inherit (stdenv) is64bit; + + configureFlags = [ + "--enable-add-ons" + "--without-headers" + "--disable-profile" + ] ++ (if (stdenv.system == "armv5tel-linux") then [ + "--host=arm-linux-gnueabi" + "--build=arm-linux-gnueabi" + "--without-fp" + ] else []); + + patches = [ + /* Support GNU Binutils 2.20 and above. */ + ./binutils-2.20.patch + ]; # Awful hack: `localedef' doesn't allow the path to `locale-archive' # to be overriden, but you *can* specify a prefix, i.e. it will use @@ -25,8 +47,6 @@ stdenv.mkDerivation rec { # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. buildPhase = '' - touch config.make - touch config.status mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" make localedata/install-locales \ LOCALEDEF="localedef --prefix=$TMPDIR" \ diff --git a/pkgs/development/libraries/glibc-2.9/localesbuilder.sh b/pkgs/development/libraries/glibc-2.9/localesbuilder.sh new file mode 100644 index 000000000000..a28f6bcbaeb3 --- /dev/null +++ b/pkgs/development/libraries/glibc-2.9/localesbuilder.sh @@ -0,0 +1,50 @@ +# Glibc cannot have itself in its RPATH. +export NIX_NO_SELF_RPATH=1 + +source $stdenv/setup + +# Explicitly tell glibc to use our pwd, not /bin/pwd. +export PWD_P=$(type -tP pwd) + +# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to +# prevent a retained dependency on the bootstrap tools in the +# stdenv-linux bootstrap. +export BASH_SHELL=/bin/sh + + +preConfigure() { + + for i in configure io/ftwtest-sh; do + # Can't use substituteInPlace here because replace hasn't been + # built yet in the bootstrap. + sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" + done + + # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older + # than C-translit.h.in, forcing Make to rebuild it unnecessarily. + # This wouldn't be problem except that it requires Perl, which we + # don't want as a dependency in the Nixpkgs bootstrap. So force + # the output file to be newer. + touch locale/C-translit.h + + tar xvjf "$srcPorts" + + mkdir build + cd build + + configureScript=../configure +} + + +postConfigure() { + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS +} + +genericBuild diff --git a/pkgs/development/libraries/gmp/default.nix b/pkgs/development/libraries/gmp/default.nix index 541fabddd441..7091306cfda1 100644 --- a/pkgs/development/libraries/gmp/default.nix +++ b/pkgs/development/libraries/gmp/default.nix @@ -1,14 +1,14 @@ {stdenv, fetchurl, m4, cxx ? true}: stdenv.mkDerivation rec { - name = "gmp-4.3.1"; + name = "gmp-4.3.2"; src = fetchurl { url = "mirror://gnu/gmp/${name}.tar.bz2"; - sha256 = "1j5pklq36ivg2cim5wfysns229a544lqkimp3mlzkwjl513ra0ma"; + sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck"; }; - buildInputs = [m4]; + buildNativeInputs = [m4]; preConfigure = "ln -sf configfsf.guess config.guess"; diff --git a/pkgs/development/libraries/gtk+/2.16.x.nix b/pkgs/development/libraries/gtk+/2.16.x.nix index b9f73184087b..9abbd3aa49d2 100644 --- a/pkgs/development/libraries/gtk+/2.16.x.nix +++ b/pkgs/development/libraries/gtk+/2.16.x.nix @@ -11,7 +11,8 @@ stdenv.mkDerivation rec { sha256 = "07gdsl3ialpwfcd0z3w108r60dn0agj12s21fpkpcx44lzknnbm3"; }; - buildInputs = [ pkgconfig perl jasper ]; + buildNativeInputs = [ perl ]; + buildInputs = [ pkgconfig jasper ]; propagatedBuildInputs = [ x11 glib atk pango libtiff libjpeg libpng cairo xlibs.libXrandr diff --git a/pkgs/development/libraries/gtk+/2.18.x.nix b/pkgs/development/libraries/gtk+/2.18.x.nix index b0d17bf45818..bb329ae8b14c 100644 --- a/pkgs/development/libraries/gtk+/2.18.x.nix +++ b/pkgs/development/libraries/gtk+/2.18.x.nix @@ -15,7 +15,8 @@ stdenv.mkDerivation rec { sha256 = "0k9mz46q97537kdpmz8j5bhrzpn3zjp7k4mni4niafdp2x4r8aan"; }; - buildInputs = [ pkgconfig perl jasper ]; + buildNativeInputs = [ perl ]; + buildInputs = [ pkgconfig jasper ]; propagatedBuildInputs = [ xlibs.xlibs glib atk pango libtiff libjpeg libpng cairo xlibs.libXrandr ] diff --git a/pkgs/development/libraries/icu/default.nix b/pkgs/development/libraries/icu/default.nix index 82ea06508f07..47217d7fa98a 100644 --- a/pkgs/development/libraries/icu/default.nix +++ b/pkgs/development/libraries/icu/default.nix @@ -10,6 +10,9 @@ stdenv.mkDerivation { patchFlags = "-p0"; + CFLAGS = "-O0"; + CXXFLAGS = "-O0"; + patches = [ (fetchurl { url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/dev-libs/icu/files/icu-3.8-setBreakType-public.diff?rev=1.1"; diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix index 9af09c8b3339..98dce86a2f82 100644 --- a/pkgs/development/libraries/libdrm/default.nix +++ b/pkgs/development/libraries/libdrm/default.nix @@ -10,6 +10,13 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig libpthreadstubs ]; + preConfigure = '' + # General case: non intel. + if test -n "$crossConfig"; then + configureFlags="$configureFlags --disable-intel"; + fi + ''; + meta = { homepage = http://dri.freedesktop.org/libdrm/; description = "Library for accessing the kernel's Direct Rendering Manager"; diff --git a/pkgs/development/libraries/libjpeg/default.nix b/pkgs/development/libraries/libjpeg/default.nix index 6e4ad9a0971b..bc3245cf76d8 100644 --- a/pkgs/development/libraries/libjpeg/default.nix +++ b/pkgs/development/libraries/libjpeg/default.nix @@ -1,15 +1,13 @@ -{ stdenv, fetchurl, libtool, static ? false }: +{ stdenv, fetchurl }: stdenv.mkDerivation { - name = "libjpeg-7"; + name = "libjpeg-8"; src = fetchurl { - url = http://www.ijg.org/files/jpegsrc.v7.tar.gz; - sha256 = "1gvy6f83pskxrxwnxqah3g9mhnlgi6aph39b99609gn50ri8ddsh"; + url = http://www.ijg.org/files/jpegsrc.v8.tar.gz; + sha256 = "1b0blpk8v397klssk99l6ddsb64krcb29pbkbp8ziw5kmjvsbfhp"; }; - configureFlags = "--enable-shared ${if static then " --enable-static" else ""}"; - meta = { homepage = http://www.ijg.org/; description = "A library that implements the JPEG image file format"; diff --git a/pkgs/development/libraries/libogg/default.nix b/pkgs/development/libraries/libogg/default.nix index fc4c77f9f2a3..aadc5f653fca 100644 --- a/pkgs/development/libraries/libogg/default.nix +++ b/pkgs/development/libraries/libogg/default.nix @@ -1,9 +1,9 @@ {stdenv, fetchurl}: stdenv.mkDerivation { - name = "libogg-1.1.3"; + name = "libogg-1.1.4"; src = fetchurl { - url = http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz; - md5 = "eaf7dc6ebbff30975de7527a80831585"; + url = http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz; + sha256 = "00z15ha73yfv7zn9z2z5yvc8g53ci6vn12vpc0l7qhc8zn1w2m4k"; }; } diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix index 87148e76059a..746266b92c74 100644 --- a/pkgs/development/libraries/libpng/default.nix +++ b/pkgs/development/libraries/libpng/default.nix @@ -3,11 +3,11 @@ assert zlib != null; stdenv.mkDerivation rec { - name = "libpng-1.2.40"; + name = "libpng-1.2.42"; src = fetchurl { url = "mirror://sourceforge/libpng/${name}.tar.gz"; - md5 = "a2f6808735bf404967f81519a967fb2a"; + md5 = "562066eb8557db91156eaeb309458488"; }; propagatedBuildInputs = [zlib]; @@ -20,3 +20,4 @@ stdenv.mkDerivation rec { license = "free-non-copyleft"; # http://www.libpng.org/pub/png/src/libpng-LICENSE.txt }; } + diff --git a/pkgs/development/libraries/libvorbis/default.nix b/pkgs/development/libraries/libvorbis/default.nix index 83925503ade4..9480a7ad700c 100644 --- a/pkgs/development/libraries/libvorbis/default.nix +++ b/pkgs/development/libraries/libvorbis/default.nix @@ -1,10 +1,10 @@ {stdenv, fetchurl, libogg}: stdenv.mkDerivation { - name = "libvorbis-1.2.0"; + name = "libvorbis-1.2.3"; src = fetchurl { - url = http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.bz2; - sha256 = "0nq62b8y2rhhgxxyiw6b4wchic61q5v649fdl8dd7090nxxcbx4y"; + url = http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.bz2; + sha256 = "0aj9jfxsp89vs78321sqvj8my4bxcb7pjr959nhi9wj0r032gyfv"; }; propagatedBuildInputs = [ libogg ]; diff --git a/pkgs/development/libraries/libxcrypt/default.nix b/pkgs/development/libraries/libxcrypt/default.nix index 7124fc72eeed..1ae5d3054f48 100644 --- a/pkgs/development/libraries/libxcrypt/default.nix +++ b/pkgs/development/libraries/libxcrypt/default.nix @@ -1,4 +1,7 @@ {stdenv, fetchurl}: + +# I could not build it in armv5tel-linux +assert stdenv.system != "armv5tel-linux"; stdenv.mkDerivation { name = "libxcrypt-3.0.2"; diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index b428578c5626..dea0113cc69f 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -1,14 +1,16 @@ {stdenv, fetchurl, gmp}: -stdenv.mkDerivation { - name = "mpfr-2.4.1"; +stdenv.mkDerivation rec { + name = "mpfr-2.4.2"; src = fetchurl { - url = http://www.mpfr.org/mpfr-2.4.1/mpfr-2.4.1.tar.bz2; - sha256 = "0pj879vbwbik8xkgnxy2ll32ljq3bgqjsqapqasq9rkfbkl90a34"; + url = "mirror://gnu/mpfr/${name}.tar.bz2"; + sha256 = "1fpjphja2ridy1wfc53mcbavj4axl28ibvnawj1217flm045mry7"; }; - buildInputs = [gmp]; + buildInputs = [ gmp ]; + + doCheck = true; meta = { homepage = http://www.mpfr.org/; diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index d82c9de81f23..2e6de49958ed 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { --with-shared --includedir=''${out}/include --without-debug ${if unicode then "--enable-widec" else ""} ''; + + selfBuildNativeInput = true; preBuild = ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile''; @@ -19,10 +21,10 @@ stdenv.mkDerivation rec { # compatibility links from the the "normal" libraries to the # wide-character libraries (e.g. libncurses.so to libncursesw.so). postInstall = if unicode then '' - chmod -v 644 $out/lib/libncurses++w.a + chmod 644 $out/lib/libncurses++w.a for lib in curses ncurses form panel menu; do if test -e $out/lib/lib''${lib}w.a; then - rm -vf $out/lib/lib$lib.so + rm -f $out/lib/lib$lib.so echo "INPUT(-l''${lib}w)" > $out/lib/lib$lib.so ln -svf lib''${lib}w.a $out/lib/lib$lib.a ln -svf lib''${lib}w.so.5 $out/lib/lib$lib.so.5 diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix new file mode 100644 index 000000000000..244c3886822b --- /dev/null +++ b/pkgs/development/libraries/opencv/default.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, cmake, gtk, glib, libjpeg, libpng, libtiff, jasper, ffmpeg, pkgconfig, + xineLib, gstreamer }: + +stdenv.mkDerivation rec { + name = "opencv-2.0.0"; + + src = fetchurl { + url = "mirror://sourceforge/opencvlibrary/OpenCV-2.0.0.tar.bz2"; + sha256 = "08h03qzawj6zwifrh8rq66y4cya1kxx9ixrbq7phlac79nbvjzf1"; + }; + + buildInputs = [ cmake gtk glib libjpeg libpng libtiff jasper ffmpeg pkgconfig + xineLib gstreamer ]; + + meta = { + description = "Open Computer Vision Library with more than 500 algorithms"; + homepage = http://opencv.willowgarage.com/; + license = "BSD"; + }; +} diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 61fa64141d61..e9d75b78ebf2 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -1,14 +1,16 @@ -{stdenv, fetchurl, perl}: +{ stdenv, fetchurl, perl }: -stdenv.mkDerivation (rec { - name = "openssl-0.9.8k"; +stdenv.mkDerivation rec { + name = "openssl-0.9.8l"; src = fetchurl { - url = http://www.openssl.org/source/openssl-0.9.8k.tar.gz; - sha1 = "3ba079f91d3c1ec90a36dcd1d43857165035703f"; + url = "http://www.openssl.org/source/${name}.tar.gz"; + sha1 = "d3fb6ec89532ab40646b65af179bb1770f7ca28f"; }; + + patches = [ ./darwin-arch.patch ]; - buildInputs = [perl]; + buildInputs = [ perl ]; configureScript = "./config"; @@ -18,4 +20,4 @@ stdenv.mkDerivation (rec { homepage = http://www.openssl.org/; description = "A cryptographic library that implements the SSL and TLS protocols"; }; -} // (if stdenv.isDarwin then { patches = [ ./darwin-arch.patch ]; } else {})) +} diff --git a/pkgs/development/libraries/physfs/default.nix b/pkgs/development/libraries/physfs/default.nix index 3eb9a980c819..79ddf9cfe11a 100644 --- a/pkgs/development/libraries/physfs/default.nix +++ b/pkgs/development/libraries/physfs/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "072hqprni4vf4ax6b659s2xxrbz0y6iziarsczawbhi69m4azpyb"; }; - buildInputs = [ cmake ]; + buildNativeInputs = [ cmake ]; meta = { homepage = http://icculus.org/physfs/; diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix index 0d1c920b635d..ed4cc7f24978 100644 --- a/pkgs/development/libraries/ppl/default.nix +++ b/pkgs/development/libraries/ppl/default.nix @@ -15,7 +15,7 @@ let version = "0.10.2"; in # Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz # x86_64 box. Nevertheless, being a dependency of GCC, it probably ought # to be tested. - doCheck = true; + doCheck = false; meta = { description = "PPL: The Parma Polyhedra Library"; diff --git a/pkgs/development/libraries/qtscriptgenerator/default.nix b/pkgs/development/libraries/qtscriptgenerator/default.nix index 52605a7eb0cf..75bd7b4dc7fb 100644 --- a/pkgs/development/libraries/qtscriptgenerator/default.nix +++ b/pkgs/development/libraries/qtscriptgenerator/default.nix @@ -7,6 +7,8 @@ stdenv.mkDerivation { sha256 = "0h8zjh38n2wfz7jld0jz6a09y66dbsd2jhm4f2024qfgcmxcabj6"; }; buildInputs = [ qt4 ]; + + patches = [./qtscriptgenerator.gcc-4.4.patch]; # Why isn't the author providing proper Makefile or a CMakeLists.txt ? buildPhase = '' diff --git a/pkgs/development/libraries/qtscriptgenerator/qtscriptgenerator.gcc-4.4.patch b/pkgs/development/libraries/qtscriptgenerator/qtscriptgenerator.gcc-4.4.patch new file mode 100644 index 000000000000..c0a710efb157 --- /dev/null +++ b/pkgs/development/libraries/qtscriptgenerator/qtscriptgenerator.gcc-4.4.patch @@ -0,0 +1,11 @@ +diff -uNr generator.orig/parser/rpp/pp.h generator/parser/rpp/pp.h +--- qtscriptgenerator-src-0.1.0/generator.orig/parser/rpp/pp.h 2008-12-05 11:01:44.000000000 +0100 ++++ qtscriptgenerator-src-0.1.0/generator/parser/rpp/pp.h 2008-12-13 10:42:22.000000000 +0100 +@@ -30,6 +30,7 @@ + #include + + #include ++#include + + #ifdef HAVE_MMAP + # include diff --git a/pkgs/development/libraries/readline/link-against-ncurses.patch b/pkgs/development/libraries/readline/link-against-ncurses.patch new file mode 100644 index 000000000000..0fd0598f4650 --- /dev/null +++ b/pkgs/development/libraries/readline/link-against-ncurses.patch @@ -0,0 +1,18 @@ +This patch is to make sure that `libncurses' is among the `NEEDED' +dependencies of `libreadline.so' and `libhistory.so'. + +Failing to do that, applications linking against Readline are +forced to explicitly link against libncurses as well; in addition, +this trick doesn't work when using GNU ld's `--as-needed'. + +--- shlib/Makefile.in 2009-01-06 18:03:22.000000000 +0100 ++++ shlib/Makefile.in 2009-07-27 14:43:25.000000000 +0200 +@@ -84,7 +84,7 @@ SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@ + SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@ + SHOBJ_LIBS = @SHOBJ_LIBS@ + +-SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@ ++SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@ -lncurses + SHLIB_LIBS = @SHLIB_LIBS@ + + SHLIB_DOT = @SHLIB_DOT@ diff --git a/pkgs/development/libraries/readline/readline-patches.nix b/pkgs/development/libraries/readline/readline-patches.nix new file mode 100644 index 000000000000..b8019fb33502 --- /dev/null +++ b/pkgs/development/libraries/readline/readline-patches.nix @@ -0,0 +1,4 @@ +# Automatically generated by `update-patch-set.sh'; do not edit. + +patch: [ +] diff --git a/pkgs/development/libraries/readline/readline6.nix b/pkgs/development/libraries/readline/readline6.nix index fcf89207da3c..18118abedd98 100644 --- a/pkgs/development/libraries/readline/readline6.nix +++ b/pkgs/development/libraries/readline/readline6.nix @@ -1,15 +1,28 @@ { fetchurl, stdenv, ncurses }: stdenv.mkDerivation rec { - name = "readline-6.0"; + name = "readline-6.1"; src = fetchurl { url = "mirror://gnu/readline/${name}.tar.gz"; - sha256 = "1pn13j6f9376kwki69050x3zh62yb1w31l37rws5nwr5q02xk68i"; + sha256 = "0sd97zqdh4fc0zzgzpskkczwa2fmb0s89qdyndb6vkbcq04gdjph"; }; propagatedBuildInputs = [ncurses]; - + + patchFlags = "-p0"; + patches = + [ ./link-against-ncurses.patch ] + ++ + (let + patch = nr: sha256: + fetchurl { + url = "mirror://gnu/readline/${name}-patches/readline61-${nr}"; + inherit sha256; + }; + in + import ./readline-patches.nix patch); + meta = { description = "GNU Readline, a library for interactive line editing"; @@ -31,5 +44,7 @@ stdenv.mkDerivation rec { homepage = http://savannah.gnu.org/projects/readline/; license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index f59182c2ba58..b4ae9e63ea08 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -8,6 +8,13 @@ stdenv.mkDerivation { }; configureFlags = if static then "" else "--shared"; + preConfigure = '' + if test -n "$crossConfig"; then + export CC=$crossConfig-gcc + configureFlags=${if static then "" else "--shared"} + fi + ''; + # zlib doesn't like the automatic --disable-shared from the Cygwin stdenv. cygwinConfigureEnableShared = true; } diff --git a/pkgs/development/python-modules/rhpl/default.nix b/pkgs/development/python-modules/rhpl/default.nix index a577d3ac7b97..7b33932492b9 100644 --- a/pkgs/development/python-modules/rhpl/default.nix +++ b/pkgs/development/python-modules/rhpl/default.nix @@ -2,11 +2,15 @@ stdenv.mkDerivation { name = "rhpl-0.218"; + src = fetchurl { url = http://ftp.stw-bonn.de/pub/fedora/linux/releases/10/Everything/source/SRPMS/rhpl-0.218-1.src.rpm; md5 = "a72c6b66df782ca1d4950959d2aad292"; }; + inherit python; + builder = ./builder.sh; + buildInputs = [ rpm cpio python wirelesstools gettext ]; } diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix index ebd2d3ab07e0..fdf2bf1777f2 100644 --- a/pkgs/development/tools/analysis/valgrind/default.nix +++ b/pkgs/development/tools/analysis/valgrind/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, gdb }: +{ stdenv, fetchurl, perl, gdb, autoconf, automake }: stdenv.mkDerivation rec { name = "valgrind-3.5.0"; @@ -8,9 +8,14 @@ stdenv.mkDerivation rec { sha256 = "105s4y6h5rsfvml1dfhsjvqgsxvnclbnxbpgk8b4ghpbpcr52fkl"; }; + # Make Valgrind compile with Glibc 2.11. + patches = [ ./glibc-2.11.patch ]; + patchFlags = "-p0"; + preConfigure = "autoreconf"; + # Perl is needed for `cg_annotate'. # GDB is needed to provide a sane default for `--db-command'. - buildInputs = [ perl ] ++ stdenv.lib.optional (!stdenv.isDarwin) gdb; + buildInputs = [ perl autoconf automake ] ++ stdenv.lib.optional (!stdenv.isDarwin) gdb; configureFlags = if stdenv.system == "x86_64-linux" then ["--enable-only64bit"] else []; diff --git a/pkgs/development/tools/analysis/valgrind/glibc-2.11.patch b/pkgs/development/tools/analysis/valgrind/glibc-2.11.patch new file mode 100644 index 000000000000..e2ce53217c9e --- /dev/null +++ b/pkgs/development/tools/analysis/valgrind/glibc-2.11.patch @@ -0,0 +1,53 @@ +r10941 from svn://svn.valgrind.org/valgrind/trunk + +------------------------------------------------------------------------ +r10941 | bart | 2009-11-15 20:11:19 +0100 (Sun, 15 Nov 2009) | 2 lines + +Added support for glibc 2.11. + +------------------------------------------------------------------------ + +Index: configure.in +=================================================================== +--- configure.in (revision 10940) ++++ configure.in (revision 10941) +@@ -656,6 +656,16 @@ + ], + GLIBC_VERSION="2.10") + ++AC_EGREP_CPP([GLIBC_211], [ ++#include ++#ifdef __GNU_LIBRARY__ ++ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 11) ++ GLIBC_211 ++ #endif ++#endif ++], ++GLIBC_VERSION="2.11") ++ + AC_EGREP_CPP([AIX5_LIBC], [ + #include + #if defined(_AIXVERSION_510) || defined(_AIXVERSION_520) || defined(_AIXVERSION_530) +@@ -742,6 +752,13 @@ + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" + ;; ++ 2.11) ++ AC_MSG_RESULT(2.11 family) ++ AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x]) ++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" ++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" ++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ++ ;; + aix5) + AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3) + AC_DEFINE([AIX5_LIBC], 1, [Define to 1 if you're using AIX 5.1 or 5.2 or 5.3]) +@@ -755,7 +772,7 @@ + + *) + AC_MSG_RESULT(unsupported version) +- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.10]) ++ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.11]) + AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 GLIBC_VERSION]) + AC_MSG_ERROR([or Darwin libc]) + ;; diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 662c97bc2f62..892af7735187 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -32,6 +32,13 @@ cmakeConfigurePhase() cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix $cmakeFlags" fi + if test -n "$crossConfig"; then + # By now it supports linux builds only. We should set the proper + # CMAKE_SYSTEM_NAME otherwise. + # http://www.cmake.org/Wiki/CMake_Cross_Compiling + cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-g++ -DCMAKE_C_COMPILER=$crossConfig-gcc $cmakeFlags" + fi + # Avoid cmake resetting the rpath of binaries, on make install cmakeFlags="-DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags" @@ -46,4 +53,8 @@ if test -z "$dontUseCmakeConfigure"; then configurePhase=cmakeConfigurePhase fi -envHooks=(${envHooks[@]} addCMakeParams) +if test -n "$crossConfig"; then + crossEnvHooks=(${crossEnvHooks[@]} addCMakeParams) +else + envHooks=(${envHooks[@]} addCMakeParams) +fi diff --git a/pkgs/development/tools/misc/autoconf/2.13.nix b/pkgs/development/tools/misc/autoconf/2.13.nix index 6bca865d8ed4..1dfe4d4a0a7b 100644 --- a/pkgs/development/tools/misc/autoconf/2.13.nix +++ b/pkgs/development/tools/misc/autoconf/2.13.nix @@ -9,8 +9,6 @@ stdenv.mkDerivation rec { }; buildInputs = [m4 perl lzma]; - - unpackCmd = "lzma -d < $src | tar -x "; doCheck = true; diff --git a/pkgs/development/tools/misc/binutils/as-pr10856.patch b/pkgs/development/tools/misc/binutils/as-pr10856.patch new file mode 100644 index 000000000000..695d3e356706 --- /dev/null +++ b/pkgs/development/tools/misc/binutils/as-pr10856.patch @@ -0,0 +1,83 @@ +Fix a regression in GNU as: +http://sourceware.org/bugzilla/show_bug.cgi?id=10856 . + +The bug appears to be responsible for invalid code generated for +Crypto++: +http://groups.google.com/group/cryptopp-users/browse_thread/thread/7ce734e479586640/29c6649b7c7adee2?#29c6649b7c7adee2 . + +diff -u -r1.77.2.1 -r1.77.2.2 +--- a/gas/expr.c 2009/09/11 15:28:43 1.77.2.1 ++++ b/gas/expr.c 2009/10/28 08:23:48 1.77.2.2 +@@ -1997,6 +1997,7 @@ + /* Help out with CSE. */ + valueT final_val = expressionP->X_add_number; + symbolS *add_symbol = expressionP->X_add_symbol; ++ symbolS *orig_add_symbol = add_symbol; + symbolS *op_symbol = expressionP->X_op_symbol; + operatorT op = expressionP->X_op; + valueT left, right; +@@ -2078,6 +2079,7 @@ + left = right; + seg_left = seg_right; + add_symbol = op_symbol; ++ orig_add_symbol = expressionP->X_op_symbol; + op = O_symbol; + break; + } +@@ -2122,18 +2124,19 @@ + { + if (op == O_bit_exclusive_or || op == O_bit_inclusive_or) + { +- if (seg_right != absolute_section || right != 0) ++ if (!(seg_right == absolute_section && right == 0)) + { + seg_left = seg_right; + left = right; + add_symbol = op_symbol; ++ orig_add_symbol = expressionP->X_op_symbol; + } + op = O_symbol; + break; + } + else if (op == O_left_shift || op == O_right_shift) + { +- if (seg_left != absolute_section || left != 0) ++ if (!(seg_left == absolute_section && left == 0)) + { + op = O_symbol; + break; +@@ -2149,6 +2152,7 @@ + seg_left = seg_right; + left = right; + add_symbol = op_symbol; ++ orig_add_symbol = expressionP->X_op_symbol; + op = O_symbol; + break; + } +@@ -2158,11 +2162,11 @@ + op = O_symbol; + break; + } +- else if (left != right +- || ((seg_left != reg_section || seg_right != reg_section) +- && (seg_left != undefined_section +- || seg_right != undefined_section +- || add_symbol != op_symbol))) ++ else if (!(left == right ++ && ((seg_left == reg_section && seg_right == reg_section) ++ || (seg_left == undefined_section ++ && seg_right == undefined_section ++ && add_symbol == op_symbol)))) + return 0; + else if (op == O_bit_and || op == O_bit_inclusive_or) + { +@@ -2233,7 +2237,8 @@ + op = O_constant; + else if (seg_left == reg_section && final_val == 0) + op = O_register; +- else if (add_symbol != expressionP->X_add_symbol) ++ else if (seg_left == undefined_section ++ && add_symbol != orig_add_symbol) + final_val += left; + expressionP->X_add_symbol = add_symbol; + } diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 5bf14919f851..1bb110e35fd3 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -1,11 +1,14 @@ -{stdenv, fetchurl, noSysDirs}: +{stdenv, fetchurl, noSysDirs, cross ? null}: +let + basename = "binutils-2.20"; +in stdenv.mkDerivation rec { - name = "binutils-2.19.1"; - + name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}"; + src = fetchurl { - url = "mirror://gnu/binutils/${name}.tar.bz2"; - sha256 = "1xirhxwc94bk6hn2k6i5ly4knbcjsqgy2lp7kl1s5q5csys2b0iy"; + url = "mirror://gnu/binutils/${basename}.tar.bz2"; + sha256 = "1c3m789p5rwmmnck5ms4zcnc40axss3gxzivz571al1vmbq0kpz1"; }; patches = [ @@ -13,18 +16,27 @@ stdenv.mkDerivation rec { # RUNPATH instead of RPATH on binaries. This is important because # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime. ./new-dtags.patch + + ./as-pr10856.patch ]; - + inherit noSysDirs; preConfigure = '' # Clear the default library search path. if test "$noSysDirs" = "1"; then - echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt + echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt fi + + # Use symlinks instead of hard links to save space ("strip" in the + # fixup phase strips each hard link separately). + for i in binutils/Makefile.in gas/Makefile.in ld/Makefile.in; do + substituteInPlace $i --replace 'ln ' 'ln -s ' + done ''; - - configureFlags = "--disable-werror"; # needed for dietlibc build + + configureFlags = "--disable-werror" # needed for dietlibc build + + stdenv.lib.optionalString (cross != null) " --target=${cross.config}"; meta = { description = "GNU Binutils, tools for manipulating binaries (linker, assembler, etc.)"; diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index e4163f020c00..c898651da528 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -1,10 +1,15 @@ -{ fetchurl, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo }: +{ fetchurl, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo +, target ? null }: +let + basename = "gdb-7.0"; +in stdenv.mkDerivation rec { - name = "gdb-7.0"; + name = basename + stdenv.lib.optionalString (target != null) + ("-" + target.config); src = fetchurl { - url = "mirror://gnu/gdb/${name}.tar.bz2"; + url = "mirror://gnu/gdb/${basename}.tar.bz2"; sha256 = "1k9y271gnnvi0fny8ycydcd79snigwh88rgwi03ad782r2awcl67"; }; @@ -14,7 +19,8 @@ stdenv.mkDerivation rec { configureFlags = '' --with-gmp=${gmp} --with-mpfr=${mpfr} --with-system-readline --with-expat --with-libexpat-prefix=${expat} - ''; + '' + stdenv.lib.optionalString (target != null) + " --target=${target.config}"; postInstall = '' # Remove Info files already provided by Binutils and other packages. diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix index 8661404766ea..c89fe7e280c3 100644 --- a/pkgs/development/tools/misc/libtool/libtool2.nix +++ b/pkgs/development/tools/misc/libtool/libtool2.nix @@ -1,21 +1,23 @@ { stdenv, fetchurl, m4, perl, lzma }: stdenv.mkDerivation rec { - name = "libtool-2.2.6a"; - + name = "libtool-2.2.6b"; + src = fetchurl { url = "mirror://gnu/libtool/${name}.tar.lzma"; - sha256 = "12k3m7d0ngcwwahicncxbyd1155ij63ylr8372f0q8xbzq59c8hx"; + sha256 = "1bmpp31sfjl3nzj8psvnsqrrv4gwnqzii8dxpxr6djz508yavsv6"; }; - - buildInputs = [ lzma m4 perl ]; - unpackCmd = "lzma -d < $src | tar xv"; + buildNativeInputs = [ lzma m4 perl ]; # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the # "fixed" path in generated files! dontPatchShebangs = true; + # XXX: The GNU ld wrapper does all sorts of nasty things wrt. RPATH, which + # leads to the failure of a number of tests. + doCheck = false; + meta = { description = "GNU Libtool, a generic library support script"; @@ -32,5 +34,7 @@ stdenv.mkDerivation rec { homepage = http://www.gnu.org/software/libtool/; license = "GPLv2+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/development/tools/misc/patchelf/0.5.nix b/pkgs/development/tools/misc/patchelf/0.5.nix deleted file mode 100644 index a2b06d7f2883..000000000000 --- a/pkgs/development/tools/misc/patchelf/0.5.nix +++ /dev/null @@ -1,16 +0,0 @@ -{stdenv, fetchurl}: - -stdenv.mkDerivation { - name = "patchelf-0.5pre15975"; - - src = fetchurl { - url = http://hydra.nixos.org/build/35275/download/1/patchelf-0.5pre15975.tar.bz2; - sha256 = "fa945392386c484b670c1182e354f0738b03db54d51ed6cc7ff9ebd645a20ecb"; - }; - - meta = { - homepage = http://nixos.org/patchelf.html; - license = "GPL"; - description = "A small utility to modify the dynamic linker and RPATH of ELF executables"; - }; -} diff --git a/pkgs/development/tools/misc/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix index 91832cd45a78..43944ca9acd3 100644 --- a/pkgs/development/tools/misc/patchelf/default.nix +++ b/pkgs/development/tools/misc/patchelf/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl}: -stdenv.mkDerivation { - name = "patchelf-0.4"; +stdenv.mkDerivation rec { + name = "patchelf-0.5"; src = fetchurl { - url = http://nixos.org/releases/patchelf/patchelf-0.4/patchelf-0.4.tar.bz2; - sha256 = "65c455b62fc52292e2488f05f46e7e38c46fdcf69c002750f5887145284c4f85"; + url = "http://nixos.org/releases/patchelf/${name}/${name}.tar.bz2"; + sha256 = "24b9a850af45e1a277e234b9eb090b52305a2e1c6b02addeb3ae98b4b49d37ce"; }; meta = { diff --git a/pkgs/development/tools/misc/pkgconfig/setup-hook.sh b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh index ea592b36d11e..77a69fb18781 100644 --- a/pkgs/development/tools/misc/pkgconfig/setup-hook.sh +++ b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh @@ -3,4 +3,8 @@ addPkgConfigPath () { addToSearchPath PKG_CONFIG_PATH $1/share/pkgconfig } -envHooks=(${envHooks[@]} addPkgConfigPath) +if test -n "$crossConfig"; then + crossEnvHooks=(${crossEnvHooks[@]} addPkgConfigPath) +else + envHooks=(${envHooks[@]} addPkgConfigPath) +fi diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix index 38c4445d2200..43ddb2190c1d 100644 --- a/pkgs/development/tools/misc/strace/default.nix +++ b/pkgs/development/tools/misc/strace/default.nix @@ -1,10 +1,16 @@ -{stdenv, fetchurl}: +{ stdenv, fetchurl }: -stdenv.mkDerivation { - name = "strace-4.5.18"; +stdenv.mkDerivation rec { + name = "strace-4.5.19"; src = fetchurl { - url = mirror://sourceforge/strace/strace-4.5.18.tar.bz2; - sha256 = "1l16vax3mn2wak288g1inmn30i49vlghnvfwr0z2rwh41r3vgrwm"; + url = "mirror://sourceforge/strace/${name}.tar.bz2"; + sha256 = "021x06jyvpg156kf6ndbd370nz4w3xp6q06pbk20w6wpks8wx5w9"; + }; + + meta = { + homepage = http://strace.sourceforge.net/; + description = "A system call tracer for Linux"; + license = "bsd"; }; } diff --git a/pkgs/development/tools/misc/texinfo/default.nix b/pkgs/development/tools/misc/texinfo/default.nix index 9f154684f2c4..c9bf4eea4053 100644 --- a/pkgs/development/tools/misc/texinfo/default.nix +++ b/pkgs/development/tools/misc/texinfo/default.nix @@ -10,8 +10,6 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses lzma ]; - unpackCmd = "lzma -d < $src | tar xv"; - # Disabled because we don't have zdiff in the stdenv bootstrap. #doCheck = true; diff --git a/pkgs/development/tools/parsing/bison/bison-2.3.nix b/pkgs/development/tools/parsing/bison/bison-2.3.nix index ae90f2e83d0e..fcf4ed107959 100644 --- a/pkgs/development/tools/parsing/bison/bison-2.3.nix +++ b/pkgs/development/tools/parsing/bison/bison-2.3.nix @@ -8,7 +8,9 @@ stdenv.mkDerivation { url = mirror://gnu/bison/bison-2.3.tar.bz2; md5 = "c18640c6ec31a169d351e3117ecce3ec"; }; - buildInputs = [m4]; + + buildNativeInputs = [m4]; + propagatedBuildInputs = [m4]; meta = { description = "GNU Bison, a Yacc-compatible parser generator"; diff --git a/pkgs/lib/attrsets.nix b/pkgs/lib/attrsets.nix index 53d13e42d856..c19033682919 100644 --- a/pkgs/lib/attrsets.nix +++ b/pkgs/lib/attrsets.nix @@ -2,9 +2,11 @@ with { inherit (builtins) head tail isString; + inherit (import ./trivial.nix) or; inherit (import ./default.nix) fold; inherit (import ./strings.nix) concatStringsSep; inherit (import ./lists.nix) concatMap; + inherit (import ./misc.nix) eqStrict; }; rec { @@ -260,4 +262,12 @@ rec { !(isAttrs lhs && isAttrs rhs) ) lhs rhs; + matchAttrs = pattern: attrs: + fold or false (attrValues (zipAttrsWithNames (attrNames pattern) (n: values: + let pat = head values; val = head (tail values); in + if tail values == [] then false + else if isAttrs pat then isAttrs val && matchAttrs head values + else eqStrict pat val + ) [pattern attrs])); + } diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index 3c760964a289..6276009ec190 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -15,14 +15,16 @@ let misc = import ./misc.nix; maintainers = import ./maintainers.nix; platforms = import ./platforms.nix; + systems = import ./systems.nix; customisation = import ./customisation.nix; in { inherit trivial lists strings stringsWithDeps attrsets sources options - properties modules types meta debug maintainers platforms; + properties modules types meta debug maintainers platforms systems; } # !!! don't include everything at top-level; perhaps only the most # commonly used functions. // trivial // lists // strings // stringsWithDeps // attrsets // sources // properties // options // types // meta // debug // misc // modules + // systems // customisation diff --git a/pkgs/lib/systems.nix b/pkgs/lib/systems.nix new file mode 100644 index 000000000000..41fdaacde448 --- /dev/null +++ b/pkgs/lib/systems.nix @@ -0,0 +1,125 @@ +# Define the list of system with their properties. Only systems tested for +# Nixpkgs are listed below + +with import ./lists.nix; +with import ./types.nix; +with import ./attrsets.nix; + +let + lib = import ./default.nix; + setTypes = type: + mapAttrs (name: value: + setType type ({inherit name;} // value) + ); +in + +rec { + + isSignificantByte = x: typeOf x == "significant-byte"; + significantBytes = setTypes "significant-byte" { + bigEndian = {}; + littleEndian = {}; + }; + + + isCpuType = x: typeOf x == "cpu-type" + && elem x.bits [8 16 32 64 128] + && (builtins.lessThan 8 x.bits -> isSignificantByte x.significantByte); + + cpuTypes = with significantBytes; + setTypes "cpu-type" { + arm = { bits = 32; significantByte = littleEndian; }; + armv5tel = { bits = 32; significantByte = littleEndian; }; + i686 = { bits = 32; significantByte = littleEndian; }; + powerpc = { bits = 32; significantByte = bigEndian; }; + x86_64 = { bits = 64; significantByte = littleEndian; }; + }; + + + isExecFormat = x: typeOf x == "exec-format"; + execFormats = setTypes "exec-format" { + aout = {}; # a.out + elf = {}; + macho = {}; + pe = {}; + unknow = {}; + }; + + + isKernel = x: typeOf x == "kernel"; + kernels = with execFormats; + setTypes "kernel" { + cygwin = { execFormat = pe; }; + darwin = { execFormat = macho; }; + freebsd = { execFormat = elf; }; + linux = { execFormat = elf; }; + netbsd = { execFormat = elf; }; + none = { execFormat = unknow; }; + openbsd = { execFormat = elf; }; + win32 = { execFormat = pe; }; + }; + + + isArchitecture = x: typeOf x == "architecture"; + architectures = setTypes "architecture" { + apple = {}; + pc = {}; + unknow = {}; + }; + + + isSystem = x: typeOf x == "system" + && isCpuType x.cpu + && isArchitecture x.arch + && isKernel x.kernel; + + mkSystem = { + cpu ? cpuTypes.i686, + arch ? architectures.pc, + kernel ? kernels.linux, + name ? "${cpu.name}-${arch.name}-${kernel.name}" + }: setType "system" { + inherit name cpu arch kernel; + }; + + + isDarwin = matchAttrs { kernel = kernels.darwin; }; + isLinux = matchAttrs { kernel = kernels.linux; }; + isi686 = matchAttrs { cpu = cpuTypes.i686; }; + is64Bit = matchAttrs { cpu = { bits = 64; }; }; + + + # This should revert the job done by config.guess from the gcc compiler. + mkSystemFromString = s: let + l = lib.splitString "-" s; + + getCpu = name: + attrByPath [name] (throw "Unknow cpuType `${name}'.") + cpuTypes; + getArch = name: + attrByPath [name] (throw "Unknow architecture `${name}'.") + architectures; + getKernel = name: + attrByPath [name] (throw "Unknow kernel `${name}'.") + kernels; + + system = + if builtins.length l == 2 then + mkSystem rec { + name = s; + cpu = getCpu (head l); + arch = + if isDarwin system + then architectures.apple + else architectures.pc; + kernel = getKernel (head (tail l)); + } + else + mkSystem { + name = s; + cpu = getCpu (head l); + arch = getArch (head (tail l)); + kernel = getKernel (head (tail (tail l))); + }; + in assert isSystem system; system; +} diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix index d71cb9df097c..fd3c071c0bed 100644 --- a/pkgs/lib/types.nix +++ b/pkgs/lib/types.nix @@ -12,6 +12,10 @@ rec { hasType = x: isAttrs x && x ? _type; typeOf = x: if hasType x then x._type else ""; + setType = typeName: value: value // { + _type = typeName; + }; + # name (name of the type) # check (boolean function) diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix index 647e5dcab3c2..7c6c2d462393 100644 --- a/pkgs/misc/my-env/default.nix +++ b/pkgs/misc/my-env/default.nix @@ -41,7 +41,9 @@ { mkDerivation, substituteAll, pkgs } : { stdenv ? pkgs.stdenv, name, buildInputs ? [], cTags ? [], extraCmds ? ""} : mkDerivation { - buildInputs = [ ] ++ buildInputs ; + # The setup.sh script from stdenv will expect the native build inputs in + # the buildNativeInputs environment variable. + buildNativeInputs = [ ] ++ buildInputs ; name = "env-${name}"; phases = "buildPhase"; setupNew = substituteAll { @@ -62,7 +64,7 @@ mkDerivation { -e 's@trap.*@@' \ -i "$s" cat >> "$out/dev-envs/''${name/env-/}" << EOF - buildInputs="$buildInputs" + buildNativeInputs="$buildNativeInputs" # the setup-new script wants to write some data to a temp file.. so just let it do that and tidy up afterwards tmp="\$("${pkgs.coreutils}/bin/mktemp" -d)" NIX_BUILD_TOP="\$tmp" diff --git a/pkgs/misc/tex/tetex/builder.sh b/pkgs/misc/tex/tetex/builder.sh deleted file mode 100644 index 0611f6763472..000000000000 --- a/pkgs/misc/tex/tetex/builder.sh +++ /dev/null @@ -1,22 +0,0 @@ -source $stdenv/setup - -postUnpack=postUnpack -postUnpack() { - ensureDir $out/share/texmf - ensureDir $out/share/texmf-dist - gunzip < $texmf | (cd $out/share/texmf-dist && tar xvf -) -} - -configureFlags="\ - --disable-multiplatform \ - --without-x11 \ - --without-xdvik \ - --without-oxdvik \ - --without-texinfo \ - --without-texi2html \ - --with-system-zlib \ - --with-system-pnglib \ - --with-system-ncurses \ - " - -genericBuild diff --git a/pkgs/misc/tex/tetex/default.nix b/pkgs/misc/tex/tetex/default.nix index 9ff50dd5ab38..5e0fb38c3bd5 100644 --- a/pkgs/misc/tex/tetex/default.nix +++ b/pkgs/misc/tex/tetex/default.nix @@ -1,8 +1,7 @@ -{stdenv, fetchurl, flex, bison, zlib, libpng, ncurses, ed}: +{ stdenv, fetchurl, flex, bison, zlib, libpng, ncurses, ed }: stdenv.mkDerivation { name = "tetex-3.0"; - builder = ./builder.sh; src = fetchurl { url = ftp://cam.ctan.org/tex-archive/systems/unix/teTeX/current/distrib/tetex-src-3.0.tar.gz; @@ -14,12 +13,31 @@ stdenv.mkDerivation { md5 = "11aa15c8d3e28ee7815e0d5fcdf43fd4"; }; - buildInputs = [flex bison zlib libpng ncurses ed]; + buildInputs = [ flex bison zlib libpng ncurses ed ]; - patches = [./environment.patch]; + patches = [ ./environment.patch ./getline.patch ]; setupHook = ./setup-hook.sh; + configureFlags = + [ "--disable-multiplatform" + "--without-x11" + "--without-xdvik" + "--without-oxdvik" + "--without-texinfo" + "--without-texi2html" + "--with-system-zlib" + "--with-system-pnglib" + "--with-system-ncurses" + ]; + + postUnpack = + '' + ensureDir $out/share/texmf + ensureDir $out/share/texmf-dist + gunzip < $texmf | (cd $out/share/texmf-dist && tar xvf -) + ''; + meta = { description = "A full-featured (La)TeX distribution"; }; diff --git a/pkgs/misc/tex/tetex/getline.patch b/pkgs/misc/tex/tetex/getline.patch new file mode 100644 index 000000000000..c82c1b3ac360 --- /dev/null +++ b/pkgs/misc/tex/tetex/getline.patch @@ -0,0 +1,96 @@ +Glibc 2.10 has a `getline' symbol that clashes with teTeX's. +Taken from http://lists.ibiblio.org/pipermail/sm-commit/2009-July/024831.html + +diff -rc -x '*~' tetex-src-3.0-orig/texk/dvipsk/afm2tfm.c tetex-src-3.0/texk/dvipsk/afm2tfm.c +*** tetex-src-3.0-orig/texk/dvipsk/afm2tfm.c 2005-01-30 14:17:09.000000000 +0100 +--- tetex-src-3.0/texk/dvipsk/afm2tfm.c 2010-02-03 13:50:21.000000000 +0100 +*************** +*** 257,263 **** + } + + int +! getline P1H(void) { + register char *p ; + register int c ; + +--- 257,263 ---- + } + + int +! tetex_getline P1H(void) { + register char *p ; + register int c ; + +*************** +*** 606,612 **** + ai = newchar() ; + ai->adobenum = -1 ; + ai->adobename = "||" ; /* boundary character name */ +! while (getline()) { + switch(interest(paramstring())) { + case FontName: + fontname = paramnewstring() ; +--- 606,612 ---- + ai = newchar() ; + ai->adobenum = -1 ; + ai->adobename = "||" ; /* boundary character name */ +! while (tetex_getline()) { + switch(interest(paramstring())) { + case FontName: + fontname = paramnewstring() ; +*************** +*** 1882,1888 **** + + while (1) { + while (param == 0 || *param == 0) { +! if (getline() == 0) + error("! premature end in encoding file") ; + for (p=buffer; *p; p++) + if (*p == '%') { +--- 1882,1888 ---- + + while (1) { + while (param == 0 || *param == 0) { +! if (tetex_getline() == 0) + error("! premature end in encoding file") ; + for (p=buffer; *p; p++) + if (*p == '%') { +*************** +*** 1973,1979 **** + p = gettoken() ; + if (strcmp(p, "]")) + error("! token 258 in encoding must be make-array (])") ; +! while (getline()) { + for (p=buffer; *p; p++) + if (*p == '%') { + if (ignoreligkern == 0) +--- 1973,1979 ---- + p = gettoken() ; + if (strcmp(p, "]")) + error("! token 258 in encoding must be make-array (])") ; +! while (tetex_getline()) { + for (p=buffer; *p; p++) + if (*p == '%') { + if (ignoreligkern == 0) +diff -rc -x '*~' tetex-src-3.0-orig/texk/web2c/cpascal.h tetex-src-3.0/texk/web2c/cpascal.h +*** tetex-src-3.0-orig/texk/web2c/cpascal.h 2004-08-28 22:49:59.000000000 +0200 +--- tetex-src-3.0/texk/web2c/cpascal.h 2010-02-03 13:51:04.000000000 +0100 +*************** +*** 240,245 **** +--- 240,255 ---- + #undef getname + #define getname vms_getname + #endif ++ ++ /* Apparently POSIX 2008 has getline and glibc 2.9.90 exports it. ++ * tangle, weave, et al. use that symbol; try to define it away so ++ * something that a standard won't usurp. ++ * From http://tutimura.ath.cx/ptetex/?%C6%B0%BA%EE%CA%F3%B9%F0%2F134 */ ++ #ifdef getline ++ #undef getline ++ #endif ++ #define getline web2c_getline ++ + + /* Declarations for the routines we provide ourselves in lib/. */ + diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix new file mode 100644 index 000000000000..5c38f1d053bb --- /dev/null +++ b/pkgs/misc/uboot/default.nix @@ -0,0 +1,58 @@ +{stdenv, fetchurl, unzip}: + +# We should enable this check once we have the cross target system information +# assert stdenv.system == "armv5tel-linux" || crossConfig == "armv5tel-linux"; + +# All this file is made for the Marvell Sheevaplug + +stdenv.mkDerivation { + name = "uboot-sheevaplug-3.4.19"; + + src = fetchurl { + url = "ftp://ftp.denx.de/pub/u-boot/u-boot-1.1.4.tar.bz2"; + sha256 = "19vp4rlikz7h72pqsjhgz7nmgjy4c6vabvxkw67wni70vy5ddy8s"; + }; + + srcAddon = fetchurl { + url = "http://www.plugcomputer.org/data/uboot/u-boot-3.4.19.zip"; + sha256 = "1wag1l6agr8dbnnfaw6bgcrwynwwgry4ihb3gp438699wmkmy91k"; + }; + + postUnpack = '' + mv u-boot-1.1.4 u-boot-3.4.19 + unzip -o $srcAddon + sourceRoot=u-boot-3.4.19 + ''; + + patches = [ ./gas220.patch ]; + + # Remove the cross compiler prefix, and add reiserfs support + configurePhase = '' + make mrproper + make rd88f6281Sheevaplug_config NBOOT=1 LE=1 + sed -i /CROSS_COMPILE/d include/config.mk + ''; + + buildPhase = '' + unset src + if test -z "$crossConfig"; then + make clean all + else + make clean all ARCH=arm CROSS_COMPILE=$crossConfig- + fi + ''; + + buildNativeInputs = [ unzip ]; + + dontStrip = true; + NIX_STRIP_DEBUG = false; + + installPhase = '' + ensureDir $out + cp u-boot-rd88f6281Sheevaplug_400db_nand.bin $out + cp u-boot u-boot.map $out + + ensureDir $out/bin + cp tools/{envcrc,mkimage} $out/bin + ''; +} diff --git a/pkgs/misc/uboot/gas220.patch b/pkgs/misc/uboot/gas220.patch new file mode 100644 index 000000000000..c5a91b0f3d00 --- /dev/null +++ b/pkgs/misc/uboot/gas220.patch @@ -0,0 +1,18 @@ +Patch to allow assembling with binutils 2.20. It worked without this patch in 2.19.1 +diff --git a/board/mv_feroceon/USP/jump.S b/board/mv_feroceon/USP/jump.S +index 4b6b9ee..58037fc 100644 +--- a/board/mv_feroceon/USP/jump.S ++++ b/board/mv_feroceon/USP/jump.S +@@ -29,9 +29,11 @@ disclaimer. + #include "sys/mvCpuIfRegs.h" + + +-jumpStart: + + .section ".reset_vector_sect",#alloc, #execinstr ++ ++jumpStart: ++ + #if defined(MV_88F6082) || defined(MV_88F6183) || defined(DB_88F5181_OLD) || defined(DB_FPGA) || \ + defined(MV88F6281) || defined(MV88F6192) || defined(MV88F6180) || defined(MV_88F6183L) || \ + defined(MV88F6190) diff --git a/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch b/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch index 2b6d6276c22f..3cee02aa0cd9 100644 --- a/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch +++ b/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch @@ -62,3 +62,49 @@ index 74d1d1a..17ffb12 100644 } } #ifndef PIC + + +diff --git a/src/control/control.c b/src/control/control.c +index c090797..137fe57 100644 +--- a/src/control/control.c ++++ b/src/control/control.c +@@ -854,8 +854,38 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, + err = -ENOMEM; + goto _err; + } ++ sprintf(buf1, "%s/libasound_module_pcm_%s.so", ALSA_PLUGIN_DIR, str); ++ if (!file_exists(buf1)){ ++ // try to locate plugin in one of ALSA_PLUGIN_DIRS which is colon separated list of paths ++ char * pdirs = getenv("ALSA_PLUGIN_DIRS"); ++ ++ if (pdirs){ // env var set? ++ char * saveptr; ++ while (1) { ++ char * dir_tok = strtok_r(pdirs, "::::", &saveptr); // "::::" to work around bug in glibc and -O2 ? ":" seems to cause a segfault ++ if (dir_tok == NULL) ++ break; ++ char * so_file = malloc(strlen(str) + strlen(dir_tok) + 32); ++ if (so_file == NULL) { ++ err = -ENOMEM; ++ goto _err; ++ } ++ ++ sprintf(so_file, "%s/libasound_module_ctl_%s.so", dir_tok, str); ++ ++ if (file_exists(so_file)){ ++ ++ free(buf1); ++ buf1 = so_file; ++ break; ++ } else { ++ free (so_file); ++ } ++ pdirs = NULL; ++ } ++ } ++ } + lib = buf1; +- sprintf(buf1, "%s/libasound_module_ctl_%s.so", ALSA_PLUGIN_DIR, str); + } + } + #ifndef PIC diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix index daabf99d543b..36e99482f5da 100644 --- a/pkgs/os-specific/linux/alsa-lib/default.nix +++ b/pkgs/os-specific/linux/alsa-lib/default.nix @@ -28,7 +28,10 @@ stdenv.mkDerivation rec { patches = [ /* allow specifying alternatives alsa plugin locations using - export ALSA_PLUGIN_DIRS=$(nix-build -A alsaPlugins)/lib/alsa-lib */ + export ALSA_PLUGIN_DIRS=$(nix-build -A alsaPlugins)/lib/alsa-lib + This patch should be improved: + See http://thread.gmane.org/gmane.linux.distributions.nixos/3435 + */ ./alsa-plugin-dirs.patch ]; } diff --git a/pkgs/os-specific/linux/autofs/autofs-v5.nix b/pkgs/os-specific/linux/autofs/autofs-v5.nix index 92e269306abf..7941f4432938 100644 --- a/pkgs/os-specific/linux/autofs/autofs-v5.nix +++ b/pkgs/os-specific/linux/autofs/autofs-v5.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation { #make install SUBDIRS="samples" # impure! ''; - buildInputs = [flex bison kernelHeaders]; + buildInputs = [flex bison linuxHeaders]; meta = { description="Kernel based automounter"; diff --git a/pkgs/os-specific/linux/cpufrequtils/default.nix b/pkgs/os-specific/linux/cpufrequtils/default.nix index cdf06103f683..b810db2c1b53 100644 --- a/pkgs/os-specific/linux/cpufrequtils/default.nix +++ b/pkgs/os-specific/linux/cpufrequtils/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, kernelHeaders, glibc, libtool, gettext}: +{stdenv, fetchurl, linuxHeaders, glibc, libtool, gettext}: assert stdenv.isLinux && stdenv.system != "powerpc-linux"; @@ -16,5 +16,5 @@ stdenv.mkDerivation { -i Makefile ''; - buildInputs = [ kernelHeaders glibc libtool gettext ]; + buildInputs = [ linuxHeaders glibc libtool gettext ]; } diff --git a/pkgs/os-specific/linux/hal/default.nix b/pkgs/os-specific/linux/hal/default.nix index 1cce0334dc27..2ca2d32ab412 100644 --- a/pkgs/os-specific/linux/hal/default.nix +++ b/pkgs/os-specific/linux/hal/default.nix @@ -13,9 +13,9 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig python pciutils expat libusb dbus.libs dbus_glib glib libuuid perl perlXMLParser gettext zlib gperf - consolekit policykit libsmbios + consolekit policykit # !!! libsmbios is broken; it doesn't install headers. - ]; + ] ++ stdenv.lib.optional (stdenv.system != "armv5tel-linux") [ libsmbios ]; # !!! Hm, maybe the pci/usb.ids location should be in /etc, so that # we don't have to rebuild HAL when we update the PCI/USB IDs. @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { --enable-umount-helper ''; - propagatedBuildInputs = [libusb libsmbios]; + propagatedBuildInputs = [ libusb ] + ++ stdenv.lib.optional (stdenv.system != "armv5tel-linux") [ libsmbios ]; preConfigure = '' for i in hald/linux/probing/probe-smbios.c hald/linux/osspec.c \ diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix index 14bd1b2b3239..81433a313b9e 100644 --- a/pkgs/os-specific/linux/iputils/default.nix +++ b/pkgs/os-specific/linux/iputils/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, kernelHeaders, glibc}: +{stdenv, fetchurl, linuxHeaders, glibc}: assert stdenv.isLinux && stdenv.system != "powerpc-linux"; @@ -10,6 +10,6 @@ stdenv.mkDerivation { md5 = "b5493f7a2997130a4f86c486c9993b86"; }; - inherit kernelHeaders glibc; + inherit linuxHeaders glibc; patches = [ ./open-max.patch ]; } diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 39d14b569f2f..77d53adeb81b 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -10,6 +10,11 @@ stdenv.mkDerivation rec { buildInputs = [ bison flex autoconf automake ]; + # We get a warning in armv5tel-linux, so we disable -Werror in it + patchPhase = if (stdenv.system == "armv5tel-linux") then '' + sed -i s/-Werror// src/Makefile.am + '' else ""; + # Grrr, kbd 1.15.1 doesn't include a configure script. preConfigure = "autoreconf"; diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.18.5.nix b/pkgs/os-specific/linux/kernel-headers/2.6.18.5.nix index cf4efd159e8f..5ecdd77fb873 100644 --- a/pkgs/os-specific/linux/kernel-headers/2.6.18.5.nix +++ b/pkgs/os-specific/linux/kernel-headers/2.6.18.5.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation { sha256 = "24f0e0011cdae42e3dba56107bb6a60c57c46d1d688a9b0300fec53e80fd1e53"; }; + patches = [ ./unifdef-getline.patch ]; + buildInputs = [ unifdef ]; platform = diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix index 3136f52db8e8..82840f8a51fe 100644 --- a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix +++ b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix @@ -1,33 +1,43 @@ -{stdenv, fetchurl, perl}: +{stdenv, fetchurl, perl, cross ? null}: -assert stdenv.isLinux; +assert cross == null -> stdenv.isLinux; -let version = "2.6.28.5"; in +let version = "2.6.28.5"; in stdenv.mkDerivation { name = "linux-headers-${version}"; - + src = fetchurl { url = "mirror://kernel/linux/kernel/v2.6/linux-${version}.tar.bz2"; sha256 = "0hifjh75sinifr5138v22zwbpqln6lhn65k8b57a1dyzlqca7cl9"; }; - platform = + targetConfig = if (cross != null) then cross.config else null; + + platform = + if cross != null then cross.arch else if stdenv.system == "i686-linux" then "i386" else if stdenv.system == "x86_64-linux" then "x86_64" else if stdenv.system == "powerpc-linux" then "powerpc" else + if stdenv.system == "armv5tel-linux" then "arm" else abort "don't know what the kernel include directory is called for this platform"; buildInputs = [perl]; extraIncludeDirs = - if stdenv.system == "powerpc-linux" then ["ppc"] else []; + if cross != null then + (if cross.arch == "powerpc" then ["ppc"] else []) + else if stdenv.system == "powerpc-linux" then ["ppc"] else []; patchPhase = '' + patch --verbose -p1 < "${./unifdef-getline.patch}" sed -i '/scsi/d' include/Kbuild ''; buildPhase = '' + if test -n "$targetConfig"; then + export ARCH=$platform + fi make mrproper headers_check ''; @@ -44,6 +54,6 @@ stdenv.mkDerivation { ln -s asm $out/include/asm-$platform if test "$platform" = "i386" -o "$platform" = "x86_64"; then ln -s asm $out/include/asm-x86 - fi + fi ''; } diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.32.nix b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix new file mode 100644 index 000000000000..a09ad98c85ca --- /dev/null +++ b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix @@ -0,0 +1,54 @@ +{stdenv, fetchurl, perl, cross ? null}: + +assert stdenv.isLinux; + +let version = "2.6.32.4"; in + +stdenv.mkDerivation { + name = "linux-headers-${version}"; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/v2.6/linux-${version}.tar.bz2"; + sha256 = "1n8pj05sazxv1dgi68q61lrvrnzvvx61qqw6kx80vqizqanz97z1"; + }; + + targetConfig = if (cross != null) then cross.config else null; + + platform = + if cross != null then cross.arch else + if stdenv.system == "i686-linux" then "i386" else + if stdenv.system == "x86_64-linux" then "x86_64" else + if stdenv.system == "powerpc-linux" then "powerpc" else + if stdenv.system == "armv5tel-linux" then "arm" else + abort "don't know what the kernel include directory is called for this platform"; + + buildInputs = [perl]; + + extraIncludeDirs = + if cross != null then + (if cross.arch == "powerpc" then ["ppc"] else []) + else if stdenv.system == "powerpc-linux" then ["ppc"] else []; + + buildPhase = '' + if test -n "$targetConfig"; then + export ARCH=$platform + fi + make mrproper headers_check + ''; + + installPhase = '' + make INSTALL_HDR_PATH=$out headers_install + + # Some builds (e.g. KVM) want a kernel.release. + ensureDir $out/include/config + echo "${version}-default" > $out/include/config/kernel.release + ''; + + # !!! hacky + fixupPhase = '' + ln -s asm $out/include/asm-$platform + if test "$platform" = "i386" -o "$platform" = "x86_64"; then + ln -s asm $out/include/asm-x86 + fi + ''; +} diff --git a/pkgs/os-specific/linux/kernel-headers/unifdef-getline.patch b/pkgs/os-specific/linux/kernel-headers/unifdef-getline.patch new file mode 100644 index 000000000000..8caabfd3286b --- /dev/null +++ b/pkgs/os-specific/linux/kernel-headers/unifdef-getline.patch @@ -0,0 +1,35 @@ +This patch fixes a trivial compilation error with glibc 2.11. +From http://patchwork.kernel.org/patch/11166/ . + +diff --git a/scripts/unifdef.c b/scripts/unifdef.c +index 552025e..977e682 100644 +--- a/scripts/unifdef.c ++++ b/scripts/unifdef.c +@@ -206,7 +206,7 @@ static void done(void); + static void error(const char *); + static int findsym(const char *); + static void flushline(bool); +-static Linetype getline(void); ++static Linetype parseline(void); + static Linetype ifeval(const char **); + static void ignoreoff(void); + static void ignoreon(void); +@@ -512,7 +512,7 @@ process(void) + + for (;;) { + linenum++; +- lineval = getline(); ++ lineval = parseline(); + trans_table[ifstate[depth]][lineval](); + debug("process %s -> %s depth %d", + linetype_name[lineval], +@@ -526,7 +526,7 @@ process(void) + * help from skipcomment(). + */ + static Linetype +-getline(void) ++parseline(void) + { + const char *cp; + int cursym; + diff --git a/pkgs/os-specific/linux/kernel/builder.sh b/pkgs/os-specific/linux/kernel/builder.sh index f683498417d2..a67877c9fd6a 100644 --- a/pkgs/os-specific/linux/kernel/builder.sh +++ b/pkgs/os-specific/linux/kernel/builder.sh @@ -24,6 +24,9 @@ configurePhase() { # generate-config.pl can answer them. sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c + # Get a basic config file for later refinement with $generateConfig. + make $kernelBaseConfig ARCH=$arch + # Create the config file. echo "generating kernel configuration..." echo "$kernelConfig" > kernel-config @@ -31,6 +34,13 @@ configurePhase() { } +postBuild() { + if [ "$platformName" == "sheevaplug" ]; then + make uImage + fi +} + + installPhase() { ensureDir $out @@ -41,15 +51,28 @@ installPhase() { archDir=x86 fi + # Copy the bzImage and System.map. cp System.map $out if test "$arch" = um; then ensureDir $out/bin cp linux $out/bin else - cp arch/$archDir/boot/bzImage $out/vmlinuz + case $platformName in + sheevaplug) + cp arch/$archDir/boot/uImage $out + ;; + versatileARM) + cp arch/$archDir/boot/zImage $out + ;; + *) + cp arch/$archDir/boot/bzImage $out/vmlinuz + ;; + esac fi + cp vmlinux $out + # Install the modules in $out/lib/modules with matching paths # in modules.dep (i.e., refererring to $out/lib/modules, not # /lib/modules). The depmod_opts= is to prevent the kernel diff --git a/pkgs/os-specific/linux/kernel/config-2.6.31-armv5tel b/pkgs/os-specific/linux/kernel/config-2.6.31-armv5tel new file mode 100644 index 000000000000..827f9711511f --- /dev/null +++ b/pkgs/os-specific/linux/kernel/config-2.6.31-armv5tel @@ -0,0 +1,1786 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.31 +# Tue Sep 22 01:20:57 2009 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_CONSTRUCTORS=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set + +# +# RCU Subsystem +# +CONFIG_CLASSIC_RCU=y +# CONFIG_TREE_RCU is not set +# CONFIG_PREEMPT_RCU is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_PREEMPT_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=19 +# CONFIG_GROUP_SCHED is not set +# CONFIG_CGROUPS is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_RELAY is not set +CONFIG_NAMESPACES=y +# CONFIG_UTS_NS is not set +# CONFIG_IPC_NS is not set +# CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set +# CONFIG_NET_NS is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +# CONFIG_EMBEDDED is not set +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y + +# +# Performance Counters +# +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_PCI_QUIRKS=y +CONFIG_SLUB_DEBUG=y +# CONFIG_STRIP_ASM_SYMS is not set +CONFIG_COMPAT_BRK=y +# CONFIG_SLAB is not set +CONFIG_SLUB=y +# CONFIG_SLOB is not set +CONFIG_PROFILING=y +CONFIG_TRACEPOINTS=y +CONFIG_MARKERS=y +CONFIG_OPROFILE=y +CONFIG_HAVE_OPROFILE=y +CONFIG_KPROBES=y +CONFIG_KRETPROBES=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y + +# +# GCOV-based kernel profiling +# +# CONFIG_GCOV_KERNEL is not set +# CONFIG_SLOW_WORK is not set +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_FREEZER is not set + +# +# System Type +# +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_GEMINI is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_STMP3XXX is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_L7200 is not set +CONFIG_ARCH_KIRKWOOD=y +# CONFIG_ARCH_LOKI is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_MMP is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_W90X900 is not set +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_MSM is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_S3C64XX is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_U300 is not set +# CONFIG_ARCH_DAVINCI is not set +# CONFIG_ARCH_OMAP is not set + +# +# Marvell Kirkwood Implementations +# +CONFIG_MACH_DB88F6281_BP=y +CONFIG_MACH_RD88F6192_NAS=y +CONFIG_MACH_RD88F6281=y +CONFIG_MACH_MV88F6281GTW_GE=y +CONFIG_MACH_SHEEVAPLUG=y +CONFIG_MACH_TS219=y +CONFIG_PLAT_ORION=y + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_FEROCEON=y +# CONFIG_CPU_FEROCEON_OLD_ID is not set +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_PABRT_NOIFAR=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_FEROCEON=y +CONFIG_CPU_TLB_FEROCEON=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y + +# +# Processor Features +# +CONFIG_ARM_THUMB=y +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +CONFIG_OUTER_CACHE=y +CONFIG_CACHE_FEROCEON_L2=y +# CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set + +# +# Bus support +# +CONFIG_PCI=y +CONFIG_PCI_SYSCALL=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_PCI_LEGACY=y +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCCARD is not set + +# +# Kernel Features +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_1G is not set +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PREEMPT=y +CONFIG_HZ=100 +CONFIG_AEABI=y +# CONFIG_OABI_COMPAT is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_HIGHMEM is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4096 +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +CONFIG_HAVE_MLOCK=y +CONFIG_HAVE_MLOCKED_PAGE_BIT=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_ALIGNMENT_TRAP=y +CONFIG_UACCESS_WITH_MEMCPY=y + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="" +# CONFIG_XIP_KERNEL is not set +# CONFIG_KEXEC is not set + +# +# CPU Power Management +# +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +# CONFIG_VFP is not set + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_HAVE_AOUT=y +# CONFIG_BINFMT_AOUT is not set +# CONFIG_BINFMT_MISC is not set + +# +# Power management options +# +# CONFIG_PM is not set +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_INET_XFRM_MODE_TRANSPORT=y +CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=y +CONFIG_INET_LRO=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_IPV6 is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETFILTER is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +CONFIG_NET_DSA=y +# CONFIG_NET_DSA_TAG_DSA is not set +CONFIG_NET_DSA_TAG_EDSA=y +# CONFIG_NET_DSA_TAG_TRAILER is not set +CONFIG_NET_DSA_MV88E6XXX=y +# CONFIG_NET_DSA_MV88E6060 is not set +# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_MV88E6131 is not set +CONFIG_NET_DSA_MV88E6123_61_65=y +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set + +# +# Network testing +# +CONFIG_NET_PKTGEN=m +# CONFIG_NET_TCPPROBE is not set +# CONFIG_NET_DROP_MONITOR is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_CFG80211=y +# CONFIG_CFG80211_REG_DEBUG is not set +# CONFIG_CFG80211_DEBUGFS is not set +CONFIG_WIRELESS_OLD_REGULATORY=y +CONFIG_WIRELESS_EXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +CONFIG_LIB80211=y +# CONFIG_LIB80211_DEBUG is not set +CONFIG_MAC80211=y +CONFIG_MAC80211_DEFAULT_PS=y +CONFIG_MAC80211_DEFAULT_PS_VALUE=1 + +# +# Rate control algorithm selection +# +CONFIG_MAC80211_RC_MINSTREL=y +# CONFIG_MAC80211_RC_DEFAULT_PID is not set +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel" +# CONFIG_MAC80211_LEDS is not set +# CONFIG_MAC80211_DEBUGFS is not set +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_MTD_OOPS is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_GEN_PROBE=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +CONFIG_MTD_CFI_NOSWAP=y +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set +CONFIG_MTD_CFI_GEOMETRY=y +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_OTP is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_AMDSTD is not set +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_PHYSMAP_COMPAT is not set +# CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_IMPA7 is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_DATAFLASH is not set +CONFIG_MTD_M25P80=y +CONFIG_M25PXX_USE_FAST_READ=y +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +# CONFIG_MTD_NAND_GPIO is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_ALAUDA is not set +CONFIG_MTD_NAND_ORION=y +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set + +# +# UBI - Unsorted block images +# +CONFIG_MTD_UBI=y +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_MG_DISK is not set +# CONFIG_MISC_DEVICES is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_SCSI_PROC_FS is not set + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_ISCSI_TCP is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_LIBFC is not set +# CONFIG_LIBFCOE is not set +# CONFIG_FCOE is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_SRP is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_SATA_PMP=y +CONFIG_SATA_AHCI=y +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y +# CONFIG_SATA_SVW is not set +# CONFIG_ATA_PIIX is not set +CONFIG_SATA_MV=y +# CONFIG_SATA_NV is not set +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SX4 is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RZ1000 is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set +# CONFIG_PATA_SCH is not set +# CONFIG_MD is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# You can enable one or both FireWire driver stacks. +# + +# +# See the help texts for more information. +# +# CONFIG_FIREWIRE is not set +# CONFIG_IEEE1394 is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_MACVLAN is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +CONFIG_MARVELL_PHY=y +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_AX88796 is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_CASSINI is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_SMC91X is not set +# CONFIG_DM9000 is not set +# CONFIG_ENC28J60 is not set +# CONFIG_ETHOC is not set +# CONFIG_SMC911X is not set +# CONFIG_SMSC911X is not set +# CONFIG_DNET is not set +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set +CONFIG_NET_PCI=y +# CONFIG_PCNET32 is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_B44 is not set +# CONFIG_FORCEDETH is not set +# CONFIG_E100 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_R6040 is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SMSC9420 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_TLAN is not set +# CONFIG_KS8842 is not set +# CONFIG_KS8851 is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_SC92031 is not set +# CONFIG_ATL2 is not set +CONFIG_NETDEV_1000=y +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_E1000E is not set +# CONFIG_IP1000 is not set +# CONFIG_IGB is not set +# CONFIG_IGBVF is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SIS190 is not set +# CONFIG_SKGE is not set +# CONFIG_SKY2 is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +CONFIG_MV643XX_ETH=y +# CONFIG_QLA3XXX is not set +# CONFIG_ATL1 is not set +# CONFIG_ATL1E is not set +# CONFIG_ATL1C is not set +# CONFIG_JME is not set +# CONFIG_NETDEV_10000 is not set +# CONFIG_TR is not set + +# +# Wireless LAN +# +# CONFIG_WLAN_PRE80211 is not set +CONFIG_WLAN_80211=y +CONFIG_LIBERTAS=y +# CONFIG_LIBERTAS_USB is not set +CONFIG_LIBERTAS_SDIO=y +# CONFIG_LIBERTAS_SPI is not set +# CONFIG_LIBERTAS_DEBUG is not set +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_ATMEL is not set +# CONFIG_AT76C50X_USB is not set +# CONFIG_PRISM54 is not set +# CONFIG_USB_ZD1201 is not set +# CONFIG_USB_NET_RNDIS_WLAN is not set +# CONFIG_RTL8180 is not set +# CONFIG_RTL8187 is not set +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +# CONFIG_P54_COMMON is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH9K is not set +# CONFIG_AR9170_USB is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWLWIFI is not set +# CONFIG_HOSTAP is not set +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_ZD1211RW is not set +# CONFIG_RT2X00 is not set +# CONFIG_HERMES is not set +# CONFIG_WL12XX is not set +# CONFIG_IWM is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_NET_FC is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_ISDN is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_POLLDEV is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_LKKBD is not set +CONFIG_KEYBOARD_GPIO=y +# CONFIG_KEYBOARD_MATRIX is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_VT_HW_CONSOLE_BINDING is not set +# CONFIG_DEVKMEM is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MAX3100 is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=16 +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_HELPER_AUTO=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_GPIO is not set +CONFIG_I2C_MV64XXX=y +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_SIMTEC is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Graphics adapter I2C/DDC channel drivers +# +# CONFIG_I2C_VOODOO3 is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_STUB is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_DS1682 is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_PCF8575 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +# CONFIG_SPI_BITBANG is not set +# CONFIG_SPI_GPIO is not set +CONFIG_SPI_ORION=y + +# +# SPI Protocol Masters +# +# CONFIG_SPI_SPIDEV is not set +# CONFIG_SPI_TLE62X0 is not set +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_GPIOLIB=y +# CONFIG_DEBUG_GPIO is not set +# CONFIG_GPIO_SYSFS is not set + +# +# Memory mapped GPIO expanders: +# + +# +# I2C GPIO expanders: +# +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCF857X is not set + +# +# PCI GPIO expanders: +# +# CONFIG_GPIO_BT8XX is not set + +# +# SPI GPIO expanders: +# +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MCP23S08 is not set +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_THERMAL_HWMON is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_ASIC3 is not set +# CONFIG_HTC_EGPIO is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS65010 is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_MFD_TC6393XB is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_AB3100_CORE is not set +# CONFIG_EZX_PCAP is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# +# CONFIG_DRM is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +# CONFIG_SOUND is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HIDRAW is not set + +# +# USB Input Devices +# +CONFIG_USB_HID=y +# CONFIG_HID_PID is not set +# CONFIG_USB_HIDDEV is not set + +# +# Special HID drivers +# +CONFIG_HID_A4TECH=y +CONFIG_HID_APPLE=y +CONFIG_HID_BELKIN=y +CONFIG_HID_CHERRY=y +CONFIG_HID_CHICONY=y +CONFIG_HID_CYPRESS=y +CONFIG_HID_DRAGONRISE=y +# CONFIG_DRAGONRISE_FF is not set +CONFIG_HID_EZKEY=y +CONFIG_HID_KYE=y +CONFIG_HID_GYRATION=y +CONFIG_HID_KENSINGTON=y +CONFIG_HID_LOGITECH=y +# CONFIG_LOGITECH_FF is not set +# CONFIG_LOGIRUMBLEPAD2_FF is not set +CONFIG_HID_MICROSOFT=y +CONFIG_HID_MONTEREY=y +CONFIG_HID_NTRIG=y +CONFIG_HID_PANTHERLORD=y +# CONFIG_PANTHERLORD_FF is not set +CONFIG_HID_PETALYNX=y +CONFIG_HID_SAMSUNG=y +CONFIG_HID_SONY=y +CONFIG_HID_SUNPLUS=y +CONFIG_HID_GREENASIA=y +# CONFIG_GREENASIA_FF is not set +CONFIG_HID_SMARTJOYPLUS=y +# CONFIG_SMARTJOYPLUS_FF is not set +CONFIG_HID_TOPSEED=y +CONFIG_HID_THRUSTMASTER=y +# CONFIG_THRUSTMASTER_FF is not set +CONFIG_HID_ZEROPLUS=y +# CONFIG_ZEROPLUS_FF is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +CONFIG_USB_DEVICE_CLASS=y +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_WHCI_HCD is not set +# CONFIG_USB_HWA_HCD is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_ACM is not set +CONFIG_USB_PRINTER=m +# CONFIG_USB_WDM is not set +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +# CONFIG_USB_SERIAL is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_BERRY_CHARGE is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_VST is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_USB_GPIO_VBUS is not set +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +CONFIG_MMC=y +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_UNSAFE_RESUME is not set + +# +# MMC/SD/SDIO Card Drivers +# +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_BOUNCE=y +CONFIG_SDIO_UART=y +# CONFIG_MMC_TEST is not set + +# +# MMC/SD/SDIO Host Controller Drivers +# +# CONFIG_MMC_SDHCI is not set +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MMC_MVSDIO=y +# CONFIG_MMC_SPI is not set +# CONFIG_MMC_CB710 is not set +# CONFIG_MMC_VIA_SDMMC is not set +# CONFIG_MEMSTICK is not set +# CONFIG_ACCESSIBILITY is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_PCA9532 is not set +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_GPIO_PLATFORM=y +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_DAC124S085 is not set +# CONFIG_LEDS_BD2802 is not set + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_GPIO is not set +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y + +# +# iptables trigger is under Netfilter config (LED target) +# +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +# CONFIG_RTC_DRV_TEST is not set + +# +# I2C RTC drivers +# +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_M41T80 is not set +CONFIG_RTC_DRV_S35390A=y +# CONFIG_RTC_DRV_FM3130 is not set +# CONFIG_RTC_DRV_RX8581 is not set +# CONFIG_RTC_DRV_RX8025 is not set + +# +# SPI RTC drivers +# +# CONFIG_RTC_DRV_M41T94 is not set +# CONFIG_RTC_DRV_DS1305 is not set +# CONFIG_RTC_DRV_DS1390 is not set +# CONFIG_RTC_DRV_MAX6902 is not set +# CONFIG_RTC_DRV_R9701 is not set +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_DS3234 is not set + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_CMOS is not set +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_BQ4802 is not set +# CONFIG_RTC_DRV_V3020 is not set + +# +# on-CPU RTC drivers +# +CONFIG_RTC_DRV_MV=y +CONFIG_DMADEVICES=y + +# +# DMA Devices +# +CONFIG_MV_XOR=y +CONFIG_DMA_ENGINE=y + +# +# DMA Clients +# +# CONFIG_NET_DMA is not set +# CONFIG_ASYNC_TX_DMA is not set +# CONFIG_DMATEST is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_REGULATOR is not set +# CONFIG_UIO is not set +# CONFIG_STAGING is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=y +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set +# CONFIG_EXT3_FS_XATTR is not set +# CONFIG_EXT4_FS is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_REISERFS_FS=y +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_BTRFS_FS is not set +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +CONFIG_FUSE_FS=y + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +CONFIG_CRAMFS=y +# CONFIG_SQUASHFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +# CONFIG_NILFS2_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFSD is not set +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +CONFIG_NLS_CODEPAGE_850=y +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=y +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=y +# CONFIG_DLM is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +CONFIG_MAGIC_SYSRQ=y +# CONFIG_UNUSED_SYMBOLS is not set +CONFIG_DEBUG_FS=y +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +CONFIG_DETECT_HUNG_TASK=y +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_STATS is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_PREEMPT is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +CONFIG_STACKTRACE=y +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_RCU_CPU_STALL_DETECTOR is not set +# CONFIG_KPROBES_SANITY_TEST is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_LKDTM is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_LATENCYTOP is not set +CONFIG_SYSCTL_SYSCALL_CHECK=y +# CONFIG_PAGE_POISONING is not set +CONFIG_NOP_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_RING_BUFFER=y +CONFIG_EVENT_TRACING=y +CONFIG_CONTEXT_SWITCH_TRACER=y +CONFIG_TRACING=y +CONFIG_TRACING_SUPPORT=y +CONFIG_FTRACE=y +# CONFIG_FUNCTION_TRACER is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_PREEMPT_TRACER is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_ENABLE_DEFAULT_TRACERS is not set +# CONFIG_BOOT_TRACER is not set +CONFIG_BRANCH_PROFILE_NONE=y +# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set +# CONFIG_PROFILE_ALL_BRANCHES is not set +# CONFIG_STACK_TRACER is not set +# CONFIG_KMEMTRACE is not set +# CONFIG_WORKQUEUE_TRACER is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_RING_BUFFER_BENCHMARK is not set +# CONFIG_DYNAMIC_DEBUG is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +CONFIG_ARM_UNWIND=y +CONFIG_DEBUG_USER=y +CONFIG_DEBUG_ERRORS=y +# CONFIG_DEBUG_STACK_USAGE is not set +CONFIG_DEBUG_LL=y +# CONFIG_DEBUG_ICEDCC is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +# CONFIG_CRYPTO_FIPS is not set +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_AUTHENC is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +CONFIG_CRYPTO_CBC=m +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +CONFIG_CRYPTO_ECB=y +# CONFIG_CRYPTO_LRW is not set +CONFIG_CRYPTO_PCBC=m +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_XCBC is not set + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_ARC4=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_ZLIB is not set +# CONFIG_CRYPTO_LZO is not set + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +CONFIG_BINARY_PRINTF=y + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +# CONFIG_CRC7 is not set +CONFIG_LIBCRC32C=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_NLATTR=y diff --git a/pkgs/os-specific/linux/kernel/config-blocks.nix b/pkgs/os-specific/linux/kernel/config-blocks.nix index 33247bd059fb..f30bc486f5b7 100644 --- a/pkgs/os-specific/linux/kernel/config-blocks.nix +++ b/pkgs/os-specific/linux/kernel/config-blocks.nix @@ -23,7 +23,7 @@ rec { PARAVIRT_GUEST y KVM_CLOCK y KVM_GUEST y - XEN y + XEN? y KSM y # We need 64 GB (PAE) support for Xen guest support. diff --git a/pkgs/os-specific/linux/kernel/generate-config.pl b/pkgs/os-specific/linux/kernel/generate-config.pl index be5118672e3b..e8f7e6555d33 100644 --- a/pkgs/os-specific/linux/kernel/generate-config.pl +++ b/pkgs/os-specific/linux/kernel/generate-config.pl @@ -94,7 +94,8 @@ sub runConfig { } else { - die "don't know how to answer this question: $line\n"; + warn "don't know how to answer this question: $line\n"; + print OUT "\n"; } $line = ""; diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 92558a62c984..f1981d261c69 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -33,9 +33,16 @@ , preConfigure ? "" , extraMeta ? {} +, platform ? { name = "pc"; uboot = null; kernelBaseConfig = "defconfig"; } +, ... }: -assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; +assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" + || stdenv.system == "armv5tel-linux"; + +assert platform.name == "sheevaplug" -> platform.uboot != null; +assert (platform.name == "sheevaplug" || platform.name == "versatileARM") -> + stdenv.system == "armv5tel-linux"; let @@ -66,14 +73,19 @@ stdenv.mkDerivation { map ({extraConfig ? "", ...}: extraConfig) kernelPatches; in lib.concatStringsSep "\n" ([config] ++ configFromPatches); - # For UML, just ignore all options that don't apply (I'm lazy). - ignoreConfigErrors = userModeLinux; + # For UML and non-PC, just ignore all options that don't apply (We are lazy). + ignoreConfigErrors = (userModeLinux || stdenv.system == "armv5tel-linux"); - buildInputs = [ perl mktemp ]; + buildInputs = [ perl mktemp ] + ++ lib.optional (platform.uboot != null) [platform.uboot]; + + platformName = platform.name; + kernelBaseConfig = platform.kernelBaseConfig; arch = if xen then "xen" else if userModeLinux then "um" else + if platform ? kernelArch then platform.kernelArch else if stdenv.system == "i686-linux" then "i386" else if stdenv.system == "x86_64-linux" then "x86_64" else abort "Platform ${stdenv.system} is not supported."; diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.31.nix b/pkgs/os-specific/linux/kernel/linux-2.6.31.nix index 006e2eda4914..6bc7e84f3fa4 100644 --- a/pkgs/os-specific/linux/kernel/linux-2.6.31.nix +++ b/pkgs/os-specific/linux/kernel/linux-2.6.31.nix @@ -20,7 +20,7 @@ import ./generic.nix ( iwlwifi = true; }; - preConfigure = '' + preConfigure = if (stdenv.system != "armv5tel-linux") then '' killOption () { sed -re 's/^('"$1"')=[ym]/# \1 is not set/' -i .config } @@ -57,9 +57,10 @@ import ./generic.nix ( setOptionYes CONFIG_PREEMPT_VOLUNTARY cp .config ${config} - ''; + '' else ""; - config = "./kernel-config"; + config = if (stdenv.system == "armv5tel-linux") then + (./config-2.6.31-armv5tel) else "./kernel-config"; } // args diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.32.nix b/pkgs/os-specific/linux/kernel/linux-2.6.32.nix index b4808a951ea4..17db41b12503 100644 --- a/pkgs/os-specific/linux/kernel/linux-2.6.32.nix +++ b/pkgs/os-specific/linux/kernel/linux-2.6.32.nix @@ -1,4 +1,5 @@ -args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? "", ... }: +args @ { stdenv, fetchurl, platform, userModeLinux ? false, extraConfig ? "" +, ... }: import ./generic.nix ( @@ -11,7 +12,7 @@ import ./generic.nix ( }; features.iwlwifi = true; - + config = '' # Don't include any debug features. @@ -26,16 +27,6 @@ import ./generic.nix ( # Optimize with -O2, not -Os. CC_OPTIMIZE_FOR_SIZE n - # Virtualisation (KVM, Xen...). - PARAVIRT_GUEST y - KVM_CLOCK y - KVM_GUEST y - XEN y - KSM y - - # We need 64 GB (PAE) support for Xen guest support. - HIGHMEM64G? y - # Enable the kernel's built-in memory tester. MEMTEST y @@ -207,6 +198,7 @@ import ./generic.nix ( X86_CHECK_BIOS_CORRUPTION y X86_MCE y + ${if platform ? kernelExtraConfig then platform.kernelExtraConfig else ""} ${extraConfig} ''; } diff --git a/pkgs/os-specific/linux/klibc/1.5.nix b/pkgs/os-specific/linux/klibc/1.5.nix index 3a92c2f4d297..72b9c12698be 100644 --- a/pkgs/os-specific/linux/klibc/1.5.nix +++ b/pkgs/os-specific/linux/klibc/1.5.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, perl, bison, mktemp, kernelHeaders}: +{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders}: assert stdenv.isLinux; @@ -18,7 +18,7 @@ stdenv.mkDerivation { makeFlags=$(eval "echo $makeFlags") mkdir linux - cp -prsd ${kernelHeaders}/include linux/ + cp -prsd ${linuxHeaders}/include linux/ chmod -R u+w linux/include/ ''; # */ diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index 7f4229efe85a..8bd911ee0805 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, perl, bison, mktemp, kernelHeaders}: +{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders}: assert stdenv.isLinux; @@ -15,10 +15,12 @@ stdenv.mkDerivation { makeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"]; preBuild = '' + sed -i /CONFIG_AEABI/d defconfig + echo "CONFIG_AEABI=y" >> defconfig makeFlags=$(eval "echo $makeFlags") mkdir linux - cp -prsd ${kernelHeaders}/include linux/ + cp -prsd ${linuxHeaders}/include linux/ chmod -R u+w linux/include/ ''; # */ diff --git a/pkgs/os-specific/linux/kvm/76.nix b/pkgs/os-specific/linux/kvm/76.nix index e438f044c593..99d16b27a845 100644 --- a/pkgs/os-specific/linux/kvm/76.nix +++ b/pkgs/os-specific/linux/kvm/76.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, kernelHeaders, zlib, e2fsprogs, SDL, alsaLib, pkgconfig, rsync}: +{stdenv, fetchurl, linuxHeaders, zlib, e2fsprogs, SDL, alsaLib, pkgconfig, rsync}: assert stdenv.isLinux; @@ -18,7 +18,7 @@ stdenv.mkDerivation { ./readonly-kernel-r2.patch ]; - configureFlags = "--with-patched-kernel --kerneldir=${kernelHeaders}"; + configureFlags = "--with-patched-kernel --kerneldir=${linuxHeaders}"; # e2fsprogs is needed for libuuid. # rsync is a weird dependency used for copying kernel header files. diff --git a/pkgs/os-specific/linux/kvm/86.nix b/pkgs/os-specific/linux/kvm/86.nix index 1b468385f1fa..5989988d5aa1 100644 --- a/pkgs/os-specific/linux/kvm/86.nix +++ b/pkgs/os-specific/linux/kvm/86.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, kernelHeaders, zlib, SDL, alsaLib, pkgconfig, pciutils}: +{stdenv, fetchurl, linuxHeaders, zlib, SDL, alsaLib, pkgconfig, pciutils}: assert stdenv.isLinux; diff --git a/pkgs/os-specific/linux/kvm/88.nix b/pkgs/os-specific/linux/kvm/88.nix index bfbfbd8e47c1..2a8a1b0ef197 100644 --- a/pkgs/os-specific/linux/kvm/88.nix +++ b/pkgs/os-specific/linux/kvm/88.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, kernelHeaders, zlib, SDL, alsaLib, pkgconfig, pciutils}: +{stdenv, fetchurl, linuxHeaders, zlib, SDL, alsaLib, pkgconfig, pciutils}: assert stdenv.isLinux; diff --git a/pkgs/os-specific/linux/pam_login/default.nix b/pkgs/os-specific/linux/pam_login/default.nix index 954606eef6c3..724e316a15a0 100644 --- a/pkgs/os-specific/linux/pam_login/default.nix +++ b/pkgs/os-specific/linux/pam_login/default.nix @@ -8,5 +8,11 @@ stdenv.mkDerivation { sha256 = "1w2hpwjhmwjhf8rg789xpl0hibahqlr3ccivfy3m4kgrm5gf04kv"; }; + # To overcome a gcc 4.4 warning: + # "#ident is a deprecated GCC extension" + patchPhase = '' + sed -i s/-Werror// configure + ''; + buildInputs = [pam]; } diff --git a/pkgs/os-specific/linux/pam_unix2/default.nix b/pkgs/os-specific/linux/pam_unix2/default.nix index f215d69ea8ab..d48598afd0d3 100644 --- a/pkgs/os-specific/linux/pam_unix2/default.nix +++ b/pkgs/os-specific/linux/pam_unix2/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, pam, libxcrypt}: +{ stdenv, fetchurl, pam, libxcrypt }: stdenv.mkDerivation { name = "pam_unix2-2.6"; @@ -8,5 +8,9 @@ stdenv.mkDerivation { sha256 = "067xnyd3q8ik73glxwyx1lydk4bgl78lzq44mnqqp4jrpnpd04ml"; }; - buildInputs = [pam libxcrypt]; + buildInputs = [ pam ] ++ stdenv.lib.optional (stdenv.system != "armv5tel-linux") libxcrypt; + + meta = { + homepage = ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2; + }; } diff --git a/pkgs/os-specific/linux/splashutils/1.3.nix b/pkgs/os-specific/linux/splashutils/1.3.nix deleted file mode 100644 index 51c53dd2a799..000000000000 --- a/pkgs/os-specific/linux/splashutils/1.3.nix +++ /dev/null @@ -1,42 +0,0 @@ -{stdenv, fetchurl, klibc, zlib, libjpeg}: - -stdenv.mkDerivation { - name = "splashutils-1.3"; - - src = fetchurl { - url = http://dev.gentoo.org/~spock/projects/splashutils/archive/splashutils-1.3.tar.bz2; - md5 = "c7c92b98e34b860511aa57bd29d62f76"; - }; - - patches = [ - ./purity.patch - ./no-fbsplash.patch - # Borrowed from http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/media-gfx/splashutils/files/splashutils-1.3-fdset.patch?rev=1.1. - ./fdset.patch - ]; - - buildInputs = [klibc zlib libjpeg]; - - inherit klibc; - - dontAddPrefix = 1; - configureScript = "sh ./configure"; - configureFlags = "--without-ttf --without-png --with-fifo=/var/run/splash_fifo"; - - # QUIET = false doesn't work due to the use of /dev/stdout (which - # doesn't work when the build user doesn't own stdout). - #makeFlags = "QUIET=false; - - installPhase = '' - ensureDir $out/bin - cp objs/splash_util objs/splash_util.static $out/bin - ensureDir $out/sbin - cp objs/splash_helper $out/sbin - ''; - - passthru = { - helperName = "sbin/splash_helper"; - controlName = "bin/splash_util"; - helperProcFile = "/proc/sys/kernel/fbsplash"; - }; -} diff --git a/pkgs/os-specific/linux/splashutils/1.5.nix b/pkgs/os-specific/linux/splashutils/default.nix similarity index 100% rename from pkgs/os-specific/linux/splashutils/1.5.nix rename to pkgs/os-specific/linux/splashutils/default.nix diff --git a/pkgs/os-specific/linux/splashutils/fdset.patch b/pkgs/os-specific/linux/splashutils/fdset.patch deleted file mode 100644 index 44c61339c454..000000000000 --- a/pkgs/os-specific/linux/splashutils/fdset.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/core/render.c b/core/render.c -index 290ea97..47319a8 100644 ---- a/render.c -+++ b/render.c -@@ -9,8 +9,15 @@ - * - */ - -+/* -+ * HACK WARNING: -+ * This is necessary to get FD_SET and FD_ZERO on platforms other than x86. -+ */ -+ - #ifdef TARGET_KERNEL -+#define __KERNEL__ - #include -+#undef __KERNEL__ - #endif - - #include diff --git a/pkgs/os-specific/linux/splashutils/no-fbsplash.patch b/pkgs/os-specific/linux/splashutils/no-fbsplash.patch deleted file mode 100644 index f83275ea84a1..000000000000 --- a/pkgs/os-specific/linux/splashutils/no-fbsplash.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -rc splashutils-1.3-orig/splash.h splashutils-1.3/splash.h -*** splashutils-1.3-orig/splash.h 2006-07-15 00:02:23.000000000 +0200 ---- splashutils-1.3/splash.h 2009-01-29 16:41:00.000000000 +0100 -*************** -*** 21,40 **** - */ - #ifdef TARGET_KERNEL - #include -- #include - #else - #include -- #include - #endif - - /* - * Necessary to avoid compilation errors when fbsplash support is - * disabled. - */ -- #if !defined(CONFIG_FBSPLASH) - #define FB_SPLASH_IO_ORIG_USER 0 - #define FB_SPLASH_IO_ORIG_KERNEL 1 -! #endif - - /* - * Adjustable settings ---- 21,60 ---- - */ - #ifdef TARGET_KERNEL - #include - #else - #include - #endif - - /* - * Necessary to avoid compilation errors when fbsplash support is - * disabled. - */ - #define FB_SPLASH_IO_ORIG_USER 0 - #define FB_SPLASH_IO_ORIG_KERNEL 1 -! -! #define FBIOSPLASH_SETCFG _IOWR('F', 0x19, struct fb_splash_iowrapper) -! #define FBIOSPLASH_GETCFG _IOR('F', 0x1A, struct fb_splash_iowrapper) -! #define FBIOSPLASH_SETSTATE _IOWR('F', 0x1B, struct fb_splash_iowrapper) -! #define FBIOSPLASH_GETSTATE _IOR('F', 0x1C, struct fb_splash_iowrapper) -! #define FBIOSPLASH_SETPIC _IOWR('F', 0x1D, struct fb_splash_iowrapper) -! -! #define FB_SPLASH_THEME_LEN 128 /* Maximum lenght of a theme name */ -! -! struct fb_splash_iowrapper -! { -! unsigned short vc; /* Virtual console */ -! unsigned char origin; /* Point of origin of the request */ -! void *data; -! }; -! -! /* A structure used by the framebuffer splash code (drivers/video/fbsplash.c) */ -! struct vc_splash { -! __u8 bg_color; /* The color that is to be treated as transparent */ -! __u8 state; /* Current splash state: 0 = off, 1 = on */ -! __u16 tx, ty; /* Top left corner coordinates of the text field */ -! __u16 twidth, theight; /* Width and height of the text field */ -! char* theme; -! }; - - /* - * Adjustable settings -Only in splashutils-1.3/: splash.h~ diff --git a/pkgs/os-specific/linux/splashutils/purity.patch b/pkgs/os-specific/linux/splashutils/purity.patch deleted file mode 100644 index 45cbafb7161a..000000000000 --- a/pkgs/os-specific/linux/splashutils/purity.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -rc splashutils-1.3-orig/Makefile splashutils-1.3/Makefile -*** splashutils-1.3-orig/Makefile 2006-07-15 00:02:22.000000000 +0200 ---- splashutils-1.3/Makefile 2006-11-26 00:25:48.000000000 +0100 -*************** -*** 28,34 **** - usrbindir = ${prefix}/usr/bin - mandir = ${prefix}/usr/share/man - -! INSTALL = /usr/bin/install -c - INSTALL_PROG = ${INSTALL} - INSTALL_DATA = ${INSTALL} -m 644 - INSTALL_SCRIPT = ${INSTALL_PROG} ---- 28,34 ---- - usrbindir = ${prefix}/usr/bin - mandir = ${prefix}/usr/share/man - -! INSTALL = install -c - INSTALL_PROG = ${INSTALL} - INSTALL_DATA = ${INSTALL} -m 644 - INSTALL_SCRIPT = ${INSTALL_PROG} -*************** -*** 71,77 **** - - # Include the klibc header files so that we can compile against fb.h - # from a kernel thee patched with fbsplash. -! INCLUDES = -I/usr/include/freetype2 -idirafter /usr/lib/klibc/include/linux - OBJS = $(OBJDIR)/splash.o $(OBJDIR)/parse.o $(OBJDIR)/render.o $(OBJDIR)/image.o \ - $(OBJDIR)/cmd.o $(OBJDIR)/common.o $(OBJDIR)/daemon.o $(OBJDIR)/daemon_cmd.o \ - $(OBJDIR)/list.o $(OBJDIR)/effects.o ---- 71,77 ---- - - # Include the klibc header files so that we can compile against fb.h - # from a kernel thee patched with fbsplash. -! INCLUDES = -I${freetype}/include/freetype2 -idirafter ${klibc}/lib/klibc/include/linux - OBJS = $(OBJDIR)/splash.o $(OBJDIR)/parse.o $(OBJDIR)/render.o $(OBJDIR)/image.o \ - $(OBJDIR)/cmd.o $(OBJDIR)/common.o $(OBJDIR)/daemon.o $(OBJDIR)/daemon_cmd.o \ - $(OBJDIR)/list.o $(OBJDIR)/effects.o -Only in splashutils-1.3/: Makefile~ diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix new file mode 100644 index 000000000000..3390469545f6 --- /dev/null +++ b/pkgs/os-specific/linux/uclibc/default.nix @@ -0,0 +1,72 @@ +{stdenv, fetchurl, linuxHeaders, gccCross ? null}: + +assert stdenv.isLinux; + +let + target = if (gccCross != null) then gccCross.target else null; + enableArmEABI = (target == null && stdenv.system "armv5tel-linux") + || (target != null && target.arch == "arm"); + + configArmEABI = if enableArmEABI then + ''-e 's/.*CONFIG_ARM_OABI.*//' \ + -e 's/.*CONFIG_ARM_EABI.*/CONFIG_ARM_EABI=y/' '' else ""; + + enableBigEndian = (target != null && target.bigEndian); + + configBigEndian = if enableBigEndian then "" + else + ''-e 's/.*ARCH_BIG_ENDIAN.*/#ARCH_BIG_ENDIAN=y/' \ + -e 's/.*ARCH_WANTS_BIG_ENDIAN.*/#ARCH_WANTS_BIG_ENDIAN=y/' \ + -e 's/.*ARCH_WANTS_LITTLE_ENDIAN.*/ARCH_WANTS_LITTLE_ENDIAN=y/' ''; + + archMakeFlag = if (target != null) then "ARCH=${target.arch}" else ""; + crossMakeFlag = if (target != null) then "CROSS=${target.config}-" else ""; +in +stdenv.mkDerivation { + name = "uclibc-0.9.30.1" + stdenv.lib.optionalString (target != null) + ("-" + target.config); + + src = fetchurl { + url = http://www.uclibc.org/downloads/uClibc-0.9.30.1.tar.bz2; + sha256 = "132cf27hkgi0q4qlwbiyj4ffj76sja0jcxm0aqzzgks65jh6k5rd"; + }; + + configurePhase = '' + make defconfig ${archMakeFlag} + sed -e s@/usr/include@${linuxHeaders}/include@ \ + -e 's@^RUNTIME_PREFIX.*@RUNTIME_PREFIX="/"@' \ + -e 's@^DEVEL_PREFIX.*@DEVEL_PREFIX="/"@' \ + -e 's@.*UCLIBC_HAS_WCHAR.*@UCLIBC_HAS_WCHAR=y@' \ + -e 's@.*DO_C99_MATH.*@DO_C99_MATH=y@' \ + -e 's@.*UCLIBC_HAS_PROGRAM_INVOCATION_NAME.*@UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y@' \ + ${configArmEABI} \ + ${configBigEndian} \ + -i .config + make oldconfig + ''; + + # Cross stripping hurts. + dontStrip = if (target != null) then true else false; + + makeFlags = [ crossMakeFlag "VERBOSE=1" ]; + + buildInputs = stdenv.lib.optional (gccCross != null) gccCross; + + patches = [ ./unifdef-getline.patch ]; + + # This will allow the usual gcc-cross-wrapper strip phase work as usual + crossConfig = if (target != null) then target.config else null; + + installPhase = '' + mkdir -p $out + make PREFIX=$out VERBOSE=1 install ${crossMakeFlag} + (cd $out/include && ln -s ${linuxHeaders}/include/* .) || exit 1 + sed -i s@/lib/@$out/lib/@g $out/lib/libc.so + ''; + + meta = { + homepage = http://www.uclibc.org/; + description = "A small implementation of the C library"; + license = "LGPLv2"; + }; +} diff --git a/pkgs/os-specific/linux/uclibc/unifdef-getline.patch b/pkgs/os-specific/linux/uclibc/unifdef-getline.patch new file mode 100644 index 000000000000..7e6a50014a37 --- /dev/null +++ b/pkgs/os-specific/linux/uclibc/unifdef-getline.patch @@ -0,0 +1,31 @@ +diff --git a/extra/scripts/unifdef.c b/extra/scripts/unifdef.c +index 552025e..977e682 100644 +--- a/extra/scripts/unifdef.c ++++ b/extra/scripts/unifdef.c +@@ -206,7 +206,7 @@ static void done(void); + static void error(const char *); + static int findsym(const char *); + static void flushline(bool); +-static Linetype getline(void); ++static Linetype parseline(void); + static Linetype ifeval(const char **); + static void ignoreoff(void); + static void ignoreon(void); +@@ -512,7 +512,7 @@ process(void) + + for (;;) { + linenum++; +- lineval = getline(); ++ lineval = parseline(); + trans_table[ifstate[depth]][lineval](); + debug("process %s -> %s depth %d", + linetype_name[lineval], +@@ -526,7 +526,7 @@ process(void) + * help from skipcomment(). + */ + static Linetype +-getline(void) ++parseline(void) + { + const char *cp; + int cursym; diff --git a/pkgs/os-specific/linux/uml-utilities/default.nix b/pkgs/os-specific/linux/uml-utilities/default.nix index 4fb4ea553105..4ed7c6e8a3ad 100644 --- a/pkgs/os-specific/linux/uml-utilities/default.nix +++ b/pkgs/os-specific/linux/uml-utilities/default.nix @@ -1,8 +1,8 @@ -{lib, stdenv, fetchurl, kernelHeaders , readline, tunctl ? false, mconsole ? false}: +{lib, stdenv, fetchurl, linuxHeaders , readline, tunctl ? false, mconsole ? false}: stdenv.mkDerivation { inherit tunctl mconsole; - buildInputs = lib.optional tunctl kernelHeaders + buildInputs = lib.optional tunctl linuxHeaders ++ lib.optional mconsole readline; name = "uml-utilities-20040114"; builder = ./builder.sh; diff --git a/pkgs/os-specific/linux/util-linux-ng/default.nix b/pkgs/os-specific/linux/util-linux-ng/default.nix index e70f2dfcb07b..3ab1c5808379 100644 --- a/pkgs/os-specific/linux/util-linux-ng/default.nix +++ b/pkgs/os-specific/linux/util-linux-ng/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, ncurses ? null, ... }: stdenv.mkDerivation rec { - name = "util-linux-ng-2.16"; + name = "util-linux-ng-2.16.2"; src = fetchurl { url = "mirror://kernel/linux/utils/util-linux-ng/v2.16/${name}.tar.bz2"; - sha256 = "08i7qv1rvq3rgi49q64aiy0vdhl6h00ilkhnaam9yhrl5g5mydm6"; + sha256 = "1sx3z64z8z95v93k0c9lczcp04zw4nm3d2rkhczkyxcpdfcgbhxi"; }; configureFlags = '' diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh index 7da1da77340d..528042e3df98 100644 --- a/pkgs/servers/x11/xorg/builder.sh +++ b/pkgs/servers/x11/xorg/builder.sh @@ -15,16 +15,26 @@ postInstall() { echo "propagating requisites $requires" for r in $requires; do - for p in $pkgs; do - if test -e $p/lib/pkgconfig/$r.pc; then - echo " found requisite $r in $p" - propagatedBuildInputs="$propagatedBuildInputs $p" - fi - done + if test -n "$crossConfig"; then + for p in $crossPkgs; do + if test -e $p/lib/pkgconfig/$r.pc; then + echo " found requisite $r in $p" + propagatedBuildInputs="$propagatedBuildInputs $p" + fi + done + else + for p in $nativePkgs; do + if test -e $p/lib/pkgconfig/$r.pc; then + echo " found requisite $r in $p" + propagatedBuildNativeInputs="$propagatedBuildNativeInputs $p" + fi + done + fi done ensureDir "$out/nix-support" echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs" + echo "$propagatedBuildNativeInputs" > "$out/nix-support/propagated-build-native-inputs" } diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 372ab0961839..4e8466f2621b 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -1,5 +1,11 @@ {args, xorg}: - +let + setMalloc0ReturnsNullCrossCompiling = '' + if test -n "$crossConfig"; then + configureFlags="$configureFlags --enable-malloc0returnsnull"; + fi + ''; +in { fontmiscmisc = attrs: attrs // { @@ -21,8 +27,55 @@ preBuild = "substituteInPlace mkfontdir.cpp --replace BINDIR ${xorg.mkfontscale}/bin"; }; + libxcb = attrs : attrs // { + # I only remove python from the original, and add xproto. I don't know how + # to achieve that referring to attrs.buildInputs. + # I should use: builtins.unsafeDiscardStringContext + buildInputs = [args.pkgconfig args.libxslt xorg.libpthreadstubs /*xorg.python*/ + xorg.libXau xorg.xcbproto xorg.libXdmcp ] ++ [ xorg.xproto ]; + buildNativeInputs = [ args.python ]; + }; + + xcbproto = attrs : attrs // { + # I only remove python from the original. + buildInputs = [args.pkgconfig /*xorg.python*/ ]; + buildNativeInputs = [ args.python ]; + }; + + pixman = attrs : attrs // { + buildInputs = [ args.pkgconfig ]; + buildNativeInputs = [ args.perl ]; + }; + + libX11 = attrs: attrs // { + preConfigure = setMalloc0ReturnsNullCrossCompiling; + }; + + libXrender = attrs: attrs // { + preConfigure = setMalloc0ReturnsNullCrossCompiling; + }; + + libXxf86vm = attrs: attrs // { + preConfigure = setMalloc0ReturnsNullCrossCompiling; + }; + + libXrandr = attrs: attrs // { + preConfigure = setMalloc0ReturnsNullCrossCompiling; + }; + + libXt = attrs: attrs // { + preConfigure = setMalloc0ReturnsNullCrossCompiling; + }; + + libXft = attrs: attrs // { + buildInputs = attrs.buildInputs ++ [ xorg.xproto xorg.libX11 + xorg.renderproto ]; + preConfigure = setMalloc0ReturnsNullCrossCompiling; + }; + libXext = attrs: attrs // { buildInputs = attrs.buildInputs ++ [xorg.libXau]; + preConfigure = setMalloc0ReturnsNullCrossCompiling; }; libXpm = attrs: attrs // { diff --git a/pkgs/shells/bash/bash-patches.nix b/pkgs/shells/bash/bash-patches.nix new file mode 100644 index 000000000000..d22435744ccc --- /dev/null +++ b/pkgs/shells/bash/bash-patches.nix @@ -0,0 +1,6 @@ +# Automatically generated by `update-patch-set.sh'; do not edit. + +patch: [ +(patch "001" "0y02cbfnc5s3dnwr4fw2nz43f3b826f5084mk7qd0lzq12hpzr56") +(patch "002" "1y3qzw6lx16vnb8hrw3zx01z25k773cbmgysvs3vvcw6w6fj4bij") +] diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix index 8a58f7aec00a..0f4b610f4123 100644 --- a/pkgs/shells/bash/default.nix +++ b/pkgs/shells/bash/default.nix @@ -2,12 +2,14 @@ assert interactive -> readline != null; +let realName = "bash-4.1"; in + stdenv.mkDerivation rec { - name = "bash-4.0-p17"; + name = "${realName}-p${toString (builtins.length patches)}"; src = fetchurl { - url = "mirror://gnu/bash/bash-4.0.tar.gz"; - sha256 = "0605ql0ih55gpi0vfvcm45likzjafa4wjnkxqwq51aa0ysad74wp"; + url = "mirror://gnu/bash/${realName}.tar.gz"; + sha256 = "1np1ggp1lv8idwfx3mcxl9rhadqdf4h3x4isa3dk8v9wm0j72qiz"; }; NIX_CFLAGS_COMPILE = '' @@ -19,43 +21,36 @@ stdenv.mkDerivation rec { -DSSH_SOURCE_BASHRC ''; - postInstall = "ln -s bash $out/bin/sh"; - patchFlags = "-p0"; patches = let patch = nr: sha256: fetchurl { - url = "mirror://gnu/bash/bash-4.0-patches/bash40-${nr}"; + url = "mirror://gnu/bash/bash-4.1-patches/bash41-${nr}"; inherit sha256; }; - in [ - (patch "001" "06q3y3i2kp09bnjd99lxa95psdmj2haril7pxhdbz9sx9qh19dg3") - (patch "002" "1x2w3mmz1qga30zf95wmnpjsdp8cnd2ljl29mfq9r6q1cvjifla9") - (patch "003" "1n3vg6p4nc7kd896s0fp48y9f6ddf3bkpdqzgmdpgqxi243c8073") - (patch "004" "1bnja962g9isrqhrw8dzxsx7ssvc2ayk1a9vmg2dx6gai8gys0sb") - (patch "005" "0l4l62riap2kqy20789x7f6bfx361yvixds0gnh10rli4v05h1j2") - (patch "006" "1r429n2b5cs2gi5zjv1hlr8k7jplnjg3y563369z799x1x9651y7") - (patch "007" "0vb11vy8r5ayr88hrlli8xj2qcird1qg8l99nknrwnni4jg5b3am") - (patch "008" "1z6q0lq1yxwpf6nf1z39jbyycv6cfv6gwpaqmgg7pnw31z029nw7") - (patch "009" "0avyvz8rkj66x715zf1b3w2pgbwwzaj977v9pcrscjksc50c4iq0") - (patch "010" "05j8xq2s1wnii1za1s6nglzga9xp7q1dmcs1bqqrlggz8mmnyhgj") - (patch "011" "1m2lhfhy6bl3j88qi9kcn6n1qb439n8pmhl4cqsmi2g8xwli9j7z") - (patch "012" "1ww327ga4s7607jgr0xd6nh8bg4xgf2vk63p2yy9b1iaq7lxdi5j") - (patch "013" "0fjc3qj4q6q2zfq1qmiarp6s4hhbh80q47xwws0mvgpks7wwl33n") - (patch "014" "16n3l7627n8b1p9s9ss9fcj7nbn1s6yndwmlh3v751knj73c9v8k") - (patch "015" "0548fm4vd3sv3y4g3csysm1mm7jk5hvyfwglw1c0pj2lvyzf583v") - (patch "016" "06fmf6jmgzl0x1vd7pkyi90sa1wjywkd42gi1phqmrwgj9p96flg") - (patch "017" "08gh63spac39z90n1d8gpx571x7n4bwzp2yqm3ik9c1rcgz2mvib") - ]; + in + import ./bash-patches.nix patch; # Note: Bison is needed because the patches above modify parse.y. - buildInputs = [bison] - ++ stdenv.lib.optional (texinfo != null) texinfo + buildNativeInputs = [bison]; + buildInputs = stdenv.lib.optional (texinfo != null) texinfo ++ stdenv.lib.optional interactive readline; - configureFlags = "--with-installed-readline"; + configureFlags = if interactive then "--with-installed-readline" else "--disable-readline"; + + postInstall = '' + # Add an `sh' -> `bash' symlink. + ln -s bash "$out/bin/sh" + + # Install the completion examples. + ensureDir "$out/etc" + cp -v "examples/complete/bash_completion" "$out/etc" + + ensureDir "$out/etc/bash_completion.d" + cp -v "examples/complete/complete.gnu-longopt" "$out/etc/bash_completion.d" + ''; meta = { homepage = http://www.gnu.org/software/bash/; @@ -75,5 +70,7 @@ stdenv.mkDerivation rec { ''; license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/shells/bash/update-patch-set.sh b/pkgs/shells/bash/update-patch-set.sh new file mode 100755 index 000000000000..ded684571b0a --- /dev/null +++ b/pkgs/shells/bash/update-patch-set.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# Update patch set for GNU Bash or Readline. + +if [ $# -ne 2 ] +then + echo "Usage: $(basename $0) PROJECT VERSION" + echo "" + echo "Update the patch set for PROJECT (one of \`bash' or \`readline') for" + echo "the given version (e.g., \`4.0'). Produce \`PROJECT-patches.nix'." + exit 1 +fi + +PROJECT="$1" +VERSION="$2" +VERSION_CONDENSED="$(echo $VERSION | sed -es/\\.//g)" + +GPG="$(if $(type -P gpg2 > /dev/null); then echo gpg2; else echo gpg; fi)" +PATCH_LIST="$PROJECT-patches.nix" + +set -e + +start=1 +end=100 # must be > 99 for correct padding + +rm -vf "$PATCH_LIST" + +( echo "# Automatically generated by \`$(basename $0)'; do not edit." ; \ + echo "" ; \ + echo "patch: [" ) \ +>> "$PATCH_LIST" + +for i in `seq -w $start $end` +do + wget ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i || break + wget ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i.sig + "$GPG" --verify $PROJECT$VERSION_CONDENSED-$i.sig + echo "(patch \"$i\" \"$(nix-hash --flat --type sha256 --base32 $PROJECT$VERSION_CONDENSED-$i)\")" \ + >> "$PATCH_LIST" + + rm -f $PROJECT$VERSION_CONDENSED-$i{,.sig} +done + +echo "]" >> "$PATCH_LIST" + +echo "Got $(expr $i - 1) patches." +echo "Patch list has been written to \`$PATCH_LIST'." diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 9e02a8bd307f..33e1f8505d27 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -107,7 +107,76 @@ rec { isStatic = true; } // {inherit fetchurl;}; + + # Return a modified stdenv that enables building static libraries. + enableStaticLibraries = stdenv: stdenv // + { mkDerivation = args: stdenv.mkDerivation (args // { + dontDisableStatic = true; + configureFlags = + (if args ? configureFlags then args.configureFlags else "") + + " --enable-static"; + }); + } // {inherit fetchurl;}; + + # Return a modified stdenv that adds a cross compiler to the + # builds. + makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv // + { mkDerivation = {name ? "", buildInputs ? [], buildNativeInputs ? [], + propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [], + selfBuildNativeInput ? false, ...}@args: let + + # *BuildInputs exists temporarily as another name for + # *HostInputs. + + getBuildDrv = drv : if (drv ? buildDrv) then drv.buildDrv else drv; + buildNativeInputsDrvs = map (getBuildDrv) buildNativeInputs; + buildInputsDrvs = map (drv: drv.hostDrv) buildInputs; + buildInputsDrvsAsBuildInputs = map (getBuildDrv) buildInputs; + propagatedBuildInputsDrvs = map (drv: drv.hostDrv) (propagatedBuildInputs); + propagatedBuildNativeInputsDrvs = map (drv: drv.buildDrv) + (propagatedBuildNativeInputs); + + # The base stdenv already knows that buildNativeInputs and + # buildInputs should be built with the usual gcc-wrapper + # And the same for propagatedBuildInputs. + buildDrv = stdenv.mkDerivation args; + + # Temporary expression until the cross_renaming, to handle the + # case of pkgconfig given as buildInput, but to be used as + # buildNativeInput. + hostAsBuildDrv = drv: builtins.unsafeDiscardStringContext + drv.buildDrv.drvPath == builtins.unsafeDiscardStringContext + drv.hostDrv.drvPath; + nativeInputsFromBuildInputs = stdenv.lib.filter (hostAsBuildDrv) buildInputs; + + # We should overwrite the input attributes in hostDrv, to overwrite + # the defaults for only-native builds in the base stdenv + hostDrv = if (cross == null) then buildDrv else + stdenv.mkDerivation (args // { + name = name + "-" + cross.config; + buildNativeInputs = buildNativeInputsDrvs + ++ nativeInputsFromBuildInputs + ++ [ gccCross binutilsCross ] ++ + stdenv.lib.optional selfBuildNativeInput buildDrv; + + # Cross-linking dynamic libraries, every buildInput should + # be propagated because ld needs the -rpath-link to find + # any library needed to link the program dynamically at + # loader time. ld(1) explains it. + buildInputs = []; + propagatedBuildInputs = propagatedBuildInputsDrvs ++ + buildInputsDrvs; + propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs; + + crossConfig = cross.config; + }); + in buildDrv // { + inherit hostDrv buildDrv; + }; + } // { inherit cross; }; + + /* Modify a stdenv so that the specified attributes are added to every derivation returned by its mkDerivation function. @@ -211,7 +280,6 @@ rec { /* Use the trace output to report all processed derivations with their license name. - */ traceDrvLicenses = stdenv: stdenv // { mkDerivation = args: @@ -233,6 +301,7 @@ rec { }; }; + /* Abort if the license predicate is not verified for a derivation declared with mkDerivation. diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 37fd75328114..40acb8cfece4 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -54,6 +54,7 @@ rec { stdenv = if stdenvType == "i686-linux" then stdenvLinux else if stdenvType == "x86_64-linux" then stdenvLinux else + if stdenvType == "armv5tel-linux" then stdenvLinux else if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else if stdenvType == "i686-mingw" then stdenvMinGW else if stdenvType == "i686-darwin" then stdenvNix else diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index bea36088c748..191dd54c6aea 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -45,14 +45,36 @@ let mkDerivation = attrs: (derivation ( (removeAttrs attrs ["meta" "passthru"]) - // + // (let + buildInputs = if attrs ? buildInputs then attrs.buildInputs + else []; + buildNativeInputs = if attrs ? buildNativeInputs then + attrs.buildNativeInputs else []; + propagatedBuildInputs = if attrs ? propagatedBuildInputs then + attrs.propagatedBuildInputs else []; + propagatedBuildNativeInputs = if attrs ? + propagatedBuildNativeInputs then + attrs.propagatedBuildNativeInputs else []; + crossConfig = if (attrs ? crossConfig) then attrs.crossConfig else + null; + in { builder = if attrs ? realBuilder then attrs.realBuilder else shell; args = if attrs ? args then attrs.args else ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)]; stdenv = result; system = result.system; - }) + + # That build by the cross compiler + buildInputs = lib.optionals (crossConfig != null) buildInputs; + propagatedBuildInputs = lib.optionals (crossConfig != null) + propagatedBuildInputs; + # That build by the usual native compiler + buildNativeInputs = buildNativeInputs ++ lib.optionals + (crossConfig == null) buildInputs; + propagatedBuildNativeInputs = propagatedBuildNativeInputs ++ + lib.optionals (crossConfig == null) propagatedBuildInputs; + })) ) # The meta attribute is passed in the resulting attribute set, # but it's not part of the actual derivation, i.e., it's not @@ -71,7 +93,8 @@ let isDarwin = result.system == "i686-darwin" || result.system == "powerpc-darwin" || result.system == "x86_64-darwin"; isLinux = result.system == "i686-linux" || result.system == "x86_64-linux" - || result.system == "powerpc-linux"; + || result.system == "powerpc-linux" + || result.system == "armv5tel-linux"; isi686 = result.system == "i686-linux" || result.system == "i686-darwin" || result.system == "i686-freebsd" diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index cadfeadc6dbe..5e2fc7b24dbe 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -4,11 +4,12 @@ # environment variables) and from shell scripts (as functions). runHook() { local hookName="$1" - if test "$(type -t $hookName)" = function; then - $hookName - else - eval "${!hookName}" - fi + case "$(type -t $hookName)" in + (function|alias|builtin) $hookName;; + (file) source $hookName;; + (keyword) :;; + (*) eval "${!hookName}";; + esac } @@ -78,6 +79,10 @@ addToSearchPath() { set -e +# Check that the directory pointed by HOME, usually '/homeless-shelter', +# does not exist, as it may be a good source for impurities. +! test -e $HOME + test -z $NIX_GCC && NIX_GCC=@gcc@ @@ -119,6 +124,7 @@ if test -z "$SHELL"; then echo "SHELL not set"; exit 1; fi # Hack: run gcc's setup hook. envHooks=() +crossEnvHooks=() if test -f $NIX_GCC/nix-support/setup-hook; then source $NIX_GCC/nix-support/setup-hook fi @@ -147,35 +153,41 @@ runHook addInputsHook # Recursively find all build inputs. findInputs() { local pkg=$1 + local var=$2 + local propagatedBuildInputsFile=$3 - case $pkgs in + case ${!var} in *\ $pkg\ *) return 0 ;; esac - pkgs="$pkgs $pkg " + eval $var="'${!var} $pkg '" if test -f $pkg/nix-support/setup-hook; then source $pkg/nix-support/setup-hook fi - if test -f $pkg/nix-support/propagated-build-inputs; then - for i in $(cat $pkg/nix-support/propagated-build-inputs); do - findInputs $i + if test -f $pkg/nix-support/$propagatedBuildInputsFile; then + for i in $(cat $pkg/nix-support/$propagatedBuildInputsFile); do + findInputs $i $var $propagatedBuildInputsFile done fi } -pkgs="" +crossPkgs="" for i in $buildInputs $propagatedBuildInputs; do - findInputs $i + findInputs $i crossPkgs propagated-build-inputs done +nativePkgs="" +for i in $buildNativeInputs $propagatedBuildNativeInputs; do + findInputs $i nativePkgs propagated-build-native-inputs +done # Set the relevant environment variables to point to the build inputs # found above. -addToEnv() { +addToNativeEnv() { local pkg=$1 if test -d $1/bin; then @@ -188,8 +200,28 @@ addToEnv() { done } -for i in $pkgs; do - addToEnv $i +for i in $nativePkgs; do + addToNativeEnv $i +done + +addToCrossEnv() { + local pkg=$1 + + # Some programs put important build scripts (freetype-config and similar) + # into their hostDrv bin path. Intentionally these should go after + # the nativePkgs in PATH. + if test -d $1/bin; then + addToSearchPath _PATH $1/bin + fi + + # Run the package-specific hooks set by the setup-hook scripts. + for i in "${crossEnvHooks[@]}"; do + $i $pkg + done +} + +for i in $crossPkgs; do + addToCrossEnv $i done @@ -393,15 +425,11 @@ unpackFile() { header "unpacking source archive $curSrc" 3 case "$curSrc" in - *.tar) + *.tar | *.tar.* | *.tgz | *.tbz2) + # GNU tar can automatically select the decompression method + # (info "(tar) gzip"). tar xvf $curSrc ;; - *.tar.gz | *.tgz | *.tar.Z) - gzip -d < $curSrc | tar xvf - - ;; - *.tar.bz2 | *.tbz2) - bzip2 -d < $curSrc | tar xvf - - ;; *.zip) unzip $curSrc ;; @@ -505,6 +533,9 @@ patchPhase() { *.bz2) uncompress="bzip2 -d" ;; + *.lzma) + uncompress="lzma -d" + ;; esac $uncompress < $i | patch ${patchFlags:--p1} stopNest @@ -692,6 +723,11 @@ fixupPhase() { echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs" fi + if test -n "$propagatedBuildNativeInputs"; then + ensureDir "$out/nix-support" + echo "$propagatedBuildNativeInputs" > "$out/nix-support/propagated-build-native-inputs" + fi + if test -n "$setupHook"; then ensureDir "$out/nix-support" substituteAll "$setupHook" "$out/nix-support/setup-hook" diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/bzip2 b/pkgs/stdenv/linux/bootstrap/armv5tel/bzip2 new file mode 100755 index 000000000000..5c9be292fe8b Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/armv5tel/bzip2 differ diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/cpio b/pkgs/stdenv/linux/bootstrap/armv5tel/cpio new file mode 100755 index 000000000000..3d69f9e5bd86 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/armv5tel/cpio differ diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/curl.bz2 b/pkgs/stdenv/linux/bootstrap/armv5tel/curl.bz2 new file mode 100755 index 000000000000..1f2985bd347b Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/armv5tel/curl.bz2 differ diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/default.nix b/pkgs/stdenv/linux/bootstrap/armv5tel/default.nix new file mode 100644 index 000000000000..3a8a03e5a541 --- /dev/null +++ b/pkgs/stdenv/linux/bootstrap/armv5tel/default.nix @@ -0,0 +1,13 @@ +{ + sh = ./sh; + bzip2 = ./bzip2; + mkdir = ./mkdir; + cpio = ./cpio; + ln = ./ln; + curl = ./curl.bz2; + + bootstrapTools = { + url = "http://nixos.org/tarballs/stdenv-linux/armv5tel/r18744/bootstrap-tools.cpio.bz2"; + sha256 = "1rn4n5kilqmv62dfjfcscbsm0w329k3gyb2v9155fsi1sl2cfzcb"; + }; +} diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/ln b/pkgs/stdenv/linux/bootstrap/armv5tel/ln new file mode 100755 index 000000000000..f2c0db164010 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/armv5tel/ln differ diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/mkdir b/pkgs/stdenv/linux/bootstrap/armv5tel/mkdir new file mode 100755 index 000000000000..c551673d32a5 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/armv5tel/mkdir differ diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/sh b/pkgs/stdenv/linux/bootstrap/armv5tel/sh new file mode 100755 index 000000000000..74d82aa94f20 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/armv5tel/sh differ diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index b74258120b3c..dd5647bec456 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -13,6 +13,7 @@ rec { if system == "i686-linux" then import ./bootstrap/i686 else if system == "x86_64-linux" then import ./bootstrap/x86_64 else if system == "powerpc-linux" then import ./bootstrap/powerpc + else if system == "armv5tel-linux" then import ./bootstrap/armv5tel else abort "unsupported platform for the pure Linux stdenv"; @@ -50,7 +51,10 @@ rec { builder = bootstrapFiles.sh; - args = [ ./scripts/unpack-bootstrap-tools.sh ]; + args = if (system == "armv5tel-linux") then + ([ ./scripts/unpack-bootstrap-tools-arm.sh ]) + else + ([ ./scripts/unpack-bootstrap-tools.sh ]); inherit (bootstrapFiles) bzip2 mkdir curl cpio; @@ -89,7 +93,6 @@ rec { extraAttrs = extraAttrs // {inherit fetchurl;}; }; - # Build a dummy stdenv with no GCC or working fetchurl. This is # because we need a stdenv to build the GCC wrapper and fetchurl. stdenvLinuxBoot0 = stdenvBootFun { @@ -120,12 +123,12 @@ rec { # A helper function to call gcc-wrapper. wrapGCC = - {gcc ? bootstrapTools, libc, binutils, shell ? "", name ? "bootstrap-gcc"}: + {gcc ? bootstrapTools, libc, binutils, coreutils, shell ? "", name ? "bootstrap-gcc-wrapper"}: import ../../build-support/gcc-wrapper { nativeTools = false; nativeLibc = false; - inherit gcc binutils libc shell name; + inherit gcc binutils coreutils libc shell name; stdenv = stdenvLinuxBoot0; }; @@ -134,7 +137,11 @@ rec { # of bootstrap tools only, and a minimal Glibc to keep the GCC # configure script happy. stdenvLinuxBoot1 = stdenvBootFun { - gcc = wrapGCC {libc = bootstrapGlibc; binutils = bootstrapTools;}; + gcc = wrapGCC { + libc = bootstrapGlibc; + binutils = bootstrapTools; + coreutils = bootstrapTools; + }; inherit fetchurl; }; @@ -156,8 +163,15 @@ rec { # this one uses the Glibc built in step 3. It still uses # the rest of the bootstrap tools, including GCC. stdenvLinuxBoot2 = removeAttrs (stdenvBootFun { - gcc = wrapGCC {binutils = bootstrapTools; libc = stdenvLinuxGlibc;}; - extraAttrs = {glibc = stdenvLinuxGlibc;}; + gcc = wrapGCC { + binutils = bootstrapTools; + coreutils = bootstrapTools; + libc = stdenvLinuxGlibc; + }; + extraAttrs = { + glibc = stdenvLinuxGlibc; + inherit (stdenvLinuxBoot1Pkgs) perl; + }; inherit fetchurl; }) ["gcc" "binutils"]; @@ -176,10 +190,14 @@ rec { stdenvLinuxBoot3 = stdenvBootFun { gcc = wrapGCC rec { inherit (stdenvLinuxBoot2Pkgs) binutils; + coreutils = bootstrapTools; libc = stdenvLinuxGlibc; gcc = stdenvLinuxBoot2Pkgs.gcc.gcc; name = ""; }; + extraAttrs = { + inherit (stdenvLinuxBoot1Pkgs) perl; + }; inherit fetchurl; }; @@ -210,6 +228,7 @@ rec { gcc = wrapGCC rec { inherit (stdenvLinuxBoot2Pkgs) binutils; + inherit (stdenvLinuxBoot3Pkgs) coreutils; libc = stdenvLinuxGlibc; gcc = stdenvLinuxBoot2Pkgs.gcc.gcc; shell = stdenvLinuxBoot3Pkgs.bash + "/bin/bash"; diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index de8a25c6f64c..3f68738c3108 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -10,20 +10,26 @@ rec { aclSupport = false; }); + gccLinkStatic = wrapGCCWith (import ../../build-support/gcc-wrapper) uclibc + stdenv.gcc.gcc; + stdenvLinkStatic = overrideGCC stdenv gccLinkStatic; - curlDiet = import ../../tools/networking/curl { + curlStatic = import ../../tools/networking/curl { + stdenv = stdenvLinkStatic; inherit fetchurl; - stdenv = useDietLibC stdenv; zlibSupport = false; sslSupport = false; + linkStatic = true; }; - bzip2Diet = import ../../tools/compression/bzip2 { + bzip2Static = import ../../tools/compression/bzip2 { + stdenv = stdenvLinkStatic; inherit fetchurl; - stdenv = useDietLibC stdenv; + linkStatic = true; }; + #gccNoShared = wrapGCC ( gcc.gcc.override { enableShared = false; } ); build = @@ -33,6 +39,7 @@ rec { buildInputs = [nukeReferences cpio]; buildCommand = '' + set -x ensureDir $out/bin $out/lib $out/libexec # Copy what we need of Glibc. @@ -100,6 +107,8 @@ rec { cp -d ${gmp}/lib/libgmp*.so* $out/lib cp -d ${mpfr}/lib/libmpfr*.so* $out/lib + cp -d ${ppl}/lib/libppl*.so* $out/lib + cp -d ${cloogppl}/lib/libcloog*.so* $out/lib # Copy binutils. for i in as ld ar ranlib nm strip readelf objdump; do @@ -132,8 +141,8 @@ rec { cp ${klibc}/lib/klibc/bin.static/cpio $out/in-nixpkgs cp ${klibc}/lib/klibc/bin.static/mkdir $out/in-nixpkgs cp ${klibc}/lib/klibc/bin.static/ln $out/in-nixpkgs - cp ${curlDiet}/bin/curl $out/in-nixpkgs - cp ${bzip2Diet}/bin/bzip2 $out/in-nixpkgs + cp ${curlStatic}/bin/curl $out/in-nixpkgs + cp ${bzip2Static}/bin/bzip2 $out/in-nixpkgs chmod u+w $out/in-nixpkgs/* strip $out/in-nixpkgs/* nuke-refs $out/in-nixpkgs/* diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh new file mode 100644 index 000000000000..3709ac05041b --- /dev/null +++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh @@ -0,0 +1,54 @@ +set -e + +# Unpack the bootstrap tools tarball. +echo Unpacking the bootstrap tools... +$mkdir $out +$bzip2 -d < $tarball | (cd $out && $cpio -V -i) + +# Set the ELF interpreter / RPATH in the bootstrap binaries. +echo Patching the bootstrap tools... + +# On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs. So +# use a copy of patchelf. +LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? $out/bin/cp $out/bin/patchelf . + +for i in $out/bin/* $out/libexec/gcc/*/*/* $out/lib/librt*; do + echo patching $i + if ! test -L $i; then + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i + fi +done +for i in $out/lib/libppl* $out/lib/libgmp*; do + echo patching $i + if ! test -L $i; then + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-rpath $out/lib --force-rpath $i + fi +done + +# Fix the libc linker script. +export PATH=$out/bin +cat $out/lib/libc.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libc.so.tmp +mv $out/lib/libc.so.tmp $out/lib/libc.so +cat $out/lib/libpthread.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libpthread.so.tmp +mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so + +# Provide some additional symlinks. +ln -s bash $out/bin/sh +ln -s bzip2 $out/bin/bunzip2 + +# Mimic the gunzip script as in gzip installations +cat > $out/bin/gunzip < $out/bin/curl +chmod +x $out/bin/curl diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh index c1fa8582ed8a..2399e48b026f 100644 --- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh @@ -10,13 +10,24 @@ echo Patching the bootstrap tools... # On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs. So # use a copy of patchelf. -LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 $out/bin/cp $out/bin/patchelf . +LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? $out/bin/cp $out/bin/patchelf . for i in $out/bin/* $out/libexec/gcc/*/*/*; do echo patching $i if ! test -L $i; then - LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \ - ./patchelf --set-interpreter $out/lib/ld-linux*.so.2 --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i + fi +done +for i in $out/lib/librt* ; do + echo patching $i + if ! test -L $i; then + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i fi done @@ -24,12 +35,20 @@ done export PATH=$out/bin cat $out/lib/libc.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libc.so.tmp mv $out/lib/libc.so.tmp $out/lib/libc.so +cat $out/lib/libpthread.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libpthread.so.tmp +mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so # Provide some additional symlinks. ln -s bash $out/bin/sh - ln -s bzip2 $out/bin/bunzip2 +# Mimic the gunzip script as in gzip installations +cat > $out/bin/gunzip < $out/bin/curl chmod +x $out/bin/curl diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index 1f2117ebba0f..e5b89d3fc9ce 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -23,12 +23,153 @@ rec { stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" ''; + /* FreeBSD needs the following packages installed from the FreeBSD packages + * collection (pkg_add -r ...): + * + * bash + * coreutils + * diffutils + * findutils + * gawk + * gmake + * gsed + * gtar + * gzip + * + * The aliases are derived by using the derivealiases-freebsd.sh script + * + * The following packages seem to be fine in the default install: + * + * gcc (included with FreeBSD) + * binutils (FreeBSD uses GNU binutils) + * bzip2 (included with FreeBSD) + * grep (FreeBSD uses GNU grep) + * patch (included with FreeBSD) + * + * Moreover a symlink to /bin/bash is required and /bin/sh has to be a symlink to /bin/bash + */ + prehookFreeBSD = builtins.toFile "prehook-freebsd.sh" '' source ${prehookBase} - alias make=gmake - alias tar=gtar - alias sed=gsed + alias [='g[' + alias base64='gbase64' + alias basename='gbasename' + alias cat='gcat' + alias chcon='gchcon' + alias chgrp='gchgrp' + alias chmod='gchmod' + alias chown='gchown' + alias chroot='gchroot' + alias cksum='gcksum' + alias comm='gcomm' + alias cp='gcp' + alias csplit='gcsplit' + alias cut='gcut' + alias date='gdate' + alias dd='gdd' + alias df='gdf' + alias dir='gdir' + alias dircolors='gdircolors' + alias dirname='gdirname' + alias du='gdu' + alias echo='gecho' + alias env='genv' + alias expand='gexpand' + alias expr='gexpr' + alias factor='gfactor' + alias false='gfalse' + alias fmt='gfmt' + alias fold='gfold' + alias groups='ggroups' + alias head='ghead' + alias hostid='ghostid' + alias id='gid' + alias install='ginstall' + alias join='gjoin' + alias kill='gkill' + alias link='glink' + alias ln='gln' + alias logname='glogname' + alias ls='gls' + alias md5sum='gmd5sum' + alias mkdir='gmkdir' + alias mkfifo='gmkfifo' + alias mknod='gmknod' + alias mktemp='gmktemp' + alias mv='gmv' + alias nice='gnice' + alias nl='gnl' + alias nohup='gnohup' + alias od='god' + alias paste='gpaste' + alias pathchk='gpathchk' + alias pinky='gpinky' + alias pr='gpr' + alias printenv='gprintenv' + alias printf='gprintf' + alias ptx='gptx' + alias pwd='gpwd' + alias readlink='greadlink' + alias rm='grm' + alias rmdir='grmdir' + alias runcon='gruncon' + alias seq='gseq' + alias sha1sum='gsha1sum' + alias sha224sum='gsha224sum' + alias sha256sum='gsha256sum' + alias sha384sum='gsha384sum' + alias sha512sum='gsha512sum' + alias shred='gshred' + alias shuf='gshuf' + alias sleep='gsleep' + alias sort='gsort' + alias split='gsplit' + alias stat='gstat' + alias stdbuf='gstdbuf' + alias stty='gstty' + alias sum='gsum' + alias sync='gsync' + alias tac='gtac' + alias tail='gtail' + alias tee='gtee' + alias test='gtest' + alias timeout='gtimeout' + alias touch='gtouch' + alias tr='gtr' + alias true='gtrue' + alias truncate='gtruncate' + alias tsort='gtsort' + alias tty='gtty' + alias uname='guname' + alias unexpand='gunexpand' + alias uniq='guniq' + alias unlink='gunlink' + alias uptime='guptime' + alias users='gusers' + alias vdir='gvdir' + alias wc='gwc' + alias who='gwho' + alias whoami='gwhoami' + alias yes='gyes' + + alias cmp='gcmp' + alias diff='gdiff' + alias diff3='gdiff3' + alias sdiff='gsdiff' + + alias find='gfind' + alias oldfind='goldfind' + alias locate='glocate' + alias updatedb='gupdatedb' + alias xargs='gxargs' + + alias make='gmake' + + alias sed='gsed' + + alias tar='gtar' + export MAKE=gmake shopt -s expand_aliases @@ -36,15 +177,77 @@ rec { export NIX_GCC_NEEDS_GREP=1 ''; + /* OpenBSD needs the following packages installed from the OpenBSD packages + * collection (pkg_add -r ...): + * + * bash + * fileutils (there is no coreutils package) + * gdiff + * findutils + * gawk + * ggrep + * gmake + * gsed + * gtar + * + * The aliases are derived by using the derivealiases-openbsd.sh script + * + * The following packages seem to be fine in the default install: + * + * gcc (included with OpenBSD) + * binutils (OpenBSD uses GNU binutils) + * bzip2 (included with openBSD) + * patch (included with OpenBSD) + * gzip (included with OpenBSD + * + * Moreover a symlink to /bin/bash is required and /bin/sh has to be a symlink to /bin/bash + */ + prehookOpenBSD = builtins.toFile "prehook-openbsd.sh" '' source ${prehookBase} - alias make=gmake - alias grep=ggrep - alias mv=gmv - alias ln=gln - alias sed=gsed - alias tar=gtar + alias chgrp='gchgrp' + alias chmod='gchmod' + alias chown='gchown' + alias cp='gcp' + alias dd='gdd' + alias df='gdf' + alias dir='gdir' + alias dircolors='gdircolors' + alias du='gdu' + alias install='ginstall' + alias ln='gln' + alias ls='gls' + alias mkdir='gmkdir' + alias mkfifo='gmkfifo' + alias mknod='gmknod' + alias mv='gmv' + alias rm='grm' + alias rmdir='grmdir' + alias shred='gshred' + alias sync='gsync' + alias touch='gtouch' + alias vdir='gvdir' + + alias find='gfind' + alias locate='glocate' + alias updatedb='gupdatedb' + alias xargs='gxargs' + + alias cmp='gcmp' + alias diff='gdiff' + alias diff3='gdiff3' + alias sdiff='gsdiff' + + alias egrep='gegrep' + alias fgrep='gfgrep' + alias grep='ggrep' + + alias make='gmake' + + alias sed='gsed' + + alias tar='gtar' export MAKE=gmake shopt -s expand_aliases diff --git a/pkgs/stdenv/native/derivealiases-freebsd.sh b/pkgs/stdenv/native/derivealiases-freebsd.sh new file mode 100644 index 000000000000..510abeaee1dd --- /dev/null +++ b/pkgs/stdenv/native/derivealiases-freebsd.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +for i in `cat /var/db/pkg/coreutils-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/diffutils-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/findutils-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/gmake-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/gsed-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/gtar-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo diff --git a/pkgs/stdenv/native/derivealiases-openbsd.sh b/pkgs/stdenv/native/derivealiases-openbsd.sh new file mode 100644 index 000000000000..b6c5bf8f9c46 --- /dev/null +++ b/pkgs/stdenv/native/derivealiases-openbsd.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +for i in `cat /var/db/pkg/fileutils-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/findutils-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/gdiff-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/ggrep-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/gmake-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/gsed-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + +for i in `cat /var/db/pkg/gtar-*/+CONTENTS | grep "bin/g"` +do + name=`basename $i` + echo "alias ${name:1}='g${name:1}'" +done + +echo + diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix index 521f381eed25..5b1b2af8285f 100644 --- a/pkgs/stdenv/nix/default.nix +++ b/pkgs/stdenv/nix/default.nix @@ -17,6 +17,7 @@ import ../generic { else pkgs.binutils; gcc = if stdenv.isDarwin then pkgs.gccApple.gcc else pkgs.gcc.gcc; + coreutils = pkgs.coreutils; shell = pkgs.bash + "/bin/sh"; }; diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix index ddc31de6196b..0523067cbade 100644 --- a/pkgs/tools/compression/bzip2/default.nix +++ b/pkgs/tools/compression/bzip2/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, linkStatic ? false}: stdenv.mkDerivation { name = "bzip2-1.0.5"; @@ -11,7 +11,11 @@ stdenv.mkDerivation { }; sharedLibrary = - !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin"; + !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; + + makeFlags = if linkStatic then "LDFLAGS=-static" else ""; + + inherit linkStatic; meta = { homepage = http://www.bzip.org; diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index 0a2afd053729..7a25b69c013d 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -1,17 +1,35 @@ {stdenv, fetchurl}: -stdenv.mkDerivation { - name = "gzip-1.3.12"; - +stdenv.mkDerivation rec { + name = "gzip-1.3.13"; + src = fetchurl { - url = http://ftp.gnu.org/gnu/gzip/gzip-1.3.12.tar.gz; - sha256 = "1bw7sm68xjlnlzgcx66hnw80ac1qqyvhw0vw27zilgbzbzh5nmiz"; + url = "mirror://gnu/gzip/${name}.tar.gz"; + sha256 = "18vwa7x0b1sql9bs2d15n94fx3him1m6xpnwsfz52djjbjgzy1hx"; }; + patches = [ ./getopt.patch ]; + + doCheck = true; + meta = { - homepage = http://www.gzip.org/; - description = "The gzip compression program"; + homepage = http://www.gnu.org/software/gzip/; + description = "Gzip, the GNU zip compression program"; + + longDescription = + ''gzip (GNU zip) is a popular data compression program written by + Jean-loup Gailly for the GNU project. Mark Adler wrote the + decompression part. + + We developed this program as a replacement for compress because of + the Unisys and IBM patents covering the LZW algorithm used by + compress. These patents made it impossible for us to use compress, + and we needed a replacement. The superior compression ratio of gzip + is just a bonus. + ''; + + license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; - - patches = [./gnulib-futimens.patch]; } diff --git a/pkgs/tools/compression/gzip/getopt.patch b/pkgs/tools/compression/gzip/getopt.patch new file mode 100644 index 000000000000..e61dd9778107 --- /dev/null +++ b/pkgs/tools/compression/gzip/getopt.patch @@ -0,0 +1,54 @@ +See http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00089.html . + +From dd0ebefe4fe761f6f422a400430db53c64dbffd7 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Tue, 6 Oct 2009 20:44:13 -0600 +Subject: [PATCH] getopt: fix compilation on darwin +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* lib/getopt.in.h (includes): Leave breadcrumbs during system +include. +* lib/unistd.in.h (getopt): Use them to avoid recursive include. +Reported by Ludovic Courtès. + +Signed-off-by: Eric Blake +--- + ChangeLog | 5 +++++ + lib/getopt.in.h | 6 +++++- + lib/unistd.in.h | 2 +- + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/lib/getopt.in.h b/lib/getopt.in.h +index 9de467a..7377f3c 100644 +--- a/lib/getopt.in.h ++++ b/lib/getopt.in.h +@@ -22,9 +22,13 @@ + @PRAGMA_SYSTEM_HEADER@ + #endif + +-/* The include_next requires a split double-inclusion guard. */ ++/* The include_next requires a split double-inclusion guard. We must ++ also inform the replacement unistd.h to not recursively use ++ ; our definitions will be present soon enough. */ + #if @HAVE_GETOPT_H@ ++# define _GL_SYSTEM_GETOPT + # @INCLUDE_NEXT@ @NEXT_GETOPT_H@ ++# undef _GL_SYSTEM_GETOPT + #endif + + #ifndef _GL_GETOPT_H +diff --git a/lib/unistd.in.h b/lib/unistd.in.h +index 38e2e13..b6ea889 100644 +--- a/lib/unistd.in.h ++++ b/lib/unistd.in.h +@@ -49,7 +49,7 @@ + #endif + + /* Get getopt(), optarg, optind, opterr, optopt. */ +-#if @GNULIB_UNISTD_H_GETOPT@ ++#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT + # include + #endif + diff --git a/pkgs/tools/compression/gzip/gnulib-futimens.patch b/pkgs/tools/compression/gzip/gnulib-futimens.patch index 5804bf27ff3f..e69de29bb2d1 100644 --- a/pkgs/tools/compression/gzip/gnulib-futimens.patch +++ b/pkgs/tools/compression/gzip/gnulib-futimens.patch @@ -1,42 +0,0 @@ -now hat glibc-2.6 declares futimens. -http://lists.gnu.org/archive/html/bug-gnulib/2007-05/msg00089.html - -diff -ru cpio-2.7.orig/lib/utimens.c cpio-2.7/lib/utimens.c ---- cpio-2.7.orig/lib/utimens.c 2007-05-20 21:23:57.000000000 +0900 -+++ cpio-2.7/lib/utimens.c 2007-05-21 08:40:22.000000000 +0900 -@@ -73,7 +73,7 @@ - Return 0 on success, -1 (setting errno) on failure. */ - - int --futimens (int fd ATTRIBUTE_UNUSED, -+gl_futimens (int fd ATTRIBUTE_UNUSED, - char const *file, struct timespec const timespec[2]) - { - /* There's currently no interface to set file timestamps with -@@ -166,5 +166,5 @@ - int - utimens (char const *file, struct timespec const timespec[2]) - { -- return futimens (-1, file, timespec); -+ return gl_futimens (-1, file, timespec); - } -diff -ru cpio-2.7.orig/lib/utimens.h cpio-2.7/lib/utimens.h ---- cpio-2.7.orig/lib/utimens.h 2007-05-20 21:23:57.000000000 +0900 -+++ cpio-2.7/lib/utimens.h 2007-05-21 08:39:57.000000000 +0900 -@@ -1,3 +1,3 @@ - #include "timespec.h" --int futimens (int, char const *, struct timespec const [2]); -+int gl_futimens (int, char const *, struct timespec const [2]); - int utimens (char const *, struct timespec const [2]); -diff -ur gzip-1.3.12.orig/gzip.c gzip-1.3.12/gzip.c ---- gzip-1.3.12.orig/gzip.c 2007-05-21 09:12:46.000000000 +0900 -+++ gzip-1.3.12/gzip.c 2007-05-21 09:13:14.000000000 +0900 -@@ -1637,7 +1637,7 @@ - } - } - -- if (futimens (ofd, ofname, timespec) != 0) -+ if (gl_futimens (ofd, ofname, timespec) != 0) - { - int e = errno; - WARN ((stderr, "%s: ", program_name)); diff --git a/pkgs/tools/compression/lzma/default.nix b/pkgs/tools/compression/lzma/default.nix deleted file mode 100644 index 13de50fafcf1..000000000000 --- a/pkgs/tools/compression/lzma/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{stdenv, fetchurl}: - -stdenv.mkDerivation { - name = "lzma-4.32.7"; - - src = fetchurl { - url = mirror://gentoo/distfiles/lzma-4.32.7.tar.gz; - sha256 = "0b03bdvm388kwlcz97aflpr3ir1zpa3m0bq3s6cd3pp5a667lcwz"; - }; - - CFLAGS = "-O3"; - CXXFLAGS = "-O3"; - - meta = { - homepage = http://tukaani.org/lzma/; - description = "The LZMA compression program"; - }; -} diff --git a/pkgs/tools/filesystems/jfsrec/default.nix b/pkgs/tools/filesystems/jfsrec/default.nix index a805e86f0dd6..91060795e7cd 100644 --- a/pkgs/tools/filesystems/jfsrec/default.nix +++ b/pkgs/tools/filesystems/jfsrec/default.nix @@ -8,6 +8,7 @@ stdenv.mkDerivation { sha256 = "163z6ljr05vw2k5mj4fim2nlg4khjyibrii95370pvn474mg28vg"; }; + patches = [ ./jfsrec-gcc-4.3.patch ]; buildInputs = [ boost ]; preConfigure = diff --git a/pkgs/tools/filesystems/jfsrec/jfsrec-gcc-4.3.patch b/pkgs/tools/filesystems/jfsrec/jfsrec-gcc-4.3.patch new file mode 100644 index 000000000000..063a7c24813b --- /dev/null +++ b/pkgs/tools/filesystems/jfsrec/jfsrec-gcc-4.3.patch @@ -0,0 +1,24 @@ +Taken from Archlinux, although this solves the build in gcc 4.4, not 4.3. +http://aur.archlinux.org/packages/jfsrec-svn/jfsrec-svn/jfsrec-gcc-4.3.patch +diff -uBdr jfsrec/src/device.cpp jfsrec-build/src/device.cpp +--- jfsrec/src/device.cpp 2009-12-01 18:34:03.860437077 +0100 ++++ jfsrec-build/src/device.cpp 2009-12-01 18:39:48.297067088 +0100 +@@ -20,6 +20,7 @@ + //Parts of the code in this file was originally taken from JFS's xpeek (debugfs_jfs) + + #include "device.h" ++#include + #ifdef __linux__ + #include + #include +diff -uBdr jfsrec/src/unicode_to_utf8.cpp jfsrec-build/src/unicode_to_utf8.cpp +--- jfsrec/src/unicode_to_utf8.cpp 2009-12-01 18:34:03.860437077 +0100 ++++ jfsrec-build/src/unicode_to_utf8.cpp 2009-12-01 18:39:43.501626737 +0100 +@@ -8,6 +8,7 @@ + */ + #include + #include "unicode_to_utf8.h" ++#include + #define JFS_PATH_MAX 4096 + + /* diff --git a/pkgs/tools/misc/coreutils-5/default.nix b/pkgs/tools/misc/coreutils-5/default.nix index fc9ef3b7c427..de1ff1c4a907 100644 --- a/pkgs/tools/misc/coreutils-5/default.nix +++ b/pkgs/tools/misc/coreutils-5/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, perl ? null}: stdenv.mkDerivation { name = "coreutils-5.97"; diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 5cff1d5712ee..d588c49e5c38 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -1,15 +1,21 @@ -{stdenv, fetchurl, aclSupport ? false, acl}: +{stdenv, fetchurl, aclSupport ? false, acl, perl, gmp}: stdenv.mkDerivation rec { - name = "coreutils-7.2"; - + name = "coreutils-8.4"; + src = fetchurl { url = "mirror://gnu/coreutils/${name}.tar.gz"; - sha256 = "1cpx66kwcg5w78by8i27wb24j0flz2ivv9fqmd4av8z5jbnbyxyx"; + sha256 = "0zq11lykc7hfs9nsdnb8gqk354l82hswqj38607mvwj3b0zqvc4b"; }; - buildInputs = stdenv.lib.optional aclSupport acl; - + buildInputs = [ perl gmp ] ++ stdenv.lib.optional aclSupport acl; + + # The tests are known broken on Cygwin + # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025), + # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351), + # and {Open,Free}BSD. + doCheck = (stdenv ? glibc); + meta = { homepage = http://www.gnu.org/software/coreutils/; description = "The basic file, shell and text manipulation utilities of the GNU operating system"; @@ -22,5 +28,7 @@ stdenv.mkDerivation rec { ''; license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index a29b8de1987d..1cd9b43309f5 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -1,14 +1,14 @@ -{stdenv, fetchurl, zlibSupport ? false, zlib ? null, sslSupport ? false, openssl ? null}: +{stdenv, fetchurl, zlibSupport ? false, zlib ? null, sslSupport ? false, openssl ? null, linkStatic ? false}: assert zlibSupport -> zlib != null; assert sslSupport -> openssl != null; stdenv.mkDerivation rec { - name = "curl-7.19.4"; + name = "curl-7.19.7"; src = fetchurl { url = "http://curl.haxx.se/download/${name}.tar.bz2"; - sha256 = "11myjjvx1bjl709bgibv8pb1sjf4cicim16k860qzg7d1ll3cd7v"; + sha256 = "0w2aqlms289jzpkymg14k00iay2pq9al3rlc43b3n7j0wd5gj58s"; }; # Zlib and OpenSSL must be propagated because `libcurl.la' contains @@ -20,12 +20,20 @@ stdenv.mkDerivation rec { configureFlags = '' ${if sslSupport then "--with-ssl=${openssl}" else "--without-ssl"} + ${if linkStatic then "--enable-static --disable-shared" else ""} ''; + + dontDisableStatic = if linkStatic then true else false; CFLAGS = if stdenv ? isDietLibC then "-DHAVE_INET_NTOA_R_2_ARGS=1" else ""; + LDFLAGS = if linkStatic then "-static" else ""; CXX = "g++"; CXXCPP = "g++ -E"; + # libtool hack to get a static binary. Notice that to 'configure' I passed + # other LDFLAGS, because it doesn't use libtool for linking in the tests. + makeFlags = if linkStatic then "LDFLAGS=-all-static" else ""; + passthru = { inherit sslSupport openssl; }; diff --git a/pkgs/tools/networking/dhcp/default.nix b/pkgs/tools/networking/dhcp/default.nix index de6e08df7b67..14dccbe68966 100644 --- a/pkgs/tools/networking/dhcp/default.nix +++ b/pkgs/tools/networking/dhcp/default.nix @@ -20,6 +20,10 @@ stdenv.mkDerivation rec { # http://www.mail-archive.com/blfs-book@linuxfromscratch.org/msg13013.html NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; + # It would automatically add -Werror, which disables build in gcc 4.4 + # due to an uninitialized variable. + CFLAGS = "-g -O2 -Wall"; + buildInputs = [makeWrapper]; postInstall = diff --git a/pkgs/tools/networking/wget/default.nix b/pkgs/tools/networking/wget/default.nix index a4618a53452d..1e3171da00b0 100644 --- a/pkgs/tools/networking/wget/default.nix +++ b/pkgs/tools/networking/wget/default.nix @@ -1,17 +1,46 @@ -{stdenv, fetchurl, gettext, openssl ? null}: +{ stdenv, fetchurl, gettext, perl, gnutls ? null }: stdenv.mkDerivation rec { - name = "wget-1.11.4"; - + name = "wget-1.12"; + src = fetchurl { url = "mirror://gnu/wget/${name}.tar.bz2"; - sha256 = "1yr7w182n7lvkajvq07wnw65sw2vmxjkc3611kpc728vhvi54zwb"; + sha256 = "16msgly5xn0qj6ngsw34q9j7ag8jkci6020w21d30jgqw8wdj8y8"; }; - buildInputs = [gettext openssl]; + patches = [ ./gnutls-support.patch ]; + + preConfigure = + '' for i in "doc/texi2pod.pl" "tests/run-px" "util/rmold.pl" + do + sed -i "$i" -e 's|/usr/bin.*perl|${perl}/bin/perl|g' + done + ''; + + buildInputs = [ gettext perl ] + ++ stdenv.lib.optional (gnutls != null) gnutls; + + configureFlags = + if gnutls != null + then "--with-ssl=gnutls" + else ""; + + doCheck = true; meta = { - description = "A console downloading program. Has some features for mirroring sites."; - homepage = http://www.gnu.org/software/wget; + description = "GNU Wget, a tool for retrieving files using HTTP, HTTPS, and FTP"; + + longDescription = + '' GNU Wget is a free software package for retrieving files using HTTP, + HTTPS and FTP, the most widely-used Internet protocols. It is a + non-interactive commandline tool, so it may easily be called from + scripts, cron jobs, terminals without X-Windows support, etc. + ''; + + license = "GPLv3+"; + + homepage = http://www.gnu.org/software/wget/; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/tools/networking/wget/gnutls-support.patch b/pkgs/tools/networking/wget/gnutls-support.patch new file mode 100644 index 000000000000..fa0c5cc06c0f --- /dev/null +++ b/pkgs/tools/networking/wget/gnutls-support.patch @@ -0,0 +1,16 @@ +This patch fixes GnuTLS support: + + http.o: In function `gethttp': + http.c:(.text+0x26c6): undefined reference to `ssl_connect_wget' + +--- wget-1.12/src/http.c 2009-09-22 05:02:18.000000000 +0200 ++++ wget-1.12/src/http.c 2009-10-03 17:24:46.000000000 +0200 +@@ -1762,7 +1762,7 @@ gethttp (struct url *u, struct http_stat + + if (conn->scheme == SCHEME_HTTPS) + { +- if (!ssl_connect_wget (sock)) ++ if (!ssl_connect (sock)) + { + fd_close (sock); + return CONSSLERR; diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index 10dd08214aff..839364ddb5bb 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -1,15 +1,40 @@ {stdenv, fetchurl}: -stdenv.mkDerivation { - name = "gawk-3.1.6"; - +stdenv.mkDerivation rec { + name = "gawk-3.1.7"; + src = fetchurl { - url = mirror://gnu/gawk/gawk-3.1.6.tar.bz2; - sha256 = "0v6ba4hxfiiy3bny5japd3zmzxlh8vdkmswk96yngd6i1dddsgsi"; + url = "mirror://gnu/gawk/${name}.tar.bz2"; + sha256 = "0wfyiqc28cxb5wjbdph4y33h1fdf56nj6cm7as546niwjsw7cazi"; }; + doCheck = true; + + # The libsigsegv provided with gawk has failing tests: + # I did like in Fedora: + # http://rpmfind.net//linux/RPM/fedora/devel/i386/gawk-3.1.7-2.fc13.i686.html + configureFlags = "--disable-libsigsegv"; + meta = { homepage = http://www.gnu.org/software/gawk/; - description = "GNU implementation of the AWK programming language"; + description = "GNU implementation of the Awk programming language"; + + longDescription = '' + Many computer users need to manipulate text files: extract and then + operate on data from parts of certain lines while discarding the rest, + make changes in various text files wherever certain patterns appear, + and so on. To write a program to do these things in a language such as + C or Pascal is a time-consuming inconvenience that may take many lines + of code. The job is easy with awk, especially the GNU implementation: + Gawk. + + The awk utility interprets a special-purpose programming language that + makes it possible to handle many data-reformatting jobs with just a few + lines of code. + ''; + + license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix index 26e0b906e523..cd2a67f69933 100644 --- a/pkgs/tools/text/gnupatch/default.nix +++ b/pkgs/tools/text/gnupatch/default.nix @@ -1,15 +1,38 @@ -{stdenv, fetchurl}: +{ stdenv, fetchurl, ed }: -stdenv.mkDerivation ( { - name = "gnupatch-2.5.4"; - src = fetchurl { - url = mirror://gnu/patch/patch-2.5.4.tar.gz; - md5 = "ee5ae84d115f051d87fcaaef3b4ae782"; +stdenv.mkDerivation rec { + name = "patch-2.6.1"; + + src = + if !(stdenv ? glibc) + then fetchurl { + # Temporary fix for + # http://lists.gnu.org/archive/html/bug-patch/2010-01/msg00004.html . + url = "ftp://alpha.gnu.org/gnu/patch/patch-2.6.1-2-g2c4e3ec.tar.gz"; + sha256 = "1rspyzrik5cnav3m2fxr8146bsq4mc0yw4x0r8nkl2x7i052yr2c"; + } else fetchurl { + url = "mirror://gnu/patch/${name}.tar.gz"; + sha256 = "1fc1jyq80nswkf492fiqdbl2bhvlw2wb44ghqlfd3zngx4qkfmni"; + }; + + buildInputs = (stdenv.lib.optional doCheck ed); + + doCheck = true; + + meta = { + description = "GNU Patch, a program to apply differences to files"; + + longDescription = + '' GNU Patch takes a patch file containing a difference listing + produced by the diff program and applies those differences to one or + more original files, producing patched versions. + ''; + + homepage = http://savannah.gnu.org/projects/patch; + + license = "GPLv3+"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; + platforms = stdenv.lib.platforms.all; }; - - # Hack around ancient configure script: doesn't build on many newer - # platforms unless a platform is specified. - configureFlags = "dummy"; - - patches = if stdenv.isDarwin then [./setmode.patch] else []; -} // (if stdenv.isDarwin then { ac_cv_exeext = "" ; } else {} ) ) +} diff --git a/pkgs/tools/text/gnupatch/setmode.patch b/pkgs/tools/text/gnupatch/setmode.patch deleted file mode 100644 index 83b7022e18db..000000000000 --- a/pkgs/tools/text/gnupatch/setmode.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -rc patch-2.5.4-orig/pch.c patch-2.5.4/pch.c -*** patch-2.5.4-orig/pch.c Mon Aug 30 08:20:08 1999 ---- patch-2.5.4/pch.c Fri Jul 14 13:11:26 2006 -*************** -*** 105,111 **** - if (!filename || !*filename || strEQ (filename, "-")) - { - file_offset stdin_pos; -! #if HAVE_SETMODE - if (binary_transput) - { - if (isatty (STDIN_FILENO)) ---- 105,111 ---- - if (!filename || !*filename || strEQ (filename, "-")) - { - file_offset stdin_pos; -! #if 0 && HAVE_SETMODE - if (binary_transput) - { - if (isatty (STDIN_FILENO)) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ef20e3cc5605..6bc28c32263e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33,6 +33,8 @@ # argument. Otherwise, it's read from $NIXPKGS_CONFIG or # ~/.nixpkgs/config.nix. config ? null + +, crossSystem ? null }: @@ -142,7 +144,8 @@ let # inside the set for derivations. recurseIntoAttrs = attrs: attrs // {recurseForDerivations = true;}; - useFromStdenv = it : alternative : if (builtins.hasAttr it stdenv) then + useFromStdenv = it : alternative : if ((bootStdenv != null || + crossSystem == null) && builtins.hasAttr it stdenv) then (builtins.getAttr it stdenv) else alternative; # Return the first available value in the order: pkg.val, val, or default. @@ -179,15 +182,20 @@ let defaultStdenv = allStdenvs.stdenv; + stdenvCross = makeStdenvCross defaultStdenv crossSystem (binutilsCross crossSystem) + (gccCrossStageFinal crossSystem); + stdenv = if bootStdenv != null then bootStdenv else let changer = getConfig ["replaceStdenv"] null; in if changer != null then changer { - stdenv = defaultStdenv; + stdenv = stdenvCross; overrideSetup = overrideSetup; } - else defaultStdenv; + else stdenvCross; + + forceBuildDrv = drv : drv // { hostDrv = drv.buildDrv; }; # A stdenv capable of building 32-bit binaries. On x86_64-linux, # it uses GCC compiled with multilib support; on i686-linux, it's @@ -198,7 +206,6 @@ let else stdenv; - ### BUILD SUPPORT attrSetToDir = arg : import ../build-support/upstream-updater/attrset-to-dir.nix { @@ -259,7 +266,8 @@ let # from being built. fetchurl = useFromStdenv "fetchurl" (import ../build-support/fetchurl { - inherit curl stdenv; + curl = curl; + stdenv = stdenv; }); # fetchurlBoot is used for curl and its dependencies in order to @@ -279,7 +287,7 @@ let }; makeInitrd = {contents}: import ../build-support/kernel/make-initrd.nix { - inherit stdenv perl cpio contents; + inherit stdenv perl cpio contents platform; }; makeWrapper = makeSetupHook ../build-support/make-wrapper/make-wrapper.sh; @@ -314,6 +322,11 @@ let inherit pkgs lib; }; + platforms = import ./platforms.nix { + inherit system pkgs; + }; + + platform = platforms.pc; ### TOOLS @@ -499,14 +512,15 @@ let inherit fetchurl stdenv ppl; }; - coreutils = useFromStdenv "coreutils" - (makeOverridable (if stdenv ? isDietLibC + coreutils_real = makeOverridable (if stdenv ? isDietLibC then import ../tools/misc/coreutils-5 else import ../tools/misc/coreutils) { - inherit fetchurl stdenv acl; + inherit fetchurl stdenv acl perl gmp; aclSupport = stdenv.isLinux; - }); + }; + + coreutils = useFromStdenv "coreutils" coreutils_real; cpio = import ../tools/archivers/cpio { inherit fetchurl stdenv; @@ -520,7 +534,7 @@ let inherit fetchurl stdenv; }; - curl = import ../tools/networking/curl { + curl = makeOverridable (import ../tools/networking/curl) { fetchurl = fetchurlBoot; inherit stdenv zlib openssl; zlibSupport = ! ((stdenv ? isDietLibC) || (stdenv ? isStatic)); @@ -763,7 +777,7 @@ let }); gnupatch = useFromStdenv "patch" (import ../tools/text/gnupatch { - inherit fetchurl stdenv; + inherit fetchurl stdenv ed; }); gnupg = import ../tools/security/gnupg { @@ -988,9 +1002,7 @@ let readline nettools lsof procps; }; - lzma = import ../tools/compression/lzma { - inherit fetchurl stdenv; - }; + lzma = xz; xz = import ../tools/compression/xz { inherit fetchurl stdenv lib; @@ -1563,7 +1575,7 @@ let tcng = import ../tools/networking/tcng { inherit fetchurl stdenv iproute bison flex db4 perl; - kernel = kernel_2_6_28; + kernel = linux_2_6_28; }; telnet = import ../tools/networking/telnet { @@ -1702,7 +1714,7 @@ let }; wget = import ../tools/networking/wget { - inherit fetchurl stdenv gettext openssl; + inherit fetchurl stdenv gettext gnutls perl; }; which = import ../tools/system/which { @@ -1846,7 +1858,7 @@ let inherit fetchurl stdenv gawk system; }; - gcc = gcc43; + gcc = gcc44; gcc295 = wrapGCC (import ../development/compilers/gcc-2.95 { inherit fetchurl stdenv noSysDirs; @@ -1882,23 +1894,58 @@ let profiledCompiler = false; }); - gcc43 = useFromStdenv "gcc" gcc43_real; + gcc44 = useFromStdenv "gcc" gcc44_real; - gcc43_wrapper2 = wrapGCC2 gcc43.gcc; - - gcc43_real = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.3) { - inherit fetchurl stdenv texinfo gmp mpfr noSysDirs; + gcc43 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.3) { + inherit stdenv fetchurl texinfo gmp mpfr noSysDirs; profiledCompiler = true; })); - gcc43_multi = lowPrio (wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi (gcc43_real.gcc.override { + gcc43_realCross = cross : makeOverridable (import ../development/compilers/gcc-4.3) { + inherit stdenv fetchurl texinfo gmp mpfr noSysDirs cross; + binutilsCross = binutilsCross cross; + libcCross = libcCross cross; + profiledCompiler = false; + enableMultilib = true; + crossStageStatic = false; + }; + + gcc44_realCross = cross : makeOverridable (import ../development/compilers/gcc-4.4) { + inherit stdenv fetchurl texinfo gmp mpfr ppl cloogppl noSysDirs cross + gettext which; + binutilsCross = binutilsCross cross; + libcCross = libcCross cross; + profiledCompiler = false; + enableMultilib = true; + crossStageStatic = false; + }; + + gccCrossStageStatic = cross: wrapGCCCross { + gcc = forceBuildDrv ((gcc44_realCross cross).override { + crossStageStatic = true; + langCC = false; + libcCross = null; + }); + libc = null; + binutils = binutilsCross cross; + inherit cross; + }; + + gccCrossStageFinal = cross: wrapGCCCross { + gcc = forceBuildDrv (gcc44_realCross cross); + libc = libcCross cross; + binutils = binutilsCross cross; + inherit cross; + }; + + gcc43_multi = lowPrio (wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi (gcc43.gcc.override { stdenv = overrideGCC stdenv (wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi gcc); profiledCompiler = false; enableMultilib = true; })); - gcc44 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.4) { - inherit fetchurl stdenv texinfo gmp mpfr ppl cloogppl + gcc44_real = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc-4.4) { + inherit fetchurl stdenv texinfo gmp mpfr /* ppl cloogppl */ gettext which noSysDirs; profiledCompiler = true; })); @@ -1917,7 +1964,6 @@ let gfortran = gfortran43; gfortran40 = wrapGCC (gcc40.gcc.override { - name = "gfortran"; langFortran = true; langCC = false; inherit gmp mpfr; @@ -1939,7 +1985,7 @@ let inherit gmp mpfr; }); - gfortran43 = wrapGCC (gcc43_real.gcc.override { + gfortran43 = wrapGCC (gcc43.gcc.override { name = "gfortran"; langFortran = true; langCC = false; @@ -1971,6 +2017,47 @@ let libXrandr xproto renderproto xextproto inputproto randrproto; }); + gnat = gnat44; + + gnat44 = wrapGCC (gcc44_real.gcc.override { + name = "gnat"; + langCC = false; + langC = true; + langAda = true; + profiledCompiler = false; + inherit gnatboot; + # We can't use the ppl stuff, because we would have + # libstdc++ problems. + cloogppl = null; + ppl = null; + }); + + gnatboot = wrapGCC (import ../development/compilers/gnatboot { + inherit fetchurl stdenv; + }); + + ghdl = wrapGCC (import ../development/compilers/gcc-4.3 { + inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gnat; + name = "ghdl"; + langVhdl = true; + langCC = false; + langC = false; + profiledCompiler = false; + enableMultilib = false; + }); + + # Not officially supported version for ghdl + ghdl_gcc44 = lowPrio (wrapGCC (import ../development/compilers/gcc-4.4 { + inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gnat gettext which + ppl cloogppl; + name = "ghdl"; + langVhdl = true; + langCC = false; + langC = false; + profiledCompiler = false; + enableMultilib = false; + })); + /* Broken; fails because of unability to find its own symbols during linking @@ -2211,7 +2298,7 @@ let ocaml = ocaml_3_11_1; ocaml_3_08_0 = import ../development/compilers/ocaml/3.08.0.nix { - inherit fetchurl stdenv x11 ncurses; + inherit fetchurl stdenv fetchcvs x11 ncurses; }; ocaml_3_09_1 = import ../development/compilers/ocaml/3.09.1.nix { @@ -2307,11 +2394,20 @@ let nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else ""; gcc = baseGCC; libc = glibc; - inherit stdenv binutils; + inherit stdenv binutils coreutils zlib; }; wrapGCC = wrapGCCWith (import ../build-support/gcc-wrapper) glibc; - wrapGCC2 = wrapGCCWith (import ../build-support/gcc-wrapper2) glibc; + + wrapGCCCross = + {gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}: + + forceBuildDrv (import ../build-support/gcc-cross-wrapper { + nativeTools = false; + nativeLibc = false; + noLibc = (libc == null); + inherit stdenv gcc binutils libc shell name cross; + }); # FIXME: This is a specific hack for GCC-UPC. Eventually, we may # want to merge `gcc-upc-wrapper' and `gcc-wrapper'. @@ -2407,17 +2503,17 @@ let }; perl58 = import ../development/interpreters/perl-5.8 { - inherit fetchurl stdenv; - impureLibcPath = if stdenv.isLinux then null else "/usr"; - }; - - perl510 = import ../development/interpreters/perl-5.10 { - inherit stdenv; - fetchurl = fetchurlBoot; + inherit fetchurl stdenv; impureLibcPath = if stdenv.isLinux then null else "/usr"; }; - perl = if system != "i686-cygwin" then perl510 else sysPerl; + perl510 = makeOverridable (import ../development/interpreters/perl-5.10) { + inherit stdenv; + fetchurl = fetchurlBoot; + }; + + perl = useFromStdenv "perl" + (if system != "i686-cygwin" then perl510 else sysPerl); # FIXME: unixODBC needs patching on Darwin (see darwinports) phpOld = import ../development/interpreters/php { @@ -2456,8 +2552,8 @@ let python = if getConfig ["python" "full"] false then pythonFull else pythonBase; python25 = if getConfig ["python" "full"] false then python25Full else python25Base; python26 = if getConfig ["python" "full"] false then python26Full else python26Base; - pythonBase = python25Base; - pythonFull = python25Full; + pythonBase = if stdenv.isDarwin then python25Base else python26Base; + pythonFull = if stdenv.isDarwin then python25Full else python26Full; python24 = import ../development/interpreters/python/2.4 { inherit fetchurl stdenv zlib bzip2; @@ -2703,6 +2799,11 @@ let inherit fetchurl stdenv noSysDirs; }); + binutilsCross = cross : forceBuildDrv (import ../development/tools/misc/binutils { + inherit stdenv fetchurl cross; + noSysDirs = true; + }); + bison = bison23; bison1875 = import ../development/tools/parsing/bison/bison-1.875.nix { @@ -2853,7 +2954,7 @@ let inherit fetchurl stdenv; }; - gnum4 = import ../development/tools/misc/gnum4 { + gnum4 = makeOverridable (import ../development/tools/misc/gnum4) { inherit fetchurl stdenv; }; @@ -2955,10 +3056,6 @@ let inherit fetchurl stdenv; }); - patchelf05 = import ../development/tools/misc/patchelf/0.5.nix { - inherit fetchurl stdenv; - }; - pmccabe = import ../development/tools/misc/pmccabe { inherit fetchurl stdenv; }; @@ -2967,11 +3064,19 @@ let * pkgconfig is optionally taken from the stdenv to allow bootstrapping * of glib and pkgconfig itself on MinGW. */ - pkgconfig = useFromStdenv "pkgconfig" + pkgconfigReal = useFromStdenv "pkgconfig" (import ../development/tools/misc/pkgconfig { inherit fetchurl stdenv; }); + /* Make pkgconfig always return a buildDrv, never a proper hostDrv, + because most usage of pkgconfig as buildInput (inheritance of + pre-cross nixpkgs) means using it using as buildNativeInput + cross_renaming: we should make all programs use pkgconfig as + buildNativeInput after the renaming. + */ + pkgconfig = forceBuildDrv pkgconfigReal; + radare = import ../development/tools/analysis/radare { inherit stdenv fetchurl pkgconfig libusb readline gtkdialog python ruby libewf perl; @@ -3036,7 +3141,7 @@ let inherit fetchurl stdenv ncurses; }; - texinfo = import ../development/tools/misc/texinfo { + texinfo = makeOverridable (import ../development/tools/misc/texinfo) { inherit fetchurl stdenv ncurses lzma; }; @@ -3053,8 +3158,14 @@ let readline = readline5; }; + gdbCross = import ../development/tools/misc/gdb { + inherit fetchurl stdenv ncurses gmp mpfr expat texinfo; + readline = readline5; + target = crossSystem; + }; + valgrind = import ../development/tools/analysis/valgrind { - inherit fetchurl stdenv perl gdb; + inherit fetchurl stdenv perl gdb autoconf automake; }; xxdiff = builderDefsPackage (import ../development/tools/misc/xxdiff/3.2.nix) { @@ -3291,7 +3402,7 @@ let }; cyrus_sasl = import ../development/libraries/cyrus-sasl { - inherit fetchurl stdenv openssl db4 gettext; + inherit stdenv fetchurl openssl db4 gettext; }; db4 = db45; @@ -3312,6 +3423,7 @@ let dbus_glib = makeOverridable (import ../development/libraries/dbus-glib) { inherit fetchurl stdenv pkgconfig gettext dbus expat glib; + libiconv = if (stdenv.system == "i686-freebsd") then libiconv else null; }; dbus_java = import ../development/libraries/java/dbus-java { @@ -3522,28 +3634,75 @@ let let haveRedHatKernel = system == "i686-linux" || system == "x86_64-linux"; haveBrokenRedHatKernel = haveRedHatKernel && getConfig ["brokenRedHatKernel"] false; in - useFromStdenv "glibc" (if haveBrokenRedHatKernel then glibc25 else glibc29); + useFromStdenv "glibc" (if haveBrokenRedHatKernel then glibc25 else + glibc211); glibc25 = import ../development/libraries/glibc-2.5 { - inherit fetchurl stdenv kernelHeaders; + inherit fetchurl stdenv; + kernelHeaders = linuxHeaders; installLocales = getPkgConfig "glibc" "locales" false; }; glibc27 = import ../development/libraries/glibc-2.7 { - inherit fetchurl stdenv kernelHeaders; + inherit fetchurl stdenv; + kernelHeaders = linuxHeaders; #installLocales = false; }; - glibc29 = import ../development/libraries/glibc-2.9 { - inherit fetchurl stdenv kernelHeaders; + glibc29 = makeOverridable (import ../development/libraries/glibc-2.9) { + inherit fetchurl stdenv; + kernelHeaders = linuxHeaders; installLocales = getPkgConfig "glibc" "locales" false; }; - glibcLocales = makeOverridable (import ../development/libraries/glibc-2.9/locales.nix) { + glibc29Cross = cross: forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.9) { + inherit stdenv fetchurl; + gccCross = gccCrossStageStatic cross; + kernelHeaders = linuxHeadersCross cross; + installLocales = getPkgConfig "glibc" "locales" false; + }); + + glibc210 = makeOverridable (import ../development/libraries/glibc-2.10) { + inherit fetchurl stdenv; + kernelHeaders = linuxHeaders; + installLocales = getPkgConfig "glibc" "locales" false; + }; + + glibc210Cross = cross: forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.10) { + inherit stdenv fetchurl; + gccCross = gccCrossStageStatic cross; + kernelHeaders = linuxHeadersCross cross; + installLocales = getPkgConfig "glibc" "locales" false; + }); + + glibc211 = makeOverridable (import ../development/libraries/glibc-2.11) { + inherit fetchurl stdenv; + kernelHeaders = linuxHeaders; + installLocales = getPkgConfig "glibc" "locales" false; + }; + + glibc211Cross = cross : forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.11) { + inherit stdenv fetchurl; + gccCross = gccCrossStageStatic cross; + kernelHeaders = linuxHeadersCross cross; + installLocales = getPkgConfig "glibc" "locales" false; + }); + + # We can choose: + libcCross = cross: glibc211Cross cross; + # libcCross = cross: uclibcCross cross; + + eglibc = import ../development/libraries/eglibc { + inherit fetchsvn stdenv; + kernelHeaders = linuxHeaders; + installLocales = getPkgConfig "glibc" "locales" false; + }; + + glibcLocales = makeOverridable (import ../development/libraries/glibc-2.11/locales.nix) { inherit fetchurl stdenv; }; - glibcInfo = import ../development/libraries/glibc-2.9/info.nix { + glibcInfo = import ../development/libraries/glibc-2.11/info.nix { inherit fetchurl stdenv texinfo perl; }; @@ -3577,15 +3736,12 @@ let inherit fetchurl stdenv; }; - gmp = import ../development/libraries/gmp { - inherit fetchurl stdenv m4; + gmp = makeOverridable (import ../development/libraries/gmp) { + inherit stdenv fetchurl m4; cxx = false; }; - gmpxx = import ../development/libraries/gmp { - inherit fetchurl stdenv m4; - cxx = true; - }; + gmpxx = gmp.override { cxx = true; }; goffice = import ../development/libraries/goffice { inherit fetchurl stdenv pkgconfig libgsf libxml2 cairo @@ -3602,7 +3758,7 @@ let #GMP ex-satellite, so better keep it near gmp mpfr = import ../development/libraries/mpfr { - inherit fetchurl stdenv gmp; + inherit stdenv fetchurl gmp; }; gst_all = recurseIntoAttrs (import ../development/libraries/gstreamer { @@ -3698,6 +3854,7 @@ let glib = import ../development/libraries/glib/2.22.x.nix { inherit fetchurl stdenv pkgconfig gettext perl; + libiconv = if (stdenv.system == "i686-freebsd") then libiconv else null; }; glibmm = import ../development/libraries/glibmm/2.22.x.nix { @@ -4066,7 +4223,6 @@ let libjpeg = makeOverridable (import ../development/libraries/libjpeg) { inherit fetchurl stdenv; - libtool = libtool_1_5; }; libjpeg62 = makeOverridable (import ../development/libraries/libjpeg/62.nix) { @@ -4075,7 +4231,7 @@ let }; libjpegStatic = lowPrio (appendToName "static" (libjpeg.override { - static = true; + stdenv = enableStaticLibraries stdenv; })); libksba = import ../development/libraries/libksba { @@ -4367,9 +4523,11 @@ let inherit fetchurl stdenv; }; - ncurses = composedArgsAndFun (import ../development/libraries/ncurses) { + ncurses = makeOverridable (composedArgsAndFun (import ../development/libraries/ncurses)) { inherit fetchurl stdenv; - unicode = (system != "i686-cygwin"); + # The "! (stdenv ? cross)" is for the cross-built arm ncurses, which + # don't build for me in unicode. + unicode = (system != "i686-cygwin" && crossSystem == null); }; neon = neon026; @@ -4406,8 +4564,7 @@ let }; openal = import ../development/libraries/openal { - inherit fetchurl cmake alsaLib; - stdenv = overrideGCC stdenv gcc43_wrapper2; + inherit fetchurl stdenv cmake alsaLib; }; # added because I hope that it has been easier to compile on x86 (for blender) @@ -4427,6 +4584,13 @@ let inherit fetchurl stdenv libtool pcsclite libusb pkgconfig; }; + opencv = import ../development/libraries/opencv { + inherit fetchurl stdenv cmake libjpeg libpng libtiff jasper ffmpeg + pkgconfig xineLib; + inherit (gtkLibs) gtk glib; + inherit (gst_all) gstreamer; + }; + # this ctl version is needed by openexr_viewers openexr_ctl = import ../development/libraries/openexr_ctl { inherit fetchurl stdenv ilmbase ctl; @@ -4463,7 +4627,7 @@ let opensc = opensc_0_11_7; }; - openssl = import ../development/libraries/openssl { + openssl = makeOverridable (import ../development/libraries/openssl) { fetchurl = fetchurlBoot; inherit stdenv perl; }; @@ -4834,7 +4998,7 @@ let inherit ncurses flex bison autoconf automake m4 coreutils; }; - zlib = import ../development/libraries/zlib { + zlib = makeOverridable (import ../development/libraries/zlib) { fetchurl = fetchurlBoot; inherit stdenv; }; @@ -5392,7 +5556,7 @@ let }; autofs5 = import ../os-specific/linux/autofs/autofs-v5.nix { - inherit sourceFromHead fetchurl stdenv flex bison kernelHeaders; + inherit sourceFromHead fetchurl stdenv flex bison linuxHeaders; }; _915resolution = import ../os-specific/linux/915resolution { @@ -5442,7 +5606,7 @@ let import ../os-specific/linux/cpufrequtils { inherit fetchurl stdenv libtool gettext; glibc = stdenv.gcc.libc; - kernelHeaders = stdenv.gcc.libc.kernelHeaders; + linuxHeaders = stdenv.gcc.libc.kernelHeaders; }); cryopid = import ../os-specific/linux/cryopid { @@ -5564,7 +5728,7 @@ let import ../os-specific/linux/iputils { inherit fetchurl stdenv; glibc = stdenv.gcc.libc; - kernelHeaders = stdenv.gcc.libc.kernelHeaders; + linuxHeaders = stdenv.gcc.libc.kernelHeaders; }); iptables = import ../os-specific/linux/iptables { @@ -5599,27 +5763,35 @@ let inherit fetchurl stdenv bison flex autoconf automake; }; - kernelHeaders = kernelHeaders_2_6_28; + linuxHeaders = linuxHeaders_2_6_28; - kernelHeaders_2_6_18 = import ../os-specific/linux/kernel-headers/2.6.18.5.nix { + linuxHeadersCross = cross : forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.28.nix { + inherit stdenv fetchurl cross perl; + }); + + linuxHeaders_2_6_18 = import ../os-specific/linux/kernel-headers/2.6.18.5.nix { inherit fetchurl stdenv unifdef; }; - kernelHeaders_2_6_28 = import ../os-specific/linux/kernel-headers/2.6.28.nix { + linuxHeaders_2_6_28 = import ../os-specific/linux/kernel-headers/2.6.28.nix { inherit fetchurl stdenv perl; }; - kernelHeadersArm = import ../os-specific/linux/kernel-headers-cross { + linuxHeaders_2_6_32 = import ../os-specific/linux/kernel-headers/2.6.32.nix { + inherit fetchurl stdenv perl; + }; + + linuxHeadersArm = import ../os-specific/linux/kernel-headers-cross { inherit fetchurl stdenv; cross = "arm-linux"; }; - kernelHeadersMips = import ../os-specific/linux/kernel-headers-cross { + linuxHeadersMips = import ../os-specific/linux/kernel-headers-cross { inherit fetchurl stdenv; cross = "mips-linux"; }; - kernelHeadersSparc = import ../os-specific/linux/kernel-headers-cross { + linuxHeadersSparc = import ../os-specific/linux/kernel-headers-cross { inherit fetchurl stdenv; cross = "sparc-linux"; }; @@ -5628,7 +5800,7 @@ let inherit fetchurl; }; - kernel_2_6_25 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.25.nix) { + linux_2_6_25 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.25.nix) { inherit fetchurl stdenv perl mktemp module_init_tools; kernelPatches = [ kernelPatches.fbcondecor_2_6_25 @@ -5636,7 +5808,7 @@ let ]; }; - kernel_2_6_27 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.27.nix) { + linux_2_6_27 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.27.nix) { inherit fetchurl stdenv perl mktemp module_init_tools; kernelPatches = [ kernelPatches.fbcondecor_2_6_27 @@ -5644,7 +5816,7 @@ let ]; }; - kernel_2_6_28 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.28.nix) { + linux_2_6_28 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.28.nix) { inherit fetchurl stdenv perl mktemp module_init_tools; kernelPatches = [ kernelPatches.fbcondecor_2_6_28 @@ -5653,7 +5825,7 @@ let ]; }; - kernel_2_6_29 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.29.nix) { + linux_2_6_29 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.29.nix) { inherit fetchurl stdenv perl mktemp module_init_tools; kernelPatches = [ kernelPatches.fbcondecor_2_6_29 @@ -5661,42 +5833,43 @@ let ]; }; - kernel_2_6_31 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.31.nix) { - inherit fetchurl stdenv perl mktemp module_init_tools; + linux_2_6_31 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.31.nix) { + inherit fetchurl stdenv perl mktemp module_init_tools platform; kernelPatches = []; }; - kernel_2_6_32 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.32.nix) { + linux_2_6_32 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.32.nix) { inherit fetchurl stdenv perl mktemp module_init_tools; kernelPatches = [ kernelPatches.fbcondecor_2_6_31 kernelPatches.sec_perm_2_6_24 ]; + inherit platform; }; - kernel_2_6_32_zen4 = makeOverridable (import ../os-specific/linux/zen-kernel/2.6.32-zen4.nix) { + linux_2_6_32_zen4 = makeOverridable (import ../os-specific/linux/zen-kernel/2.6.32-zen4.nix) { inherit fetchurl stdenv perl mktemp module_init_tools runCommand xz; }; - kernel_2_6_32_zen4_oldi686 = kernel_2_6_32_zen4.override { + linux_2_6_32_zen4_oldi686 = linux_2_6_32_zen4.override { features = { oldI686 = true; }; }; - kernel_2_6_32_zen4_bfs = kernel_2_6_32_zen4.override { + linux_2_6_32_zen4_bfs = linux_2_6_32_zen4.override { features = { ckSched = true; }; }; - /* Kernel modules are inherently tied to a specific kernel. So + /* Linux kernel modules are inherently tied to a specific kernel. So rather than provide specific instances of those packages for a specific kernel, we have a function that builds those packages for a specific kernel. This function can then be called for whatever kernel you're using. */ - kernelPackagesFor = kernel: rec { + linuxPackagesFor = kernel: rec { inherit kernel; @@ -5759,10 +5932,7 @@ let }; splashutils = - # Splashutils 1.3 is broken, so disable splash on older kernels. - if kernel.features ? fbSplash then /* splashutils_13 */ null else - if kernel.features ? fbConDecor then splashutils_15 else - null; + if kernel.features ? fbConDecor then pkgs.splashutils else null; ext3cowtools = import ../os-specific/linux/ext3cow-tools { inherit stdenv fetchurl; @@ -5787,7 +5957,7 @@ let inherit fetchurl stdenv perl curl bzip2 openssl bison; inherit libtool automake autoconf docbook5 docbook5_xsl libxslt docbook_xml_dtd_43 w3m; - aterm = aterm242fixes; + aterm = aterm25; db4 = db45; flex = flex2533; @@ -5817,16 +5987,16 @@ let }; # Build the kernel modules for the some of the kernels. - kernelPackages_2_6_25 = recurseIntoAttrs (kernelPackagesFor kernel_2_6_25); - kernelPackages_2_6_27 = recurseIntoAttrs (kernelPackagesFor kernel_2_6_27); - kernelPackages_2_6_28 = recurseIntoAttrs (kernelPackagesFor kernel_2_6_28); - kernelPackages_2_6_29 = recurseIntoAttrs (kernelPackagesFor kernel_2_6_29); - kernelPackages_2_6_31 = recurseIntoAttrs (kernelPackagesFor kernel_2_6_31); - kernelPackages_2_6_32 = recurseIntoAttrs (kernelPackagesFor kernel_2_6_32); + linuxPackages_2_6_25 = recurseIntoAttrs (linuxPackagesFor linux_2_6_25); + linuxPackages_2_6_27 = recurseIntoAttrs (linuxPackagesFor linux_2_6_27); + linuxPackages_2_6_28 = recurseIntoAttrs (linuxPackagesFor linux_2_6_28); + linuxPackages_2_6_29 = recurseIntoAttrs (linuxPackagesFor linux_2_6_29); + linuxPackages_2_6_31 = recurseIntoAttrs (linuxPackagesFor linux_2_6_31); + linuxPackages_2_6_32 = recurseIntoAttrs (linuxPackagesFor linux_2_6_32); # The current default kernel / kernel modules. - kernel = kernel_2_6_32; - kernelPackages = kernelPackagesFor kernel; + linux = linux_2_6_32; + linuxPackages = linuxPackagesFor linux; customKernel = composedArgsAndFun (lib.sumTwoArgs (import ../os-specific/linux/kernel/generic.nix) { inherit fetchurl stdenv perl mktemp module_init_tools; @@ -5865,14 +6035,14 @@ let klibc = makeOverridable (import ../os-specific/linux/klibc) { inherit fetchurl stdenv perl bison mktemp; - kernelHeaders = glibc.kernelHeaders; + linuxHeaders = glibc.kernelHeaders; }; # Old version; needed in vmtools for insmod. Should use # module_init_tools instead. klibc_15 = makeOverridable (import ../os-specific/linux/klibc/1.5.nix) { inherit fetchurl stdenv perl bison mktemp; - kernelHeaders = glibc.kernelHeaders; + linuxHeaders = glibc.kernelHeaders; }; klibcShrunk = makeOverridable (import ../os-specific/linux/klibc/shrunk.nix) { @@ -5883,17 +6053,17 @@ let kvm76 = import ../os-specific/linux/kvm/76.nix { inherit fetchurl stdenv zlib e2fsprogs SDL alsaLib pkgconfig rsync; - inherit (glibc) kernelHeaders; + linuxHeaders = glibc.kernelHeaders; }; kvm86 = import ../os-specific/linux/kvm/86.nix { inherit fetchurl stdenv zlib SDL alsaLib pkgconfig pciutils; - inherit (glibc) kernelHeaders; + linuxHeaders = glibc.kernelHeaders; }; kvm88 = import ../os-specific/linux/kvm/88.nix { inherit fetchurl stdenv zlib SDL alsaLib pkgconfig pciutils; - inherit (glibc) kernelHeaders; + linuxHeaders = glibc.kernelHeaders; }; libcap = import ../os-specific/linux/libcap { @@ -6046,13 +6216,7 @@ let inherit fetchurl stdenv; }; - splashutils_13 = import ../os-specific/linux/splashutils/1.3.nix { - inherit fetchurl stdenv klibc; - zlib = zlibStatic; - libjpeg = libjpegStatic; - }; - - splashutils_15 = import ../os-specific/linux/splashutils/1.5.nix { + splashutils = import ../os-specific/linux/splashutils/default.nix { inherit fetchurl stdenv klibc; zlib = zlibStatic; libjpeg = libjpegStatic; @@ -6109,6 +6273,22 @@ let inherit (xlibs) libX11 xproto; };*/ + uboot = makeOverridable (import ../misc/uboot) { + inherit fetchurl stdenv unzip; + }; + +/* + uclibc = import ../os-specific/linux/uclibc { + inherit fetchurl stdenv linuxHeaders; + }; +*/ + + uclibcCross = target: import ../os-specific/linux/uclibc { + inherit fetchurl stdenv; + linuxHeaders = linuxHeadersCross target; + gccCross = gccCrossStageStatic target; + }; + udev = makeOverridable (import ../os-specific/linux/udev) { inherit fetchurl stdenv gperf pkgconfig acl libusb usbutils pciutils glib; }; @@ -6119,7 +6299,7 @@ let }; umlutilities = import ../os-specific/linux/uml-utilities { - inherit fetchurl kernelHeaders stdenv readline lib; + inherit fetchurl linuxHeaders stdenv readline lib; tunctl = true; mconsole = true; }; @@ -6434,14 +6614,12 @@ let }; autopanosiftc = import ../applications/graphics/autopanosiftc { - inherit fetchurl cmake libpng libtiff libjpeg panotools libxml2; - stdenv = overrideGCC stdenv gcc43_wrapper2; + inherit fetchurl stdenv cmake libpng libtiff libjpeg panotools libxml2; }; avidemux = import ../applications/video/avidemux { - inherit fetchurl cmake pkgconfig libxml2 qt4 gettext SDL libxslt x264 + inherit fetchurl stdenv cmake pkgconfig libxml2 qt4 gettext SDL libxslt x264 alsaLib lame faac faad2 libvorbis; - stdenv = overrideGCC stdenv gcc43_wrapper2; inherit (gtkLibs) gtk; inherit (xlibs) libXv pixman libpthreadstubs libXau libXdmcp; }; @@ -6986,8 +7164,7 @@ let }; freepv = import ../applications/graphics/freepv { - inherit fetchurl mesa freeglut libjpeg zlib cmake libxml2 libpng; - stdenv = overrideGCC stdenv gcc43_wrapper2; + inherit fetchurl stdenv mesa freeglut libjpeg zlib cmake libxml2 libpng; inherit (xlibs) libX11 libXxf86vm; }; @@ -7116,7 +7293,6 @@ let inherit stdenv fetchurl glibc mesa freetype zlib glib; inherit (xlibs) libSM libICE libXi libXv libXrender libXrandr libXfixes libXcursor libXinerama libXext libX11; - inherit patchelf05; }; gpsbabel = import ../applications/misc/gpsbabel { @@ -7152,13 +7328,12 @@ let }; hugin = import ../applications/graphics/hugin { - inherit fetchurl cmake panotools libtiff libpng boost pkgconfig + inherit fetchurl stdenv cmake panotools libtiff libpng boost pkgconfig exiv2 gettext ilmbase enblendenfuse autopanosiftc mesa freeglut glew; inherit wxGTK; inherit (xlibs) libXi libXmu; openexr = openexr_1_6_1; - stdenv = overrideGCC stdenv gcc43_wrapper2; }; i810switch = import ../applications/misc/i810 { @@ -7271,8 +7446,9 @@ let }; kbasket = import ../applications/misc/kbasket { - inherit stdenv fetchurl kdelibs x11 zlib libpng libjpeg + inherit fetchurl kdelibs x11 zlib libpng libjpeg perl qt3 gpgme libgpgerror; + stdenv = overrideGCC stdenv gcc43; }; kermit = import ../tools/misc/kermit { @@ -7541,8 +7717,7 @@ let }; paraview = import ../applications/graphics/paraview { - inherit fetchurl cmake qt4; - stdenv = overrideGCC stdenv gcc43_wrapper2; + inherit fetchurl stdenv cmake qt4; }; partitionManager = import ../tools/misc/partition-manager { @@ -7627,10 +7802,9 @@ let }; rawtherapee = import ../applications/graphics/rawtherapee { - inherit fetchsvn pkgconfig cmake lcms libiptcdata; + inherit fetchsvn stdenv pkgconfig cmake lcms libiptcdata; inherit (gtkLibs) gtk gtkmm; inherit (xlibs) libXau libXdmcp pixman libpthreadstubs; - stdenv = overrideGCC stdenv gcc43_wrapper2; }; rcs = import ../applications/version-management/rcs { @@ -8060,14 +8234,8 @@ let pyrex = pyrex095; }; - xscreensaverBase = composedArgsAndFun (import ../applications/graphics/xscreensaver) { - inherit stdenv fetchurl builderDefs lib pkgconfig bc perl intltool; - inherit (xlibs) libX11 libXmu; - }; - - xscreensaver = xscreensaverBase.passthru.function { - flags = ["GL" "gdkpixbuf" "DPMS" "gui" "jpeg"]; - inherit mesa libxml2 libjpeg; + xscreensaver = makeOverridable (import ../applications/graphics/xscreensaver) { + inherit stdenv fetchurl pkgconfig bc perl xlibs libjpeg mesa libxml2; inherit (gtkLibs) gtk; inherit (gnome) libglade; }; @@ -8362,16 +8530,18 @@ let kdelibs = import ../desktops/kde-3/kdelibs { inherit - fetchurl stdenv xlibs zlib perl openssl pcre pkgconfig + fetchurl xlibs zlib perl openssl pcre pkgconfig libjpeg libpng libtiff libxml2 libxslt libtool expat freetype bzip2 cups attr acl; + stdenv = overrideGCC stdenv gcc43; qt = qt3; }; kdebase = import ../desktops/kde-3/kdebase { inherit - fetchurl stdenv pkgconfig x11 xlibs zlib libpng libjpeg perl + fetchurl pkgconfig x11 xlibs zlib libpng libjpeg perl kdelibs openssl bzip2 fontconfig pam hal dbus glib; + stdenv = overrideGCC stdenv gcc43; qt = qt3; }; @@ -8685,7 +8855,7 @@ let inherit fetchurl stdenv perl curl bzip2 openssl src preConfigure automake autoconf libtool configureFlags enableScripts lib bison libxml2; flex = flex2533; - aterm = aterm242fixes; + aterm = aterm25; db4 = db45; inherit docbook5_xsl libxslt docbook5 docbook_xml_dtd_43 w3m; }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 9155f8b7a9aa..8e1709c21cc8 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -638,11 +638,11 @@ rec { ]; }; - ConfigAny = buildPerlPackage { - name = "Config-Any-0.14"; + ConfigAny = buildPerlPackage rec { + name = "Config-Any-0.18"; src = fetchurl { - url = mirror://cpan/authors/id/B/BR/BRICAS/Config-Any-0.14.tar.gz; - sha256 = "1vlr4w2m88figac5pblg6ppzrm11x2pm7r05n48s84cp4mizhim1"; + url = "mirror://cpan/authors/id/B/BR/BRICAS/${name}.tar.gz"; + sha256 = "0hjfvbbhi8r52ycpw507y6d4cway5x5z9pij117q04r1xmwf0qnj"; }; }; @@ -715,6 +715,14 @@ rec { }; }; + DataDumperConcise = buildPerlPackage rec { + name = "Data-Dumper-Concise-1.100"; + src = fetchurl { + url = "mirror://cpan/authors/id/M/MS/MSTROUT/${name}.tar.gz"; + sha256 = "123iy2nnf41sq3sk4plrmqlbwsciir6ww31frrm7vzg388zziz7x"; + }; + }; + DataHierarchy = buildPerlPackage { name = "Data-Hierarchy-0.34"; src = fetchurl { @@ -863,17 +871,16 @@ rec { }; DBIxClass = buildPerlPackage rec { - name = "DBIx-Class-0.08112"; + name = "DBIx-Class-0.08115"; src = fetchurl { - url = "mirror://cpan/authors/id/R/RI/RIBASUSHI/${name}.tar.gz"; - sha256 = "167fmz4pdlis7k3fj20gngihjgs48smijcxhwh6ywsrv6v3vxd57"; + url = "mirror://cpan/authors/id/F/FR/FREW/${name}.tar.gz"; + sha256 = "1addd0763q2jyvh9hdi0ayppqk0bmypw48s1xcwfximbnja8z9mw"; }; propagatedBuildInputs = [ - TestNoWarnings TestException DBI ScopeGuard - PathClass ClassInspector ClassAccessorGrouped - CarpClan TestWarn DataPage SQLAbstract - SQLAbstractLimit ClassC3 ClassC3Componentised - ModuleFind DBDSQLite JSONAny SubName + TestNoWarnings TestException DBI ScopeGuard PathClass + ClassInspector ClassAccessorGrouped CarpClan TestWarn DataPage + SQLAbstract SQLAbstractLimit ClassC3 ClassC3Componentised + ModuleFind DBDSQLite JSONAny SubName DataDumperConcise ]; buildInputs = [TestPod TestPodCoverage]; }; @@ -980,11 +987,11 @@ rec { }; }; - EmailSend = buildPerlPackage { - name = "Email-Send-2.185"; + EmailSend = buildPerlPackage rec { + name = "Email-Send-2.198"; src = fetchurl { - url = mirror://cpan/authors/id/R/RJ/RJBS/Email-Send-2.185.tar.gz; - sha256 = "0pbgnnbmv6z3zzqaiq1sdcv5d26ijhw4p8k8kp6ac7arvldblamz"; + url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz"; + sha256 = "0ffmpqys7yph5lb28m2xan0zd837vywg8c6gjjd9p80dahpqknyx"; }; propagatedBuildInputs = [EmailSimple EmailAddress ModulePluggable ReturnValue]; }; @@ -1007,20 +1014,12 @@ rec { }; EmailSimple = buildPerlPackage rec { - name = "Email-Simple-2.005"; + name = "Email-Simple-2.100"; src = fetchurl { url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz"; - sha256 = "1dh2qgwss1wm6ypvr6m2z01gz19g73kmlk7wa25wxd2gspsq9qck"; + sha256 = "1q86p9r5sb1dwdhcbnkfrbx08440cf74vzgrqc05cgi8mmhdfsh9"; }; - }; - - EmailSimpleCreator = buildPerlPackage rec { - name = "Email-Simple-Creator-1.424"; - src = fetchurl { - url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz"; - sha256 = "16i15sarncacg86wl60dbddlv4p75i8xq6jqp1isj9plp60538ph"; - }; - propagatedBuildInputs = [EmailDateFormat EmailSimple]; + propagatedBuildInputs = [ EmailDateFormat ]; }; EmailValid = buildPerlPackage { @@ -1943,10 +1942,10 @@ rec { }; ScopeUpper = buildPerlPackage rec { - name = "Scope-Upper-0.06"; + name = "Scope-Upper-0.10"; src = fetchurl { url = "mirror://cpan/authors/id/V/VP/VPIT/${name}.tar.gz"; - sha256 = "1qaf310wbfpjb0lmg3fpmhbfnjxqw3j47rj0w0f0cy4bgihi8l43"; + sha256 = "0llscmwyw657pzid2lpc3q8zz3jj28aa66bdpmldv6gfa2a5ny1v"; }; }; @@ -2155,11 +2154,11 @@ rec { }; }; - TestDeep = buildPerlPackage { - name = "Test-Deep-0.103"; + TestDeep = buildPerlPackage rec { + name = "Test-Deep-0.106"; src = fetchurl { - url = mirror://cpan/authors/id/F/FD/FDALY/Test-Deep-0.103.tar.gz; - sha256 = "0cdl08k5v0wc9w20va5qw98ynlbs9ifwndgsix8qhi7h15sj8a5j"; + url = "mirror://cpan/authors/id/F/FD/FDALY/${name}.tar.gz"; + sha256 = "1ix4jc5k696sjhv01mvypmmf7a6kpm5wmgq01j644zjkaxh1minz"; }; propagatedBuildInputs = [TestTester TestNoWarnings]; }; diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix new file mode 100644 index 000000000000..a80c328ea00e --- /dev/null +++ b/pkgs/top-level/platforms.nix @@ -0,0 +1,56 @@ +{ system, pkgs}: +with pkgs; +{ + pc = assert system == "i686-linux" || system == "x86_64-linux"; { + name = "pc"; + uboot = null; + kernelBaseConfig = "defconfig"; + kernelExtraConfig = + '' + # Virtualisation (KVM, Xen...). + PARAVIRT_GUEST y + KVM_CLOCK y + KVM_GUEST y + XEN y + KSM y + + # We need 64 GB (PAE) support for Xen guest support. + HIGHMEM64G? y + ''; + }; + + sheevaplug = assert system == "armv5tel-linux"; { + name = "sheevaplug"; + kernelBaseConfig = "kirkwood_defconfig"; + kernelArch = "arm"; + kernelExtraConfig = + '' + BLK_DEV_RAM y + BLK_DEV_INITRD y + MD y + + # Fail to build + DRM n + SCSI_ADVANSYS n + USB_ISP1362_HCD n + SND_SOC n + SND_ALI5451 n + FB_SAVAGE n + SCSI_NSP32 n + ATA_SFF n + SUNGEM n + IRDA n + ATM_HE n + SCSI_ACARD n + BLK_DEV_CMD640_ENHANCED n + ''; + inherit uboot; + }; + + versatileARM = assert system == "armv5tel-linux"; { + name = "versatileARM"; + kernelBaseConfig = "versatile_defconfig"; + kernelArch = "arm"; + uboot = null; + }; +} diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix index 6b07a54a5127..bf8f5b46d048 100644 --- a/pkgs/top-level/release.nix +++ b/pkgs/top-level/release.nix @@ -4,6 +4,11 @@ let pkgs = allPackages {}; + /* The working or failing letters for cross builds will be sent only to + the following maintainers, as most package maintainers will not be + interested in the result of cross building a package. */ + crossMaintainers = with pkgs.lib.maintainers; [ viric ]; + /* Set the Hydra scheduling priority for a job. The default priority (100) should be used for most jobs. A different priority should only be used for a few particularly interesting @@ -12,7 +17,7 @@ let prio = level: job: toJob job // { schedulingPriority = level; }; toJob = x: if builtins.isAttrs x then x else - { type = "job"; systems = x; schedulingPriority = 10; }; + { type = "job"; systems = x; schedulingPriority = 5; }; /* Perform a job on the given set of platforms. The function `f' is called by Hydra for each platform, and should return some job @@ -21,6 +26,12 @@ let testOn = systems: f: {system ? builtins.currentSystem}: if pkgs.lib.elem system systems then f (allPackages {inherit system;}) else {}; + /* Similar to the testOn function, but with an additional 'crossSystem' + * parameter for allPackages, defining the target platform for cross builds */ + testOnCross = crossSystem: systems: f: {system ? builtins.currentSystem}: + if pkgs.lib.elem system systems then f (allPackages {inherit system + crossSystem;}) else {}; + /* Map an attribute of the form `foo = [platforms...]' to `testOn [platforms...] (pkgs: pkgs.foo)'. */ mapTestOn = pkgs.lib.mapAttrsRecursiveCond @@ -33,6 +44,22 @@ let (pkgs.lib.getAttrFromPath path pkgs); in testOn job.systems getPkg); + + /* Similar to the testOn function, but with an additional 'crossSystem' + * parameter for allPackages, defining the target platform for cross builds, + * and triggering the build of the host derivation (cross built - hostDrv). */ + mapTestOnCross = crossSystem: pkgs.lib.mapAttrsRecursiveCond + (as: !(as ? type && as.type == "job")) + (path: value: + let + job = toJob value; + getPkg = pkgs: setCrossMaintainers + (pkgs.lib.addMetaAttrs { schedulingPriority = toString job.schedulingPriority; } + (pkgs.lib.getAttrFromPath (path ++ ["hostDrv"]) pkgs)); + in testOnCross crossSystem job.systems getPkg); + + setCrossMaintainers = pkg: pkg // { meta.maintainers = crossMaintainers; }; + /* Find all packages that have a meta.platforms field listing the supported platforms. */ packagesWithMetaPlatform = attrSet: @@ -170,6 +197,7 @@ in { gcc43_multi = ["x86_64-linux"]; gcc44 = linux; gcj44 = linux; + ghdl = linux; ghostscript = linux; ghostscriptX = linux; gimp = linux; @@ -179,6 +207,7 @@ in { glibcLocales = linux; glxinfo = linux; gnash = linux; + gnat44 = linux; gnugrep = all; gnum4 = all; gnumake = all; @@ -348,8 +377,7 @@ in { smbfsFuse = linux; socat = linux; spidermonkey = linux; - splashutils_13 = linux; - splashutils_15 = linux; + splashutils = linux; sqlite = allBut "i686-cygwin"; squid = linux; ssmtp = linux; @@ -536,37 +564,33 @@ in { l10n.ru = linux; }; - kernelPackages_2_6_25 = { + linuxPackages_2_6_25 = { aufs = linux; kernel = linux; }; - kernelPackages_2_6_27 = { + linuxPackages_2_6_27 = { aufs = linux; kernel = linux; virtualbox = linux; virtualboxGuestAdditions = linux; }; - kernelPackages_2_6_28 = { + linuxPackages_2_6_28 = { aufs = linux; kernel = linux; virtualbox = linux; virtualboxGuestAdditions = linux; }; - kernelPackages_2_6_29 = { + linuxPackages_2_6_29 = { aufs = linux; kernel = linux; virtualbox = linux; virtualboxGuestAdditions = linux; }; - kernelPackages_2_6_31 = { - kernel = linux; - }; - - kernelPackages_2_6_32 = { + linuxPackages_2_6_32 = { aufs = linux; kernel = linux; virtualbox = linux; @@ -631,4 +655,27 @@ in { xset = linux; }; -} )) +} )) // ( + +/* Test some cross builds to the Sheevaplug */ +let + crossSystem = { + config = "armv5tel-unknown-linux-gnueabi"; + bigEndian = false; + arch = "arm"; + float = "soft"; + }; + nativePlatforms = linux; +in { + crossArmLinux = mapTestOnCross crossSystem (rec { + bison = nativePlatforms; + uboot = nativePlatforms; + tightvnc = nativePlatforms; + #openoffice = nativePlatforms; + wxGTK = nativePlatforms; + #firefox = nativePlatforms; + xorg = { + #xorgserver = nativePlatforms; + }; + }); +})