From a29034bc486fa9dd7eae95510aafbe04f3c30708 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 23 Nov 2020 18:15:05 +0200 Subject: [PATCH] freeciv: Replace wait-server-start.patch with upstream patch Signed-off-by: Marko Lindqvist --- recipes-games/freeciv/freeciv.inc | 3 +- ...ble-patient-connect-configure-option.patch | 61 +++++++++++++++++++ .../freeciv/freeciv/wait-server-start.patch | 16 ----- 3 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 recipes-games/freeciv/freeciv/0013-Add-enable-patient-connect-configure-option.patch delete mode 100644 recipes-games/freeciv/freeciv/wait-server-start.patch diff --git a/recipes-games/freeciv/freeciv.inc b/recipes-games/freeciv/freeciv.inc index 2f8c568..71f5b24 100644 --- a/recipes-games/freeciv/freeciv.inc +++ b/recipes-games/freeciv/freeciv.inc @@ -16,7 +16,7 @@ DEPENDS = "readline bzip2 curl xz libsdl2-mixer gtk+3 qtbase virtual/gettext qtt SRC_URI = "\ file://allow-root.patch \ -file://wait-server-start.patch \ +file://0013-Add-enable-patient-connect-configure-option.patch \ " S = "${WORKDIR}/freeciv-${PV}" @@ -25,6 +25,7 @@ B = "${WORKDIR}/build-${PV}" inherit autotools pkgconfig gettext qmake5_paths EXTRA_OECONF = "\ +--enable-patient-connect \ --enable-shared --enable-client=${FREECIV_GUI} \ --disable-mapimg \ --disable-sdl2test \ diff --git a/recipes-games/freeciv/freeciv/0013-Add-enable-patient-connect-configure-option.patch b/recipes-games/freeciv/freeciv/0013-Add-enable-patient-connect-configure-option.patch new file mode 100644 index 0000000..65ce3b8 --- /dev/null +++ b/recipes-games/freeciv/freeciv/0013-Add-enable-patient-connect-configure-option.patch @@ -0,0 +1,61 @@ +From d9d5479d1537640ce8cba36fac7464bb55077af1 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Mon, 23 Nov 2020 04:30:04 +0200 +Subject: [PATCH 13/13] Add --enable-patient-connect configure option + +When the option is enabled, client gives spawned server much +more time to get up. This is needed in some underpowered embedded +systems. This option is meant to replace custom patch that +OpenEmbedded meta-games is carrying to increase the time. + +See hrm Feature #899259 + +Signed-off-by: Marko Lindqvist +--- + client/connectdlg_common.c | 7 ++++++- + configure.ac | 10 ++++++++++ + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/client/connectdlg_common.c b/client/connectdlg_common.c +index 2ec9b13861..da0b533ff6 100644 +--- a/client/connectdlg_common.c ++++ b/client/connectdlg_common.c +@@ -64,8 +64,13 @@ Freeciv - Copyright (C) 2004 - The Freeciv Project + #include "connectdlg_common.h" + #include "tilespec.h" + +-#define WAIT_BETWEEN_TRIES 100000 /* usecs */ ++#define WAIT_BETWEEN_TRIES 100000 /* usecs */ ++ ++#ifdef FREECIV_PATIENT_CONNECT ++#define NUMBER_OF_TRIES 10000 ++#else /* FREECIV_PATIENT_CONNECT */ + #define NUMBER_OF_TRIES 500 ++#endif /* FREECIV_PATIENT_CONNECT */ + + #if defined(HAVE_WORKING_FORK) && !defined(WIN32_NATIVE) + /* We are yet to see WIN32_NATIVE setup where even HAVE_WORKING_FORK would +diff --git a/configure.ac b/configure.ac +index 881d9d33cc..87b7d14c62 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -308,6 +308,16 @@ AC_ARG_WITH([appdatadir], + [ APPDATADIR=${withval} ], [ APPDATADIR="\$(prefix)/share/appdata" ]) + AC_SUBST([APPDATADIR]) + ++AC_ARG_ENABLE([patient-connect], ++ AS_HELP_STRING([--enable-patient-connect=yes/no], ++ [enable client to be very patient in connecting spawned server]), ++ [case "${enableval}" in ++ yes) AC_DEFINE([FREECIV_PATIENT_CONNECT], [1], ++ [Client is very patient when connecting to spawned server]) ;; ++ no) ;; ++ *) AC_MSG_ERROR([bad value ${enableval} for --enable-patient-connect]) ;; ++ esac]) ++ + dnl set default values + mapimg_all=auto + mapimg_magickwand=no +-- +2.29.2 + diff --git a/recipes-games/freeciv/freeciv/wait-server-start.patch b/recipes-games/freeciv/freeciv/wait-server-start.patch deleted file mode 100644 index f0ad148..0000000 --- a/recipes-games/freeciv/freeciv/wait-server-start.patch +++ /dev/null @@ -1,16 +0,0 @@ -Give server more time to start - -Signed-off-by: Marko Lindqvist - -diff -Nurd -X.diff_ignore freeciv/client/connectdlg_common.c freeciv/client/connectdlg_common.c ---- freeciv/client/connectdlg_common.c 2016-04-25 15:07:18.840145337 +0300 -+++ freeciv/client/connectdlg_common.c 2016-05-04 09:43:11.524504302 +0300 -@@ -65,7 +65,7 @@ - #include "tilespec.h" - - #define WAIT_BETWEEN_TRIES 100000 /* usecs */ --#define NUMBER_OF_TRIES 500 -+#define NUMBER_OF_TRIES 10000 - - #if defined(HAVE_WORKING_FORK) && !defined(WIN32_NATIVE) - /* We are yet to see WIN32_NATIVE setup where even HAVE_WORKING_FORK would