sox: Fix building on Darwin

Fixes #3493.
This commit is contained in:
Eelco Dolstra 2014-08-08 18:15:54 +02:00
parent c8ea9f749a
commit 7cfb9545c6
2 changed files with 17 additions and 19 deletions

View File

@ -1,13 +1,14 @@
{ stdenv, fetchurl { lib, stdenv, fetchurl
, enableAlsa ? true, alsaLib ? null , enableAlsa ? true, alsaLib ? null
, enableLibao ? true, libao ? null , enableLibao ? true, libao ? null
, enableLame ? false, lame ? null , enableLame ? false, lame ? null
, enableLibmad ? true, libmad ? null , enableLibmad ? true, libmad ? null
, enableLibogg ? true, libogg ? null, libvorbis ? null , enableLibogg ? true, libogg ? null, libvorbis ? null
}: }:
let
inherit (stdenv.lib) optional optionals; with stdenv.lib;
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "sox-14.4.1"; name = "sox-14.4.1";
src = fetchurl { src = fetchurl {
@ -16,21 +17,17 @@ in stdenv.mkDerivation rec {
}; };
buildInputs = buildInputs =
(optional enableAlsa alsaLib) ++ optional (enableAlsa && stdenv.isLinux) alsaLib ++
(optional enableLibao libao) ++ optional enableLibao libao ++
(optional enableLame lame) ++ optional enableLame lame ++
(optional enableLibmad libmad) ++ optional enableLibmad libmad ++
(optionals enableLibogg [ libogg libvorbis ]); optionals enableLibogg [ libogg libvorbis ];
meta = { meta = {
description = "Sample Rate Converter for audio"; description = "Sample Rate Converter for audio";
homepage = http://www.mega-nerd.com/SRC/index.html; homepage = http://www.mega-nerd.com/SRC/index.html;
maintainers = [stdenv.lib.maintainers.marcweber stdenv.lib.maintainers.shlevy]; maintainers = [ lib.maintainers.marcweber lib.maintainers.shlevy ];
# you can choose one of the following licenses: license = lib.licenses.gpl2Plus;
license = [ platforms = lib.platforms.linux ++ lib.platforms.darwin;
"GPL"
# http://www.mega-nerd.com/SRC/libsamplerate-cul.pdf
"libsamplerate Commercial Use License"
];
}; };
} }

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, pulseaudio, alsaLib { lib, stdenv, fetchurl, pkgconfig, pulseaudio, alsaLib
, usePulseAudio }: , usePulseAudio }:
stdenv.mkDerivation { stdenv.mkDerivation {
@ -8,8 +8,9 @@ stdenv.mkDerivation {
sha256 = "1m0v2y6bhr4iwsgdkc7b3y0qgpvpv1ifbxsy8n8ahsvjn6wmppi9"; sha256 = "1m0v2y6bhr4iwsgdkc7b3y0qgpvpv1ifbxsy8n8ahsvjn6wmppi9";
}; };
buildInputs = [ pkgconfig alsaLib ] ++ (if usePulseAudio then [ pulseaudio ] buildInputs =
else [ alsaLib ]); [ pkgconfig ] ++
lib.optional stdenv.isLinux (if usePulseAudio then [ pulseaudio ] else [ alsaLib ]);
meta = { meta = {
longDescription = '' longDescription = ''