summaryrefslogtreecommitdiff
path: root/Ports/angband
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2021-10-17 15:44:23 +0200
committerAndreas Kling <kling@serenityos.org>2021-11-01 11:34:25 +0100
commit02446a5431fb4943b14296dc751a446310bb72d6 (patch)
tree81c2fbebccc0307f08bad1a56e1edf3921ce2a35 /Ports/angband
parent4e1318fb0e0c0af448296d9cd4fcacdd824cfb60 (diff)
downloadserenity-02446a5431fb4943b14296dc751a446310bb72d6.zip
Ports: Enable SDL support in Angband
Diffstat (limited to 'Ports/angband')
-rwxr-xr-xPorts/angband/package.sh5
-rw-r--r--Ports/angband/patches/disable-accelerated-rendering.patch23
-rw-r--r--Ports/angband/patches/use-sdl2-config.patch79
3 files changed, 106 insertions, 1 deletions
diff --git a/Ports/angband/package.sh b/Ports/angband/package.sh
index 699a721c4e..b8f4f73f15 100755
--- a/Ports/angband/package.sh
+++ b/Ports/angband/package.sh
@@ -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"
)
diff --git a/Ports/angband/patches/disable-accelerated-rendering.patch b/Ports/angband/patches/disable-accelerated-rendering.patch
new file mode 100644
index 0000000000..889dd4988d
--- /dev/null
+++ b/Ports/angband/patches/disable-accelerated-rendering.patch
@@ -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;
diff --git a/Ports/angband/patches/use-sdl2-config.patch b/Ports/angband/patches/use-sdl2-config.patch
new file mode 100644
index 0000000000..a43962429d
--- /dev/null
+++ b/Ports/angband/patches/use-sdl2-config.patch
@@ -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