2021-11-07 20:29:51 +00:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, stdenv
|
2022-01-25 21:42:24 +00:00
|
|
|
, fetchzip
|
|
|
|
, autoreconfHook
|
|
|
|
, autoconf-archive
|
2021-11-07 20:29:51 +00:00
|
|
|
, pkg-config
|
|
|
|
, CoreAudio
|
|
|
|
, enableAlsa ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, alsa-lib
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableLibao ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, libao
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableLame ? config.sox.enableLame or false
|
2021-11-08 08:57:04 +00:00
|
|
|
, lame
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableLibmad ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, libmad
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableLibogg ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, libogg
|
|
|
|
, libvorbis
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableOpusfile ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, opusfile
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableFLAC ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, flac
|
2021-11-07 20:29:51 +00:00
|
|
|
, enablePNG ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, libpng
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableLibsndfile ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, libsndfile
|
2021-11-07 20:29:51 +00:00
|
|
|
, enableWavpack ? true
|
2021-11-08 08:57:04 +00:00
|
|
|
, wavpack
|
2021-11-07 20:29:51 +00:00
|
|
|
# amrnb and amrwb are unfree, disabled by default
|
|
|
|
, enableAMR ? false
|
2021-11-08 08:57:04 +00:00
|
|
|
, amrnb
|
|
|
|
, amrwb
|
|
|
|
, enableLibpulseaudio ? stdenv.isLinux
|
|
|
|
, libpulseaudio
|
2014-03-24 16:01:20 +00:00
|
|
|
}:
|
2014-08-08 16:15:54 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-11-07 20:29:51 +00:00
|
|
|
pname = "sox";
|
2022-01-25 21:42:24 +00:00
|
|
|
version = "unstable-2021-05-09";
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2022-01-25 21:42:24 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://sourceforge.net/code-snapshots/git/s/so/sox/code.git/sox-code-42b3557e13e0fe01a83465b672d89faddbe65f49.zip";
|
2022-03-11 12:16:02 +00:00
|
|
|
hash = "sha256-9cpOwio69GvzVeDq79BSmJgds9WU5kA/KUlAkHcpN5c=";
|
2010-07-30 14:47:23 +00:00
|
|
|
};
|
|
|
|
|
2022-03-11 12:16:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
autoconf-archive
|
|
|
|
] ++ lib.optional enableOpusfile [
|
2022-01-25 21:42:24 +00:00
|
|
|
# configure.ac uses pkg-config only to locate libopusfile
|
2022-03-11 12:16:02 +00:00
|
|
|
pkg-config
|
|
|
|
];
|
2019-04-29 14:23:39 +00:00
|
|
|
|
2019-06-07 16:01:26 +00:00
|
|
|
patches = [ ./0001-musl-rewind-pipe-workaround.patch ];
|
|
|
|
|
2014-03-24 16:01:20 +00:00
|
|
|
buildInputs =
|
2021-11-08 08:57:04 +00:00
|
|
|
lib.optional (enableAlsa && stdenv.isLinux) alsa-lib
|
|
|
|
++ lib.optional enableLibao libao
|
|
|
|
++ lib.optional enableLame lame
|
|
|
|
++ lib.optional enableLibmad libmad
|
|
|
|
++ lib.optionals enableLibogg [ libogg libvorbis ]
|
|
|
|
++ lib.optional enableOpusfile opusfile
|
|
|
|
++ lib.optional enableFLAC flac
|
|
|
|
++ lib.optional enablePNG libpng
|
|
|
|
++ lib.optional enableLibsndfile libsndfile
|
|
|
|
++ lib.optional enableWavpack wavpack
|
|
|
|
++ lib.optionals enableAMR [ amrnb amrwb ]
|
|
|
|
++ lib.optional enableLibpulseaudio libpulseaudio
|
|
|
|
++ lib.optional stdenv.isDarwin CoreAudio;
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2021-11-08 08:57:04 +00:00
|
|
|
meta = with lib; {
|
2009-03-06 23:21:28 +00:00
|
|
|
description = "Sample Rate Converter for audio";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://sox.sourceforge.net/";
|
2021-11-08 08:57:04 +00:00
|
|
|
maintainers = with maintainers; [ marcweber ];
|
|
|
|
license = if enableAMR then licenses.unfree else licenses.gpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
2007-10-22 00:51:40 +00:00
|
|
|
};
|
2008-12-20 01:20:35 +00:00
|
|
|
}
|