vorbis-tools: fix build with clang 16 and on Darwin

* Use iconv on Darwin to eliminate a call to undeclared function
`charset_convert`; and
* Applies a patch to fix a call to undeclared function `utf8_decode`.

+12 -6
+12 -6
pkgs/applications/audio/vorbis-tools/default.nix
··· 1 - { lib, stdenv, fetchurl, libogg, libvorbis, libao, pkg-config, curl 1 + { lib, stdenv, fetchurl, fetchpatch, libogg, libvorbis, libao, pkg-config, curl, libiconv 2 2 , speex, flac 3 3 , autoreconfHook }: 4 4 ··· 11 11 sha256 = "1c7h4ivgfdyygz2hyh6nfibxlkz8kdk868a576qkkjgj5gn78xyv"; 12 12 }; 13 13 14 - nativeBuildInputs = [ autoreconfHook pkg-config ]; 15 - buildInputs = [ libogg libvorbis libao curl speex flac ]; 14 + patches = lib.optionals stdenv.cc.isClang [ 15 + # Fixes a call to undeclared function `utf8_decode`. 16 + # https://github.com/xiph/vorbis-tools/pull/33 17 + (fetchpatch { 18 + url = "https://github.com/xiph/vorbis-tools/commit/8a645f78b45ae7e370c0dc2a52d0f2612aa6110b.patch"; 19 + hash = "sha256-RkT9Xa0pRu/oO9E9qhDa17L0luWgYHI2yINIkPZanmI="; 20 + }) 21 + ]; 16 22 17 - env = lib.optionalAttrs stdenv.cc.isClang { 18 - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; 19 - }; 23 + nativeBuildInputs = [ autoreconfHook pkg-config ]; 24 + buildInputs = [ libogg libvorbis libao curl speex flac ] 25 + ++ lib.optionals stdenv.isDarwin [ libiconv ]; 20 26 21 27 meta = with lib; { 22 28 description = "Extra tools for Ogg-Vorbis audio codec";