diff --git a/pkgs/applications/misc/xsw/default.nix b/pkgs/applications/misc/xsw/default.nix index 57ea8fe19218..b3a57e1cef21 100644 --- a/pkgs/applications/misc/xsw/default.nix +++ b/pkgs/applications/misc/xsw/default.nix @@ -1,6 +1,9 @@ -{ stdenv, fetchFromGitHub, pkgconfig, autoconf, automake, SDL, SDL_image, SDL_ttf, SDL_gfx, flex, bison }: +{ stdenv, lib, fetchFromGitHub, pkgconfig, SDL, SDL_image, SDL_ttf, SDL_gfx, flex, bison }: -stdenv.mkDerivation rec { +let + makeSDLFlags = map (p: "-I${lib.getDev p}/include/SDL"); + +in stdenv.mkDerivation rec { name = "xsw-${version}"; version = "0.1.2"; @@ -11,7 +14,11 @@ stdenv.mkDerivation rec { sha256 = "092vp61ngd2vscsvyisi7dv6qrk5m1i81gg19hyfl5qvjq5p0p8g"; }; - buildInputs = [ pkgconfig autoconf automake SDL SDL_image SDL_ttf SDL_gfx flex bison ]; + nativeBuildInputs = [ SDL SDL_image SDL_ttf SDL_gfx flex bison ]; + + buildInputs = [ pkgconfig ]; + + NIX_CFLAGS_COMPILE = makeSDLFlags [ SDL SDL_image SDL_ttf SDL_gfx ]; patches = [ ./parse.patch # Fixes compilation error by avoiding redundant definitions.