3
0
Fork 0
forked from mirrors/nixpkgs

Abstract common multiple output handling into a function

This commit is contained in:
Eelco Dolstra 2012-08-23 15:42:22 -04:00
parent fcf88305cc
commit b96ab17658
6 changed files with 50 additions and 62 deletions

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, libogg }:
{ stdenv, fetchurl, multipleOutputs, libogg }:
stdenv.mkDerivation rec {
multipleOutputs rec {
name = "flac-1.2.1";
src = fetchurl {
@ -22,19 +22,6 @@ stdenv.mkDerivation rec {
outputs = [ "dev" "out" "bin" "doc" ];
configureFlags = [ "--bindir=$(bin)/bin" "--includedir=$(dev)/include" "--mandir=$(bin)/share/man" ];
installFlags = [ "pkgconfigdir=$(dev)/lib/pkgconfig m4datadir=$(dev)/share/aclocal" ];
postInstall =
''
if [ -e $out/share/doc ]; then
mkdir -p $doc/share/doc
mv $out/share/doc/* $doc/share/doc
rmdir $out/share/doc
fi
''; # */
meta = {
homepage = http://flac.sourceforge.net;
description = "Library and tools for encoding and decoding the FLAC lossless audio file format";

View file

@ -0,0 +1,39 @@
{ stdenv }:
with stdenv.lib;
{ outputs, ... } @ args:
stdenv.mkDerivation (args // {
configureFlags =
optionals (elem "bin" outputs)
[ "--bindir=$(bin)/bin" "--mandir=$(bin)/share/man" ]
++ optional (elem "dev" outputs)
"--includedir=$(dev)/include";
installFlags =
optionals (elem "dev" outputs)
[ "pkgconfigdir=$(dev)/lib/pkgconfig" "m4datadir=$(dev)/share/aclocal" ];
postInstall =
''
if [ -n "$doc" -a -e $out/share/doc ]; then
mkdir -p $doc/share/doc
mv $out/share/doc/* $doc/share/doc
rmdir $out/share/doc
rmdir --ignore-fail-on-non-empty $out/share
fi
if [ -n "$dev" ]; then
mkdir -p "$dev/nix-support"
if [ -n "$propagatedBuildInputs" ]; then
echo "$propagatedBuildInputs" > "$dev/nix-support/propagated-build-inputs"
propagatedBuildInputs=
fi
echo "$propagatedBuildNativeInputs $out" > "$dev/nix-support/propagated-build-native-inputs"
propagatedBuildNativeInputs=
fi
''; # */
})

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, xz }:
{ stdenv, fetchurl, multipleOutputs, xz }:
stdenv.mkDerivation rec {
multipleOutputs rec {
name = "libogg-1.3.0";
src = fetchurl {
@ -12,19 +12,6 @@ stdenv.mkDerivation rec {
outputs = [ "dev" "doc" "out" ];
configureFlags = [ "--includedir=$(dev)/include" ];
installFlags = [ "pkgconfigdir=$(dev)/lib/pkgconfig" ];
postInstall =
''
mkdir -p $doc/share/doc
mv $out/share/doc/* $doc/share/doc
mkdir -p $dev/nix-support
echo $out > $dev/nix-support/propagated-build-native-inputs
''; # */
meta = {
homepage = http://xiph.org/ogg/;
};

View file

@ -1,6 +1,6 @@
{stdenv, fetchurl, flac, libogg, libvorbis, pkgconfig }:
{ stdenv, fetchurl, multipleOutputs, flac, libogg, libvorbis, pkgconfig }:
stdenv.mkDerivation rec {
multipleOutputs rec {
name = "libsndfile-1.0.23";
src = fetchurl {
@ -8,25 +8,12 @@ stdenv.mkDerivation rec {
sha256 = "0k9x4804gfh9d9zd4rm1v2izm8l716rzk4d6jlrjcf45b5sw7jal";
};
buildInputs = [pkgconfig flac libogg libvorbis];
buildInputs = [ pkgconfig flac libogg libvorbis ];
enableParallelBuilding = true;
outputs = [ "dev" "out" "bin" "doc" ];
configureFlags = [ "--bindir=$(bin)/bin" "--includedir=$(dev)/include" "--mandir=$(bin)/share/man" ];
installFlags = [ "pkgconfigdir=$(dev)/lib/pkgconfig m4datadir=$(dev)/share/aclocal" ];
postInstall =
''
if [ -e $out/share/doc ]; then
mkdir -p $doc/share/doc
mv $out/share/doc/* $doc/share/doc
rmdir $out/share/doc
fi
''; # */
meta = {
description = "Libsndfile, a C library for reading and writing files containing sampled sound";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, libogg, xz }:
{ stdenv, fetchurl, multipleOutputs, libogg, xz }:
stdenv.mkDerivation rec {
multipleOutputs rec {
name = "libvorbis-1.3.3";
src = fetchurl {
@ -13,20 +13,6 @@ stdenv.mkDerivation rec {
outputs = [ "dev" "out" "doc" ];
configureFlags = [ "--includedir=$(dev)/include" ];
installFlags = [ "pkgconfigdir=$(dev)/lib/pkgconfig" ];
postInstall =
''
mkdir -p $doc/share/doc
mv $out/share/doc/* $doc/share/doc
mkdir -p "$dev/nix-support"
echo "$propagatedBuildNativeInputs $out" > "$dev/nix-support/propagated-build-native-inputs"
propagatedBuildNativeInputs=
''; # */
meta = {
homepage = http://xiph.org/vorbis/;
};

View file

@ -327,6 +327,8 @@ let
inherit stdenv perl cpio contents ubootChooser;
};
multipleOutputs = import ../build-support/multiple-outputs.nix { inherit (pkgs) stdenv; };
makeWrapper = makeSetupHook {} ../build-support/make-wrapper/make-wrapper.sh;
makeModulesClosure = {kernel, rootModules, allowMissing ? false}: