allegro5: support building with SDL

stock allegro5 does not support Wayland. the experimental SDL backend is
one way to enable native Wayland support for allegro applications.

see:
- <https://github.com/liballeg/allegro5/blob/master/README_sdl.txt>
- <https://github.com/liballeg/allegro5/blob/master/CMakeLists.txt#L64>

Colin 71b0d9ef f9e5b7b3

Changed files
+14 -1
pkgs
development
libraries
allegro
+14 -1
pkgs/development/libraries/allegro/5.nix
···
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";
···
libXxf86misc
libXxf86vm
xorgproto
+
]
+
++ lib.optionals useSDL [
+
sdl2-compat
];
postPatch = ''
···
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"