libvisual: disable building examples when cross compiling

the examples depend on SDL, and sdl-config is not available when crossing
This commit is contained in:
Nick Cao 2023-02-14 19:35:00 +08:00
parent 463ab8deaa
commit 11b095e880
No known key found for this signature in database

View file

@ -4,6 +4,8 @@
, SDL , SDL
, glib , glib
, pkg-config , pkg-config
# sdl-config is not available when crossing
, withExamples ? stdenv.buildPlatform == stdenv.hostPlatform
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -16,7 +18,9 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ SDL glib ]; buildInputs = lib.optional withExamples SDL ++ [ glib ];
configureFlags = lib.optional (!withExamples) "--disable-examples";
meta = { meta = {
description = "An abstraction library for audio visualisations"; description = "An abstraction library for audio visualisations";