diff options
Diffstat (limited to 'pkgs')
31 files changed, 259 insertions, 146 deletions
diff --git a/pkgs/build-support/setup-hooks/compress-man-pages.sh b/pkgs/build-support/setup-hooks/compress-man-pages.sh index 1dd9788419b84..f1d9cf3a3696d 100644 --- a/pkgs/build-support/setup-hooks/compress-man-pages.sh +++ b/pkgs/build-support/setup-hooks/compress-man-pages.sh @@ -3,6 +3,7 @@ fixupOutputHooks+=('if [ -z "$dontGzipMan" ]; then compressManPages "$prefix"; f compressManPages() { local dir="$1" + if [ ! -d "$dir/share/man" ]; then return; fi echo "gzipping man pages in $dir" GLOBIGNORE=.:..:*.gz:*.bz2 diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index ac83a7cca3d38..b3274c88cd7b2 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -1,14 +1,15 @@ preConfigureHooks+=(_multioutConfig) preFixupHooks+=(_multioutDocs) +preFixupHooks+=(_multioutDevs) postFixupHooks+=(_multioutPropagateDev) -# Assign the first nonempty string to variable named $1 +# Assign the first string containing nonempty variable to the variable named $1 _assignFirst() { local varName="$1" shift - while [ $# -ge 0 ]; do - if [ -n "$1" ]; then eval "${varName}"="$1"; return; fi + while [ $# -ge 1 ]; do + if [ -n "${!1}" ]; then eval "${varName}"="$1"; return; fi shift done return 1 # none found @@ -18,78 +19,108 @@ _assignFirst() { # The variables are global to be usable anywhere during the build. # ToDo: I was unable to get rid of the double-name redundancy (I hate bash eval ways) -_assignFirst outputDev "$outputDev" "$dev" "$out" -_assignFirst outputBin "$outputBin" "$bin" "$out" +# ToDo: easy way of overriding from withing mkDerivation attrset + +_assignFirst outputDev "$outputDev" "dev" "out" +_assignFirst outputBin "$outputBin" "bin" "out" _assignFirst outputInclude "$outputInclude" "$outputDev" # so-libs are often among the main things to keep, and so go to $out -_assignFirst outputLib "$outputLib" "$lib" "$out" +_assignFirst outputLib "$outputLib" "lib" "out" -_assignFirst outputDoc "$outputDoc" "$doc" "$out" +_assignFirst outputDoc "$outputDoc" "doc" "out" # man and info pages are small and often useful to distribute with binaries -_assignFirst outputMan "$outputMan" "$man" "$outputBin" -_assignFirst outputInfo "$outputInfo" "$info" "$outputMan" +_assignFirst outputMan "$outputMan" "man" "doc" "$outputBin" +_assignFirst outputInfo "$outputInfo" "info" "doc" "$outputMan" + +# Make stdenv put propagated*BuildInputs into $outputDev instead of $out +propagateIntoOutput="${!outputDev}" -# put propagated*BuildInputs into $outputDev instead of $out -propagateIntoOutput="$outputDev" # Add standard flags to put files into the desired outputs. _multioutConfig() { - if [ -n "${setOutputFlags-1}" ]; then - configureFlags="\ - --bindir=$outputBin/bin --sbindir=$outputBin/sbin \ - --includedir=$outputInclude/include --oldincludedir=$outputInclude/include \ - --mandir=$outputMan/share/man --infodir=$outputInfo/share/info --docdir=$outputDoc/share/doc \ - --libdir=$outputLib/lib --libexecdir=$outputLib/libexec \ - $configureFlags" - - installFlags="\ - pkgconfigdir=$outputDev/lib/pkgconfig \ - m4datadir=$outputDev/share/aclocal aclocaldir=$outputDev/share/aclocal \ - $installFlags" - fi + if [ -z "${setOutputFlags-1}" ]; then return; fi; + + configureFlags="\ + --bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \ + --includedir=${!outputInclude}/include --oldincludedir=${!outputInclude}/include \ + --mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \ + --docdir=${!outputDoc}/share/doc \ + --libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \ + $configureFlags" + + installFlags="\ + pkgconfigdir=${!outputDev}/lib/pkgconfig \ + m4datadir=${!outputDev}/share/aclocal aclocaldir=${!outputDev}/share/aclocal \ + $installFlags" } # Add rpath prefixes to library paths, and avoid stdenv doing it for $out. -_addRpathPrefix "$outputLib" +_addRpathPrefix "${!outputLib}" NIX_NO_SELF_RPATH=1 -# Move documentation into the desired outputs. + +# Move subpaths that match pattern $1 from under any output/ to the $2 output/ +_moveToOutput() { + local patt="$1" + local dstOut="$2" + echo "XXX: m2o '$1' '$2'" + local output + for output in $outputs; do + echo "XXX: output='$output'" + if [ "${output}" = "$dstOut" ]; then continue; fi + local srcPath + for srcPath in ${!output}/$patt; do + if [ ! -e "$srcPath" ]; then continue; fi + local dstPath="$dstOut${srcPath#${!output}}" + echo "moving $srcPath to $dstPath" + + if [ -d "$dstPath" ] && [ -d "$srcPath" ] + then # attempt directory merge + mv -t "$dstPath" "$srcPath"/* + rmdir "$srcPath" + else # usual move + mkdir -p $(readlink -m "$dstPath/..") # create the parent for $dstPath + mv "$srcPath" "$dstPath" + fi + done + done +} + +# Move documentation to the desired outputs. _multioutDocs() { - _moveToOutput share/man "$outputMan" - _moveToOutput share/info "$outputInfo" - _moveToOutput share/doc "$outputDoc" + echo "Looking for documentation to move between outputs" + _moveToOutput share/man "${!outputMan}" + _moveToOutput share/info "${!outputInfo}" + _moveToOutput share/doc "${!outputDoc}" # Remove empty share directory. if [ -d "$out/share" ]; then rmdir "$out/share" 2> /dev/null || true fi } -_moveToOutput() { - local d="$1" - local dst="$2" - if [ -z "$dst" -a ! -e $dst/$d ]; then return; fi - local output - for output in $outputs; do - if [ "${!output}" = "$dst" ]; then continue; fi - if [ -d "${!output}/$d" ]; then - echo "moving ${!output}/$d to $dst/$d" - mkdir -p $dst/share - mv ${!output}/$d $dst/$d - break - fi - done + +# Move development-only stuff to the desired outputs. +_multioutDevs() { + if [ -z "${moveToDev-1}" ]; then return; fi; + echo "Looking for development-only stuff to move between outputs" + _moveToOutput include "${!outputInclude}" + _moveToOutput lib/pkgconfig "${!outputDev}" + _moveToOutput "lib/*.la" "${!outputDev}" } +# Make ${!outputDev} propagate other outputs needed for development +# Note: during the build, probably only the "native" development packages are useful. +# With current cross-building setup, all packages are "native" if not cross-building. _multioutPropagateDev() { - if [ "$outputInclude" != "$propagateIntoOutput" ]; then + if [ "${!outputInclude}" != "$propagateIntoOutput" ]; then mkdir -p "$propagateIntoOutput"/nix-support - echo -n " $outputInclude" >> "$propagateIntoOutput"/nix-support/propagated-native-build-inputs + echo -n " ${!outputInclude}" >> "$propagateIntoOutput"/nix-support/propagated-native-build-inputs fi - if [ "$outputLib" != "$propagateIntoOutput" ]; then + if [ "${!outputLib}" != "$propagateIntoOutput" ]; then mkdir -p "$propagateIntoOutput"/nix-support - echo -n " $outputLib" >> "$propagateIntoOutput"/nix-support/propagated-native-build-inputs + echo -n " ${!outputLib}" >> "$propagateIntoOutput"/nix-support/propagated-native-build-inputs fi } diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix index 1df9e46c0f705..aa20a69978670 100644 --- a/pkgs/development/libraries/freetype/default.nix +++ b/pkgs/development/libraries/freetype/default.nix @@ -23,10 +23,6 @@ stdenv.mkDerivation rec { sha256 = "0pppcn73b5pwd7zdi9yfx16f5i93y18q7q4jmlkwmwrfsllqp160"; }; - outputs = [ "dev" "out" ]; - - configureFlags = "--disable-static --bindir=$(dev)/bin"; - patches = [ ./enable-validation.patch ] # from Gentoo ++ [ (fetch_bohoomil "freetype-2.5.3-pkgconfig.patch" "1dpfdh8kmka3gzv14glz7l79i545zizah6wma937574v5z2iy3nn") @@ -36,12 +32,16 @@ stdenv.mkDerivation rec { (fetch_bohoomil "infinality-2.5.3.patch" "0mxiybcb4wwbicrjiinh1b95rv543bh05sdqk1v0ipr3fxfrb47q") ; + outputs = [ "dev" "out" ]; + propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype # dependence on harfbuzz is looser than the reverse dependence - buildInputs = [ pkgconfig which ] + buildInputs = [ stdenv.hookLib.multiout pkgconfig which ] # FreeType requires GNU Make, which is not part of stdenv on FreeBSD. ++ optional (!stdenv.isLinux) gnumake; + configureFlags = "--disable-static --bindir=$(dev)/bin"; + # from Gentoo, see https://bugzilla.redhat.com/show_bug.cgi?id=506840 NIX_CFLAGS_COMPILE = "-fno-strict-aliasing"; # The asm for armel is written with the 'asm' keyword. @@ -52,12 +52,8 @@ stdenv.mkDerivation rec { doCheck = true; # compat hacks - postInstall = glib.flattenInclude + '' - ln -s . "$out"/include/freetype - - mkdir $dev/lib - mv $out/lib/pkgconfig $dev/lib/ - ln -s freetype2/freetype $dev/include/freetype + postFixup = glib.flattenInclude + '' + ln -s . "$dev"/include/freetype ''; crossAttrs = { diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 55d80e5ccff8a..c38d34eb94ae8 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -51,11 +51,11 @@ stdenv.mkDerivation rec { patches = optional stdenv.isDarwin ./darwin-compilation.patch; - outputs = [ "dev" "out" "bin" ]; # ToDo: docs? + #outputs = [ "dev" "out" "bin" ]; # ToDo: no idea what's wrong! docs? - setupHook = ./setup-hook.sh; + #setupHook = ./setup-hook.sh; - buildInputs = [ stdenv.hookLib.multiout libelf ] + buildInputs = [ /*stdenv.hookLib.multiout*/ libelf ] ++ optionals doCheck [ tzdata libxml2 desktop_file_utils shared_mime_info ]; nativeBuildInputs = [ pkgconfig gettext perl python ]; diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh index f173744e5ca63..35d7d9d8fbe99 100644 --- a/pkgs/development/libraries/glib/setup-hook.sh +++ b/pkgs/development/libraries/glib/setup-hook.sh @@ -14,4 +14,4 @@ glibPreFixupPhase() { addToSearchPath GSETTINGS_SCHEMAS_PATH "$out/share/gsettings-schemas/$name" } -preFixupPhases="$preFixupPhases glibPreFixupPhase" +preFixupPhases+=(glibPreFixupPhase) diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix index 9e28334804bd6..778b5144f291a 100644 --- a/pkgs/development/libraries/gmp/5.1.x.nix +++ b/pkgs/development/libraries/gmp/5.1.x.nix @@ -2,7 +2,7 @@ with { inherit (stdenv.lib) optional; }; -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { name = "gmp-5.1.3"; src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv @@ -10,6 +10,9 @@ stdenv.mkDerivation (rec { sha256 = "0q5i39pxrasgn9qdxzpfbwhh11ph80p57x6hf48m74261d97j83m"; }; + outputs = [ "out" "info" ]; + buildInputs = [ stdenv.hookLib.multiout ]; + nativeBuildInputs = [ m4 ]; configureFlags = @@ -22,6 +25,7 @@ stdenv.mkDerivation (rec { ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions" ++ optional stdenv.is64bit "--with-pic" ; + dontDisableStatic = withStatic; doCheck = true; @@ -58,6 +62,4 @@ stdenv.mkDerivation (rec { maintainers = [ maintainers.simons ]; }; } - // stdenv.lib.optionalAttrs withStatic { dontDisableStatic = true; } -) diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix index da5a080521c6d..f62dff58968f7 100644 --- a/pkgs/development/libraries/libffi/default.nix +++ b/pkgs/development/libraries/libffi/default.nix @@ -10,7 +10,10 @@ stdenv.mkDerivation rec { patches = stdenv.lib.optional (stdenv.needsPax) ./libffi-3.0.13-emutramp_pax_proc.patch; - buildInputs = stdenv.lib.optional doCheck dejagnu; + outputs = [ "dev" "out" "doc" ]; + + buildInputs = [ stdenv.hookLib.multiout ] + ++ stdenv.lib.optional doCheck dejagnu; configureFlags = [ "--with-gcc-arch=generic" # no detection of -march= or -mtune= diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix index f59c205af4fdf..a27d5af6f8dfb 100644 --- a/pkgs/development/libraries/libjpeg-turbo/default.nix +++ b/pkgs/development/libraries/libjpeg-turbo/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, nasm }: +{ stdenv, fetchurl, nasm, autoreconfHook }: stdenv.mkDerivation rec { name = "libjpeg-turbo-1.3.1"; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { outputs = [ "dev" "out" "doc" "bin" ]; - buildInputs = [ nasm ]; + buildInputs = [ stdenv.hookLib.multiout autoreconfHook nasm ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix index c4aa41681a30d..7014c7686188d 100644 --- a/pkgs/development/libraries/libpng/default.nix +++ b/pkgs/development/libraries/libpng/default.nix @@ -18,17 +18,19 @@ in stdenv.mkDerivation rec { url = "mirror://sourceforge/libpng/libpng-${version}.tar.xz"; inherit sha256; }; + postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1"; outputs = [ "dev" "out" "man" ]; - - preConfigure = "export bin=$dev"; - - postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1"; + buildInputs = [ stdenv.hookLib.multiout ]; propagatedBuildInputs = [ zlib ]; + preConfigure = "export bin=$dev"; + doCheck = true; + postInstall = ''mv "$out/bin" "$dev/bin"''; + passthru = { inherit zlib; }; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index aa4ac0a792238..55db7692ffd1c 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -19,8 +19,6 @@ stdenv.mkDerivation rec { sha256 = "0wj8d1iwk9vnpax2h29xqc2hwknxg3s0ay2d5pxkg59ihbifn6pa"; }; - outputs = [ "dev" "out" "bin" "doc" ]; - patchPhase = '' for p in ${patchDir}/*-{2013-4244,2012-4447,2012-4564,2013-1960,2013-1961,libjpeg-turbo}.patch; do patch -p1 < "$p" @@ -34,6 +32,9 @@ stdenv.mkDerivation rec { patch -p0 < ${patchDir}/${if stdenv.isDarwin then "tiff-4.0.3" else "*"}-tiff2pdf-colors.patch ''; # ^ sh on darwin seems not to expand globs in redirects, and I don't want to rebuild all again elsewhere + outputs = [ "dev" "out" "bin" "doc" ]; + buildInputs = [ stdenv.hookLib.multiout ]; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ zlib libjpeg xz ]; #TODO: opengl support (bogus configure detection) diff --git a/pkgs/development/libraries/libvorbis/default.nix b/pkgs/development/libraries/libvorbis/default.nix index 5e883771b71af..6bdf10765deb9 100644 --- a/pkgs/development/libraries/libvorbis/default.nix +++ b/pkgs/development/libraries/libvorbis/default.nix @@ -11,11 +11,11 @@ stdenv.mkDerivation { sha256 = "0wpk87jnhngcl3nc5i39flkycx1sjzilx8jjx4zc4p8r55ylj19g"; }; - buildInputs = [ pkgconfig ]; + outputs = [ "dev" "out" "doc" ]; - propagatedBuildInputs = [ libogg ]; + buildInputs = [ stdenv.hookLib.multiout pkgconfig ]; - outputs = [ "dev" "out" "doc" ]; + propagatedBuildInputs = [ libogg ]; doCheck = true; diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index e3fbaececb9b5..07ab3187f8cfa 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -8,7 +8,9 @@ stdenv.mkDerivation rec { sha256 = "0sqvpfkzamxdr87anzakf9dhkfh15lfmm5bsqajk02h1mxh3zivr"; }; - buildInputs = [ gmp ]; + outputs = [ "dev" "out" "doc" ]; + + buildInputs = [ stdenv.hookLib.multiout gmp ]; configureFlags = /* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite: diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 847e4f0ac9d9b..babf49274607e 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -49,10 +49,10 @@ stdenv.mkDerivation { patches = patchesCross false; outputs = [ "dev" "out" "man" "bin" ]; + setOutputFlags = false; - setOutputFlags = false; # ToDo: strange? - - buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders; + buildInputs = [ stdenv.hookLib.multiout ] + ++ stdenv.lib.optional withCryptodev cryptodevHeaders; nativeBuildInputs = [ perl ]; diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 0938e2a17a796..5f9a01208d84d 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -13,15 +13,22 @@ stdenv.mkDerivation rec { sha256 = "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n"; }; - configureFlags = if static then "" else "--shared"; + outputs = [ "dev" "out" "static" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ]; + setOutputFlags = false; + + configureFlags = stdenv.lib.optional (!static) "--shared"; preConfigure = '' if test -n "$crossConfig"; then export CC=$crossConfig-gcc - configureFlags=${if static then "" else "--shared"} fi ''; + postInstall = '' + _moveToOutput lib/libz.a "$static" + ''; + # As zlib takes part in the stdenv building, we don't want references # to the bootstrap-tools libgcc (as uses to happen on arm/mips) NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-static-libgcc"; diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 8d8fc5d464e89..30ea323908fa7 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -34,8 +34,10 @@ stdenv.mkDerivation rec { ./pt-pax-flags-20121023.patch ]; + outputs = [ "dev" "out" "info" ]; + buildInputs = - [ zlib ] + [ stdenv.hookLib.multiout zlib ] ++ optional gold bison; inherit noSysDirs; @@ -66,6 +68,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + postFixup = "ln -s $out/bin $dev/bin"; # tools needed for development + meta = { description = "GNU Binutils, tools for manipulating binaries (linker, assembler, etc.)"; diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix index 98d22dcf42b40..df52596c5a557 100644 --- a/pkgs/development/tools/misc/libtool/libtool2.nix +++ b/pkgs/development/tools/misc/libtool/libtool2.nix @@ -8,9 +8,10 @@ stdenv.mkDerivation rec { sha256 = "0649qfpzkswgcj9vqkkr9rn4nlcx80faxpyqscy2k1x9c94f93dk"; }; - nativeBuildInputs = [ lzma m4 perl ]; - outputs = [ "out" "lib" ]; + buildInputs = [ stdenv.hookLib.multiout ]; + + nativeBuildInputs = [ lzma m4 perl ]; # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the # "fixed" path in generated files! diff --git a/pkgs/development/tools/misc/pkgconfig/default.nix b/pkgs/development/tools/misc/pkgconfig/default.nix index 2ce1fd7b6e4d1..4decdc424d5bd 100644 --- a/pkgs/development/tools/misc/pkgconfig/default.nix +++ b/pkgs/development/tools/misc/pkgconfig/default.nix @@ -1,22 +1,27 @@ -{stdenv, fetchurl, automake, vanilla ? false}: +{ stdenv, fetchurl, automake, vanilla ? false }: -stdenv.mkDerivation (rec { +let + inherit (stdenv.lib) optional; +in +stdenv.mkDerivation rec { name = "pkg-config-0.28"; - + setupHook = ./setup-hook.sh; - + src = fetchurl { url = "http://pkgconfig.freedesktop.org/releases/${name}.tar.gz"; sha256 = "0igqq5m204w71m11y0nipbdf5apx87hwfll6axs12hn4dqfb6vkb"; }; + # Process Requires.private properly, see + # http://bugs.freedesktop.org/show_bug.cgi?id=4738. + patches = optional (!vanilla) ./requires-private.patch; + + preConfigure = stdenv.lib.optionalString (stdenv.system == "mips64el-linux") + ''cp -v ${automake}/share/automake*/config.{sub,guess} .''; configureFlags = [ "--with-internal-glib" ]; - patches = if vanilla then [] else [ - # Process Requires.private properly, see - # http://bugs.freedesktop.org/show_bug.cgi?id=4738. - ./requires-private.patch - ]; + postInstall = ''rm "$out"/bin/*-pkg-config''; # clean the duplicate file meta = { description = "A tool that allows packages to find out information about other packages"; @@ -24,9 +29,5 @@ stdenv.mkDerivation (rec { platforms = stdenv.lib.platforms.all; }; -} // (if stdenv.system == "mips64el-linux" then - { - preConfigure = '' - cp -v ${automake}/share/automake*/config.{sub,guess} . - ''; - } else {})) +} + diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix index e82214df634aa..1b5d617357bb7 100644 --- a/pkgs/os-specific/linux/libcap/default.nix +++ b/pkgs/os-specific/linux/libcap/default.nix @@ -12,6 +12,7 @@ stdenv.mkDerivation rec { }; outputs = [ "dev" "out" ]; + buildInputs = [ stdenv.hookLib.multiout ]; nativeBuildInputs = [ perl ]; propagatedBuildInputs = [ attr ]; @@ -20,14 +21,10 @@ stdenv.mkDerivation rec { makeFlags = "lib=lib prefix=$(out)"; - passthru = { - postinst = n : '' - mkdir -p $out/share/doc/${n} - cp ../License $out/share/doc/${n}/License - ''; - }; - - postInstall = passthru.postinst name; + postInstall = '' + mkdir -p "$dev/share/doc/${name}" + cp ../License "$dev/share/doc/${name}/License" + ''; meta = { description = "Library for working with POSIX capabilities"; diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index 8423ea6f12367..39596c7e03267 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ flex ]; - buildInputs = [ cracklib ]; + buildInputs = [ stdenv.hookLib.multiout cracklib ]; enableParallelBuilding = true; diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 81988e45db07d..d03249387b71d 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -606,7 +606,6 @@ let url = mirror://xorg/individual/lib/libX11-1.6.2.tar.bz2; sha256 = "05mx0s0vqzds3qjc1gmjr2s6x2ll37z4lfhgm7p2w7936zl2g81a"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig inputproto kbproto libxcb xextproto xf86bigfontproto xproto xtrans ]; })) // {inherit inputproto kbproto libxcb xextproto xf86bigfontproto xproto xtrans ;}; @@ -627,7 +626,6 @@ let url = mirror://xorg/individual/lib/libXau-1.0.8.tar.bz2; sha256 = "1wm4pv12f36cwzhldpp7vy3lhm3xdcnp4f184xkxsp7b18r7gm7x"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig xproto ]; })) // {inherit xproto ;}; @@ -648,7 +646,6 @@ let url = mirror://xorg/individual/lib/libXcomposite-0.4.4.tar.bz2; sha256 = "0y21nfpa5s8qmx0srdlilyndas3sgl0c6rc26d5fx2vx436m1qpd"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig compositeproto libX11 libXfixes xproto ]; })) // {inherit compositeproto libX11 libXfixes xproto ;}; @@ -659,7 +656,6 @@ let url = mirror://xorg/individual/lib/libXcursor-1.1.14.tar.bz2; sha256 = "1prkdicl5y5yx32h1azh6gjfbijvjp415javv8dsakd13jrarilv"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig fixesproto libX11 libXfixes xproto libXrender ]; })) // {inherit fixesproto libX11 libXfixes xproto libXrender ;}; @@ -670,7 +666,6 @@ let url = mirror://xorg/individual/lib/libXdamage-1.1.4.tar.bz2; sha256 = "1bamagq7g6s0d23l8rb3nppj8ifqj05f7z9bhbs4fdg8az3ffgvw"; }; - outputs = [ "dev" "out" ]; buildInputs = [pkgconfig damageproto fixesproto libX11 xextproto libXfixes xproto ]; })) // {inherit damageproto fixesproto libX11 xextproto libXfixes xproto ;}; @@ -681,7 +676,6 @@ let url = mirror://xorg/X11R7.7/src/everything/libXdmcp-1.1.1.tar.bz2; sha256 = "13highx4xpgkiwykpcl7z2laslrjc4pzi4h617ny9p7r6116vkls"; }; - outputs = [ "dev" "out" "doc" ]; buildInputs = [pkgconfig xproto ]; })) // {inherit xproto ;}; @@ -692,7 +686,6 @@ let url = mirror://xorg/individual/lib/libXext-1.3.3.tar.bz2; sha256 = "0dbfn5bznnrhqzvkrcmw4c44yvvpwdcsrvzxf4rk27r36b9x865m"; }; - outputs = [ "dev" "out" "man" "doc" ]; buildInputs = [pkgconfig libX11 xextproto xproto ]; })) // {inherit libX11 xextproto xproto ;}; @@ -703,7 +696,6 @@ let url = mirror://xorg/individual/lib/libXfixes-5.0.1.tar.bz2; sha256 = "0rs7qgzr6dpr62db7sd91c1b47hzhzfr010qwnpcm8sg122w1gk3"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig fixesproto libX11 xextproto xproto ]; })) // {inherit fixesproto libX11 xextproto xproto ;}; @@ -724,7 +716,6 @@ let url = mirror://xorg/individual/lib/libXft-2.3.2.tar.bz2; sha256 = "0k6wzi5rzs0d0n338ms8n8lfyhq914hw4yl2j7553wqxfqjci8zm"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig fontconfig freetype libX11 xproto libXrender ]; })) // {inherit fontconfig freetype libX11 xproto libXrender ;}; @@ -735,7 +726,6 @@ let url = mirror://xorg/individual/lib/libXi-1.7.4.tar.bz2; sha256 = "0i12lj973grlp9fa79v0vh9cahk3nf9csdjnf81iip0qcrlc5zrc"; }; - outputs = [ "dev" "out" "man" "doc" ]; buildInputs = [pkgconfig inputproto libX11 libXext xextproto libXfixes xproto ]; })) // {inherit inputproto libX11 libXext xextproto libXfixes xproto ;}; @@ -746,7 +736,6 @@ let url = mirror://xorg/individual/lib/libXinerama-1.1.3.tar.bz2; sha256 = "1qlqfvzw45gdzk9xirgwlp2qgj0hbsyiqj8yh8zml2bk2ygnjibs"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig libX11 libXext xextproto xineramaproto ]; })) // {inherit libX11 libXext xextproto xineramaproto ;}; @@ -787,7 +776,6 @@ let url = mirror://xorg/individual/lib/libXrandr-1.4.2.tar.bz2; sha256 = "1b95p3l84ppv6j7dbbmg0zrz6k8xdwvnag1l6ajm3gk9qwdb79ya"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig randrproto renderproto libX11 libXext xextproto xproto libXrender ]; })) // {inherit randrproto renderproto libX11 libXext xextproto xproto libXrender ;}; @@ -798,7 +786,6 @@ let url = mirror://xorg/individual/lib/libXrender-0.9.8.tar.bz2; sha256 = "0qpwyjhbpp734vnhca992pjh4w7ijslidkzx1pcwbbk000pv050x"; }; - outputs = [ "dev" "out" "doc" ]; buildInputs = [pkgconfig renderproto libX11 xproto ]; })) // {inherit renderproto libX11 xproto ;}; @@ -879,7 +866,6 @@ let url = mirror://xorg/individual/lib/libXxf86vm-1.1.3.tar.bz2; sha256 = "1f1pxj018nk7ybxv58jmn5y8gm2288p4q3l2dng9n1p25v1qcpns"; }; - outputs = [ "dev" "out" "man" ]; buildInputs = [pkgconfig libX11 libXext xextproto xf86vidmodeproto xproto ]; })) // {inherit libX11 libXext xextproto xf86vidmodeproto xproto ;}; @@ -930,7 +916,6 @@ let url = http://xcb.freedesktop.org/dist/libxcb-1.11.tar.bz2; sha256 = "1xqgc81krx14f2c8yl5chzg5g2l26mhm2rwffy8dx7jv0iq5sqq3"; }; - outputs = [ "dev" "out" "doc" "man" ]; buildInputs = [pkgconfig libxslt libpthreadstubs python libXau xcbproto libXdmcp ]; })) // {inherit libxslt libpthreadstubs python libXau xcbproto libXdmcp ;}; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index a81b1a4ac2259..e93e0348b8672 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -56,8 +56,9 @@ in }; libxcb = attrs : attrs // { - nativeBuildInputs = [ args.python ]; + nativeBuildInputs = [ stdenv.hookLib.multiout args.python ]; configureFlags = "--enable-xkb"; + outputs = [ "dev" "out" "doc" "man" ]; }; xcbproto = attrs : attrs // { @@ -69,6 +70,8 @@ in }; libX11 = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; preConfigure = setMalloc0ReturnsNullCrossCompiling; postInstall = '' @@ -77,6 +80,16 @@ in ''; }; + libXau = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + }; + + libXdmcp = attrs: attrs // { + outputs = [ "dev" "out" "doc" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + }; + libXfont = attrs: attrs // { propagatedBuildInputs = [ args.freetype ]; # propagate link reqs. like bzip2 # prevents "misaligned_stack_error_entering_dyld_stub_binder" @@ -87,14 +100,11 @@ in libXxf86vm = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; preConfigure = setMalloc0ReturnsNullCrossCompiling; }; - libXrandr = attrs: attrs // { - preConfigure = setMalloc0ReturnsNullCrossCompiling; - propagatedBuildInputs = [xorg.libXrender]; - }; - # Propagate some build inputs because of header file dependencies. # Note: most of these are in Requires.private, so maybe builder.sh # should propagate them automatically. @@ -114,6 +124,8 @@ in }; libXcomposite = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; propagatedBuildInputs = [ xorg.libXfixes ]; }; @@ -121,7 +133,19 @@ in propagatedBuildInputs = [ xorg.libXmu ]; }; + libXcursor = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + }; + + libXdamage = attrs: attrs // { + outputs = [ "dev" "out" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + }; + libXft = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; propagatedBuildInputs = [ xorg.libXrender args.freetype args.fontconfig ]; preConfigure = setMalloc0ReturnsNullCrossCompiling; # the include files need ft2build.h, and Requires.private isn't enough for us @@ -131,15 +155,42 @@ in }; libXext = attrs: attrs // { + outputs = [ "dev" "out" "man" "doc" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; propagatedBuildInputs = [ xorg.xproto xorg.libXau ]; preConfigure = setMalloc0ReturnsNullCrossCompiling; }; + libXfixes = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + }; + + libXi = attrs: attrs // { + outputs = [ "dev" "out" "man" "doc" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + }; + + libXinerama = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + }; + + libXrandr = attrs: attrs // { + outputs = [ "dev" "out" "man" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + preConfigure = setMalloc0ReturnsNullCrossCompiling; + propagatedBuildInputs = [xorg.libXrender]; + }; + libSM = attrs: attrs // { propagatedBuildInputs = [ xorg.libICE ]; }; - libXrender = attrs: attrs - // { preConfigure = setMalloc0ReturnsNullCrossCompiling; }; + libXrender = attrs: attrs // { + outputs = [ "dev" "out" "doc" ]; + buildInputs = [ stdenv.hookLib.multiout ] ++ attrs.buildInputs; + preConfigure = setMalloc0ReturnsNullCrossCompiling; + }; libXvMC = attrs: attrs // { buildInputs = attrs.buildInputs ++ [xorg.renderproto]; }; diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix index 6a6b8563a5550..2c545ae1c33c4 100644 --- a/pkgs/shells/bash/default.nix +++ b/pkgs/shells/bash/default.nix @@ -55,7 +55,11 @@ stdenv.mkDerivation rec { postInstall = '' # Add an `sh' -> `bash' symlink. ln -s bash "$out/bin/sh" - ''; + '' + # most space is taken by locale data + + stdenv.lib.optionalString (!interactive) '' + rm -r "$out/share" + ''; meta = { homepage = http://www.gnu.org/software/bash/; diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix index 87324ac80a246..140294d987d5d 100644 --- a/pkgs/tools/archivers/gnutar/default.nix +++ b/pkgs/tools/archivers/gnutar/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, acl }: stdenv.mkDerivation rec { name = "gnutar-${version}"; @@ -9,6 +9,9 @@ stdenv.mkDerivation rec { sha256 = "1iip0fk0wqhxb0jcwphz43r4fxkx1y7mznnhmlvr618jhp7b63wv"; }; + outputs = [ "out" "info" ]; + buildInputs = [ stdenv.hookLib.multiout acl ]; + # May have some issues with root compilation because the bootstrap tool # cannot be used as a login shell for now. FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux" || stdenv.isSunOS) "1"; diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix index 293d832345bd9..aca5995c3baea 100644 --- a/pkgs/tools/compression/xz/default.nix +++ b/pkgs/tools/compression/xz/default.nix @@ -14,7 +14,10 @@ stdenv.mkDerivation rec { doCheck = true; # In stdenv-linux, prevent a dependency on bootstrap-tools. - preHook = "unset CONFIG_SHELL"; + # The preHook hack no longer worked, no idea why. + postFixup = '' + sed '1s:#!${stdenv.shell}:#!/usr/bin/env sh:' -i "$bin"/bin/* + ''; meta = { homepage = http://tukaani.org/xz/; diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 8844fe9c57cc0..b3433ca83ec2a 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -20,8 +20,11 @@ let patches = [ ./help2man.patch ]; + outputs = [ "out" "info" ]; + nativeBuildInputs = [ perl ]; buildInputs = [ gmp ] + ++ [ stdenv.hookLib.multiout ] ++ optional aclSupport acl ++ optionals selinuxSupport [ libselinux libsepol ]; diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix index a6ea96b77db58..407470870a67f 100644 --- a/pkgs/tools/misc/findutils/default.nix +++ b/pkgs/tools/misc/findutils/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, coreutils}: +{ stdenv, fetchurl, coreutils }: stdenv.mkDerivation rec { name = "findutils-4.4.2"; @@ -12,6 +12,9 @@ stdenv.mkDerivation rec { patches = [ ./findutils-path.patch ./change_echo_path.patch ]; + outputs = [ "out" "info" ]; + buildInputs = [ stdenv.hookLib.multiout ]; + doCheck = true; crossAttrs = { diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix index f8413b9a0d0f3..9275603bad4c5 100644 --- a/pkgs/tools/text/diffutils/default.nix +++ b/pkgs/tools/text/diffutils/default.nix @@ -8,6 +8,9 @@ stdenv.mkDerivation rec { sha256 = "1761vymxbp4wb5rzjvabhdkskk95pghnn67464byvzb5mfl8jpm2"; }; + outputs = [ "out" "info" ]; + buildInputs = [ stdenv.hookLib.multiout ]; + /* If no explicit coreutils is given, use the one from stdenv. */ nativeBuildInputs = [ coreutils ]; diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index 8866888a73676..432d7b5871204 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -1,5 +1,8 @@ -{ stdenv, fetchurl, libsigsegv, readline, readlineSupport ? false }: +{ stdenv, fetchurl, libsigsegv, readline, interactive ? false }: +let + inherit (stdenv.lib) optional; +in stdenv.mkDerivation rec { name = "gawk-4.1.0"; @@ -8,15 +11,17 @@ stdenv.mkDerivation rec { sha256 = "0hin2hswbbd6kd6i4zzvgciwpl5fba8d2s524z8y5qagyz3x010q"; }; - doCheck = !stdenv.isCygwin; # XXX: `test-dup2' segfaults on Cygwin 6.1 + # When we do build separate interactive version, it makes sense to always include docs. + #outputs = stdenv.lib.optionals (!interactive) [ "out" "doc" ]; #ToDo buildInputs = [ libsigsegv ] - ++ stdenv.lib.optional readlineSupport readline; + ++ optional (!interactive) stdenv.hookLib.multiout + ++ optional interactive readline; configureFlags = [ "--with-libsigsegv-prefix=${libsigsegv}" ] - ++ stdenv.lib.optional readlineSupport "--with-readline=${readline}" - # only darwin where reported, seems OK on non-chrooted Fedora (don't rebuild stdenv) - ++ stdenv.lib.optional (!readlineSupport && stdenv.isDarwin) "--without-readline"; + ++ [(if interactive then "--with-readline=${readline}" else "--without-readline")]; + + doCheck = !stdenv.isCygwin; # XXX: `test-dup2' segfaults on Cygwin 6.1 postInstall = "rm $out/bin/gawk-*"; diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 6e83bd357b271..e2a48085db966 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -10,7 +10,9 @@ stdenv.mkDerivation { sha256 = "1qbjb1l7f9blckc5pqy8jlf6482hpx4awn2acmhyf5mv9wfq03p7"; }; - buildInputs = [ pcre ] + #outputs = [ "out" "doc" ]; ToDo + + buildInputs = [ stdenv.hookLib.multiout pcre ] ++ stdenv.lib.optional (libiconv != null) libiconv; patches = [ ./test-localeconv.patch ]; diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix index b1c5910029dd7..49ff76b85c20c 100644 --- a/pkgs/tools/text/gnused/default.nix +++ b/pkgs/tools/text/gnused/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl}: +{ stdenv, fetchurl }: stdenv.mkDerivation { name = "gnused-4.2.2"; @@ -8,6 +8,9 @@ stdenv.mkDerivation { sha256 = "f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7"; }; + outputs = [ "out" "info" ]; + buildInputs = [ stdenv.hookLib.multiout ]; + meta = { homepage = http://www.gnu.org/software/sed/; description = "GNU sed, a batch stream editor"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1a81b1400f918..92fe64fab65fa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2771,7 +2771,7 @@ let inherit noSysDirs; # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + profiledCompiler = false; #for now. with stdenv; (!isDarwin && (isi686 || isx86_64)); # When building `gcc.crossDrv' (a "Canadian cross", with host == target # and host != build), `cross' must be null but the cross-libc must still |