From b08c058249ebea7fe8e9838a242efb892e101c65 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Fri, 31 Oct 2025 21:00:04 +0800 Subject: [PATCH] vgmstream: fix build on darwin --- pkgs/by-name/vg/vgmstream/package.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/vg/vgmstream/package.nix b/pkgs/by-name/vg/vgmstream/package.nix index d17e6585ecc8..6342295917e8 100644 --- a/pkgs/by-name/vg/vgmstream/package.nix +++ b/pkgs/by-name/vg/vgmstream/package.nix @@ -13,8 +13,14 @@ libao, speex, nix-update-script, + + audaciousSupport ? stdenv.hostPlatform.isLinux, }: +assert lib.assertMsg ( + audaciousSupport -> stdenv.hostPlatform.isLinux +) "Only Linux supports building the Audacious plugin."; + let # https://github.com/vgmstream/vgmstream/blob/1b6a7915bf98ca14a71a0d44bef7a2c6a75c686d/cmake/dependencies/atrac9.cmake atrac9-src = fetchFromGitHub { @@ -54,10 +60,7 @@ stdenv.mkDerivation rec { ]; }; - outputs = [ - "out" - "audacious" - ]; + outputs = [ "out" ] ++ lib.optional audaciousSupport "audacious"; nativeBuildInputs = [ cmake @@ -71,8 +74,8 @@ stdenv.mkDerivation rec { libvorbis libao speex - audacious-bare - ]; + ] + ++ lib.optional audaciousSupport audacious-bare; preConfigure = '' substituteInPlace cmake/dependencies/audacious.cmake \ @@ -89,6 +92,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DATRAC9_PATH=${atrac9-src}" + (lib.cmakeBool "BUILD_AUDACIOUS" audaciousSupport) ] # Only supported on x86_64-linux ++ lib.optionals (stdenv.system == "x86_64-linux") [