Unverified Commit 30fa23bf authored by 7c6f434c's avatar 7c6f434c Committed by GitHub
Browse files

allegro5: support building with SDL (#429173)

parents 918d1e75 71b0d9ef
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -35,8 +35,13 @@
  texinfo,
  xorgproto,
  zlib,
  # https://github.com/liballeg/allegro5/blob/master/README_sdl.txt
  useSDL ? false,
  sdl2-compat ? null,
}:

assert useSDL -> sdl2-compat != null;

stdenv.mkDerivation rec {
  pname = "allegro";
  version = "5.2.10.1";
@@ -89,6 +94,9 @@ stdenv.mkDerivation rec {
    libXxf86misc
    libXxf86vm
    xorgproto
  ]
  ++ lib.optionals useSDL [
    sdl2-compat
  ];

  postPatch = ''
@@ -97,7 +105,12 @@ stdenv.mkDerivation rec {
    sed -e 's@OpenAL/@AL/@g' -i addons/audio/openal.c
  '';

  cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ];
  cmakeFlags = [
    "-DCMAKE_SKIP_RPATH=ON"
  ]
  ++ lib.optionals useSDL [
    "ALLEGRO_SDL=ON"
  ];

  outputs = [
    "out"