2019-04-29 16:23:39 +02:00
|
|
|
{ config, lib, stdenv, fetchurl, pkgconfig, CoreAudio
|
2014-03-24 17:01:20 +01:00
|
|
|
, enableAlsa ? true, alsaLib ? null
|
|
|
|
, enableLibao ? true, libao ? null
|
2019-02-03 16:33:32 +01:00
|
|
|
, enableLame ? config.sox.enableLame or false, lame ? null
|
2014-03-24 17:01:20 +01:00
|
|
|
, enableLibmad ? true, libmad ? null
|
|
|
|
, enableLibogg ? true, libogg ? null, libvorbis ? null
|
2019-04-29 16:23:39 +02:00
|
|
|
, enableOpusfile ? true, opusfile ? null
|
2014-08-29 19:53:56 +02:00
|
|
|
, enableFLAC ? true, flac ? null
|
|
|
|
, enablePNG ? true, libpng ? null
|
2015-09-12 14:23:30 +02:00
|
|
|
, enableLibsndfile ? true, libsndfile ? null
|
|
|
|
# amrnb and amrwb are unfree, disabled by default
|
|
|
|
, enableAMR ? false, amrnb ? null, amrwb ? null
|
2017-03-24 15:46:16 +01:00
|
|
|
, enableLibpulseaudio ? true, libpulseaudio ? null
|
2014-03-24 17:01:20 +01:00
|
|
|
}:
|
2014-08-08 18:15:54 +02:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-09-12 13:49:41 +02:00
|
|
|
name = "sox-14.4.2";
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2010-07-30 16:47:23 +02:00
|
|
|
src = fetchurl {
|
2014-03-24 17:01:20 +01:00
|
|
|
url = "mirror://sourceforge/sox/${name}.tar.gz";
|
2015-09-12 13:49:41 +02:00
|
|
|
sha256 = "0v2znlxkxxcd3f48hf3dx9pq7i6fdhb62kgj7wv8xggz8f35jpxl";
|
2010-07-30 16:47:23 +02:00
|
|
|
};
|
|
|
|
|
2019-04-29 16:23:39 +02:00
|
|
|
# configure.ac uses pkg-config only to locate libopusfile
|
|
|
|
nativeBuildInputs = optional enableOpusfile pkgconfig;
|
|
|
|
|
2014-03-24 17:01:20 +01:00
|
|
|
buildInputs =
|
2014-08-08 18:15:54 +02:00
|
|
|
optional (enableAlsa && stdenv.isLinux) alsaLib ++
|
|
|
|
optional enableLibao libao ++
|
|
|
|
optional enableLame lame ++
|
|
|
|
optional enableLibmad libmad ++
|
2014-08-29 19:53:56 +02:00
|
|
|
optionals enableLibogg [ libogg libvorbis ] ++
|
2019-04-29 16:23:39 +02:00
|
|
|
optional enableOpusfile opusfile ++
|
2014-08-29 19:53:56 +02:00
|
|
|
optional enableFLAC flac ++
|
2015-09-12 14:23:30 +02:00
|
|
|
optional enablePNG libpng ++
|
|
|
|
optional enableLibsndfile libsndfile ++
|
2017-03-24 15:46:16 +01:00
|
|
|
optionals enableAMR [ amrnb amrwb ] ++
|
2019-03-18 19:17:40 +01:00
|
|
|
optional enableLibpulseaudio libpulseaudio ++
|
|
|
|
optional (stdenv.isDarwin) CoreAudio;
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
meta = {
|
|
|
|
description = "Sample Rate Converter for audio";
|
2015-02-15 09:36:42 +01:00
|
|
|
homepage = http://sox.sourceforge.net/;
|
2015-07-01 14:11:05 +02:00
|
|
|
maintainers = [ lib.maintainers.marcweber ];
|
2015-09-12 14:23:30 +02:00
|
|
|
license = if enableAMR then lib.licenses.unfree else lib.licenses.gpl2Plus;
|
2014-08-08 18:15:54 +02:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2007-10-22 02:51:40 +02:00
|
|
|
};
|
2008-12-20 02:20:35 +01:00
|
|
|
}
|