13 , enableLame ? config.sox.enableLame or false
20 , enableOpusfile ? true
26 , enableLibsndfile ? true
28 , enableWavpack ? true
30 # amrnb and amrwb are unfree, disabled by default
34 , enableLibpulseaudio ? stdenv.hostPlatform.isLinux && lib.meta.availableOn stdenv.hostPlatform libpulseaudio
38 stdenv.mkDerivation rec {
40 version = "unstable-2021-05-09";
43 # not really needed, but when this src was updated from `fetchurl ->
44 # fetchgit`, we spared the mass rebuild by changing this `name` and
45 # therefor merge this to `master` and not to `staging`.
47 url = "https://git.code.sf.net/p/sox/code";
48 rev = "42b3557e13e0fe01a83465b672d89faddbe65f49";
49 hash = "sha256-9cpOwio69GvzVeDq79BSmJgds9WU5kA/KUlAkHcpN5c=";
65 patches = [ ./0001-musl-rewind-pipe-workaround.patch ];
68 lib.optional (enableAlsa && stdenv.hostPlatform.isLinux) alsa-lib
69 ++ lib.optional enableLibao libao
70 ++ lib.optional enableLame lame
71 ++ lib.optional enableLibmad libmad
72 ++ lib.optionals enableLibogg [ libogg libvorbis ]
73 ++ lib.optional enableOpusfile opusfile
74 ++ lib.optional enableFLAC flac
75 ++ lib.optional enablePNG libpng
76 ++ lib.optional enableLibsndfile libsndfile
77 ++ lib.optional enableWavpack wavpack
78 ++ lib.optionals enableAMR [ amrnb amrwb ]
79 ++ lib.optional enableLibpulseaudio libpulseaudio
80 ++ lib.optional stdenv.hostPlatform.isDarwin CoreAudio;
82 enableParallelBuilding = true;
85 description = "Sample Rate Converter for audio";
86 homepage = "https://sox.sourceforge.net/";
87 maintainers = with maintainers; [ marcweber ];
88 license = if enableAMR then licenses.unfree else licenses.gpl2Plus;
89 platforms = platforms.unix;