Ports: Add port for freeciv

This commit is contained in:
Gunnar Beutner 2021-06-04 23:20:55 +02:00 committed by Andreas Kling
parent 4cd45f5875
commit aec941b46c
4 changed files with 62 additions and 0 deletions

View file

@ -29,6 +29,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`flatbuffers`](flatbuffers/) | Flatbuffers | 1.12.0 | https://github.com/google/flatbuffers |
| [`flex`](flex/) | flex | 2.6.4 | https://github.com/westes/flex |
| [`ffmpeg`](ffmpeg/) | ffmpeg | 4.4 | https://ffmpeg.org |
| [`freeciv`](freeciv/) | Freeciv | 3.0.0-beta2 | http://freeciv.org/ |
| [`freetype`](freetype/) | FreeType | 2.10.4 | https://www.freetype.org/ |
| [`frotz`](frotz/) | Frotz | 2.53 | https://gitlab.com/DavidGriffith/frotz |
| [`gcc`](gcc/) | GNU Compiler Collection | 11.1.0 | https://gcc.gnu.org/ |

8
Ports/freeciv/package.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=freeciv
version=3.0.0-beta2
useconfigure=true
configopts="--enable-client=sdl2 --enable-fcmp=no"
files="http://files.freeciv.org/beta/freeciv-${version}.tar.xz freeciv-${version}.tar.xz 9f44dc28068b239c18bda68192ddb27622030880f8ab9c17f777eac28391269e"
auth_type=sha256
depends="SDL2 SDL2_image SDL2_mixer SDL2_ttf zstd libicu xz gettext"

View file

@ -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* \

View file

@ -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);
}