Unverified Commit 3e2fd0eb authored by Marcin Serwin's avatar Marcin Serwin
Browse files

SDL2_image: add option to build without STB backend

parent e98c99a4
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
  stdenv,
  zlib,
  # Boolean flags
  enableSTB ? true,
  ## Darwin headless will hang when trying to run the SDL test program
  enableSdltest ? (!stdenv.hostPlatform.isDarwin),
}:
@@ -36,16 +37,20 @@ stdenv.mkDerivation (finalAttrs: {
    pkg-config
  ];

  buildInputs = [
  buildInputs =
    [
      SDL2
      giflib
      libXpm
    libjpeg
    libpng
      libtiff
      libwebp
      zlib
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ];
    ]
    ++ lib.optionals (!enableSTB) [
      libjpeg
      libpng
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ];

  configureFlags =
    [
@@ -54,6 +59,7 @@ stdenv.mkDerivation (finalAttrs: {
      (lib.enableFeature false "png-shared")
      (lib.enableFeature false "tif-shared")
      (lib.enableFeature false "webp-shared")
      (lib.enableFeature enableSTB "stb-image")
      (lib.enableFeature enableSdltest "sdltest")
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [