Ports: Enable SDL support in Angband

This commit is contained in:
Tim Schumacher 2021-10-17 15:44:23 +02:00 committed by Andreas Kling
parent 4e1318fb0e
commit 02446a5431
3 changed files with 106 additions and 1 deletions

View file

@ -5,13 +5,16 @@ workdir="Angband-${version}"
useconfigure=true
files="https://github.com/angband/angband/releases/download/${version}/Angband-${version}.tar.gz Angband-${version}.tar.gz 833c4f8cff2aee61ad015f9346fceaa4a8c739fe2dbe5bd1acd580c91818e6bb"
auth_type=sha256
depends=("ncurses")
depends=("ncurses" "SDL2" "SDL2_image" "SDL2_ttf" "SDL2_mixer")
configopts=(
"--prefix=/usr/local"
"--bindir=/usr/local/bin"
"--disable-x11"
"--enable-curses"
"--enable-sdl2"
"--enable-sdl2-mixer"
"--with-ncurses-prefix=${SERENITY_INSTALL_ROOT}/usr/local"
"--with-sdl2-prefix=${SERENITY_INSTALL_ROOT}/usr/local"
"CFLAGS=--sysroot=${SERENITY_INSTALL_ROOT} -I${SERENITY_INSTALL_ROOT}/usr/local/include/ncursesw"
"LIBS=-lncursesw"
)

View file

@ -0,0 +1,23 @@
diff -ur a/src/main-sdl2.c b/src/main-sdl2.c
--- a/src/main-sdl2.c 2021-08-01 01:29:20.000000000 +0200
+++ b/src/main-sdl2.c 2021-10-31 20:38:37.012720467 +0100
@@ -4863,7 +4863,7 @@
if (window->config == NULL) {
window->renderer = SDL_CreateRenderer(window->window,
- -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
+ -1, SDL_RENDERER_SOFTWARE | SDL_RENDERER_TARGETTEXTURE);
} else {
/* this is necessary for subwindows to have their own textures */
window->config->renderer_flags |= SDL_RENDERER_TARGETTEXTURE;
@@ -5875,9 +5875,7 @@
WINDOW_INIT_OK;
const char *type = parser_getsym(parser, "type");
- if (streq(type, "hardware")) {
- window->config->renderer_flags = SDL_RENDERER_ACCELERATED;
- } else if (streq(type, "software")) {
+ if (streq(type, "software")) {
window->config->renderer_flags = SDL_RENDERER_SOFTWARE;
} else {
return PARSE_ERROR_INVALID_VALUE;

View file

@ -0,0 +1,79 @@
diff -ur a/configure b/configure
--- a/configure 2021-08-01 01:29:22.000000000 +0200
+++ b/configure 2021-10-31 20:28:51.932716113 +0100
@@ -6046,7 +6046,7 @@
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
sdl2_minor_version=`$SDL2_CONFIG $sdl2_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
- sdl2_micro_version=`$SDL2_CONFIG $sdl2_config_args --version | \
+ sdl2_micro_version=`$SDL2_CONFIG $sdl2_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
if test "x$enable_sdl2test" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
@@ -6200,9 +6200,9 @@
else
hold_CPPFLAGS="${CPPFLAGS}"
hold_LIBS="${LIBS}"
- SDL2_CFLAGS=`sdl2-config --cflags`
+ SDL2_CFLAGS=`${SDL2_CONFIG} ${sdl2_args} --cflags`
CPPFLAGS="${CPPFLAGS} ${SDL2_CFLAGS}"
- SDL2_LIBS=`sdl2-config --libs`
+ SDL2_LIBS=`${SDL2_CONFIG} ${sdl2_args} --libs`
LIBS="${LIBS} ${SDL2_LIBS}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMG_LoadPNG_RW in -lSDL2_image" >&5
$as_echo_n "checking for IMG_LoadPNG_RW in -lSDL2_image... " >&6; }
@@ -6389,14 +6389,14 @@
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
- SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
- SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
+ SDL_CFLAGS=`$SDL_CONFIG ${sdl_args} --cflags`
+ SDL_LIBS=`$SDL_CONFIG ${sdl_args} --libs`
- sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
+ sdl_major_version=`$SDL_CONFIG ${sdl_args} --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
- sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
+ sdl_minor_version=`$SDL_CONFIG ${sdl_args} --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
- sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+ sdl_micro_version=`$SDL_CONFIG ${sdl_args} --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
@@ -6550,9 +6550,9 @@
else
hold_CPPFLAGS="${CPPFLAGS}"
hold_LIBS="${LIBS}"
- SDL_CFLAGS=`sdl-config --cflags`
+ SDL_CFLAGS=`${SDL_CONFIG} ${sdl_args} --cflags`
CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}"
- SDL_LIBS=`sdl-config --libs`
+ SDL_LIBS=`${SDL_CONFIG} ${sdl_args} --libs`
LIBS="${LIBS} ${SDL_LIBS}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMG_LoadPNG_RW in -lSDL_image" >&5
$as_echo_n "checking for IMG_LoadPNG_RW in -lSDL_image... " >&6; }
@@ -6674,8 +6674,8 @@
hold_CPPFLAGS="${CPPFLAGS}"
hold_LIBS="${LIBS}"
if test "$with_sdl2" != "yes"; then
- SDL2_CFLAGS=`sdl2-config --cflags`
- SDL2_LIBS=`sdl2-config --libs`
+ SDL2_CFLAGS=`${SDL2_CONFIG} ${sdl2_args} --cflags`
+ SDL2_LIBS=`${SDL2_CONFIG} ${sdl2_args} --libs`
CPPFLAGS="${CPPFLAGS} ${SDL2_CFLAGS}"
LIBS="${LIBS} ${SDL2_LIBS}"
fi
@@ -6741,9 +6741,9 @@
hold_CPPFLAGS="${CPPFLAGS}"
hold_LIBS="${LIBS}"
if test "$with_sdl" != "yes"; then
- SDL_CFLAGS=`sdl-config --cflags`
+ SDL_CFLAGS=`${SDL_CONFIG} ${sdl_args} --cflags`
CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}"
- SDL_LIBS=`sdl-config --libs`
+ SDL_LIBS=`${SDL_CONFIG} ${sdl_args} --libs`
LIBS="${LIBS} ${SDL_LIBS}"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mix_OpenAudio in -lSDL_mixer" >&5