summaryrefslogtreecommitdiff
path: root/Ports/freeciv/patches
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-04 23:20:55 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-05 10:56:37 +0200
commitaec941b46cd9f38690f4e7d9368a300d17776820 (patch)
tree273bb4208fc79b4a774b38b3f59ae2597d952caf /Ports/freeciv/patches
parent4cd45f5875e0145ca858c60c891de3aab3fa46cd (diff)
downloadserenity-aec941b46cd9f38690f4e7d9368a300d17776820.zip
Ports: Add port for freeciv
Diffstat (limited to 'Ports/freeciv/patches')
-rw-r--r--Ports/freeciv/patches/configure.patch12
-rw-r--r--Ports/freeciv/patches/log.patch41
2 files changed, 53 insertions, 0 deletions
diff --git a/Ports/freeciv/patches/configure.patch b/Ports/freeciv/patches/configure.patch
new file mode 100644
index 0000000000..04bf7c4989
--- /dev/null
+++ b/Ports/freeciv/patches/configure.patch
@@ -0,0 +1,12 @@
+diff -Naur freeciv-3.0.0-beta2/bootstrap/config.sub freeciv-3.0.0-beta2.serenity/bootstrap/config.sub
+--- freeciv-3.0.0-beta2/bootstrap/config.sub 2021-05-14 12:38:07.000000000 +0200
++++ freeciv-3.0.0-beta2.serenity/bootstrap/config.sub 2021-06-04 23:07:31.952596066 +0200
+@@ -1363,7 +1363,7 @@
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
++ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* | -serenity* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
diff --git a/Ports/freeciv/patches/log.patch b/Ports/freeciv/patches/log.patch
new file mode 100644
index 0000000000..7498018fd1
--- /dev/null
+++ b/Ports/freeciv/patches/log.patch
@@ -0,0 +1,41 @@
+diff -Naur freeciv-3.0.0-beta2/client/connectdlg_common.c freeciv-3.0.0-beta2.serenity/client/connectdlg_common.c
+--- freeciv-3.0.0-beta2/client/connectdlg_common.c 2021-05-14 12:36:45.000000000 +0200
++++ freeciv-3.0.0-beta2.serenity/client/connectdlg_common.c 2021-06-05 00:22:43.151395241 +0200
+@@ -302,6 +302,7 @@
+ char dbg_lvl_buf[32]; /* Do not move this inside the block where it gets filled,
+ * it's needed via the argv[x] pointer later on, so must
+ * remain in scope. */
++ bool log_to_dev_null = FALSE;
+
+ /* Set up the command-line parameters. */
+ fc_snprintf(port_buf, sizeof(port_buf), "%d", internal_server_port);
+@@ -376,16 +377,21 @@
+ fclose(stdout);
+ fclose(stderr);
+
+- /* FIXME: include the port to avoid duplication? */
+- if (logfile) {
++ if (!logfile) {
++ log_to_dev_null = TRUE;
++ fd = open("/dev/null", O_WRONLY);
++ } else {
++ /* FIXME: include the port to avoid duplication? */
+ fd = open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0644);
++ }
+
+- if (fd != 1) {
+- dup2(fd, 1);
+- }
+- if (fd != 2) {
+- dup2(fd, 2);
+- }
++ if (fd != 1) {
++ dup2(fd, 1);
++ }
++ if (fd != 2) {
++ dup2(fd, 2);
++ }
++ if (!log_to_dev_null) {
+ fchmod(1, 0644);
+ }
+