WIP: getting good

This commit is contained in:
Vladimír Čunát 2014-08-27 01:14:09 +02:00
parent 4dccb224c5
commit fb59f27a43
31 changed files with 258 additions and 145 deletions

View File

@ -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

View File

@ -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
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 \
--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 \
pkgconfigdir=${!outputDev}/lib/pkgconfig \
m4datadir=${!outputDev}/share/aclocal aclocaldir=${!outputDev}/share/aclocal \
$installFlags"
fi
}
# 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
}

View File

@ -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 = {

View File

@ -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 ];

View File

@ -14,4 +14,4 @@ glibPreFixupPhase() {
addToSearchPath GSETTINGS_SCHEMAS_PATH "$out/share/gsettings-schemas/$name"
}
preFixupPhases="$preFixupPhases glibPreFixupPhase"
preFixupPhases+=(glibPreFixupPhase)

View File

@ -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; }
)

View File

@ -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=

View File

@ -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;

View File

@ -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; {

View File

@ -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)

View File

@ -11,12 +11,12 @@ stdenv.mkDerivation {
sha256 = "0wpk87jnhngcl3nc5i39flkycx1sjzilx8jjx4zc4p8r55ylj19g";
};
buildInputs = [ pkgconfig ];
outputs = [ "dev" "out" "doc" ];
buildInputs = [ stdenv.hookLib.multiout pkgconfig ];
propagatedBuildInputs = [ libogg ];
outputs = [ "dev" "out" "doc" ];
doCheck = true;
meta = with stdenv.lib; {

View File

@ -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:

View File

@ -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 ];

View File

@ -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";

View File

@ -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.)";

View File

@ -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!

View File

@ -1,6 +1,9 @@
{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;
@ -9,14 +12,16 @@ stdenv.mkDerivation (rec {
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 {}))
}

View File

@ -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 = ''
mkdir -p "$dev/share/doc/${name}"
cp ../License "$dev/share/doc/${name}/License"
'';
};
postInstall = passthru.postinst name;
meta = {
description = "Library for working with POSIX capabilities";

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ flex ];
buildInputs = [ cracklib ];
buildInputs = [ stdenv.hookLib.multiout cracklib ];
enableParallelBuilding = true;

View File

@ -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 ;};

View File

@ -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]; };

View File

@ -55,6 +55,10 @@ 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 = {

View File

@ -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";

View File

@ -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/;

View File

@ -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 ];

View File

@ -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 = {

View File

@ -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 ];

View File

@ -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-*";

View File

@ -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 ];

View File

@ -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";

View File

@ -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