diff options
author | B. Watson <yalhcru@gmail.com> | 2021-10-17 17:10:53 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-29 17:07:15 +0700 |
commit | 5eb6ce46c5980e63f9888af21be1abe18714d75e (patch) | |
tree | 1aae1285f24c6b5ccda68a88344011c84e545c52 /games/ufoai | |
parent | 7ad090fd48be0c12e4ea59a4e92c1f6f13286a0d (diff) |
games/ufoai: Fix -current build.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/ufoai')
29 files changed, 669 insertions, 45 deletions
diff --git a/games/ufoai/README b/games/ufoai/README index 192f4d18fc8e..59e931a6b9f6 100644 --- a/games/ufoai/README +++ b/games/ufoai/README @@ -1,4 +1,4 @@ -UFO: Alien Invasion +ufoai (UFO: Alien Invasion) This is a squad based tactical strategy game, heavily inspired by the X-COM PC games, but with twist. Old veterans will appreciate how the @@ -9,13 +9,19 @@ is not a remake or a sequel. It runs on a modified Quake 2 game engine. -If you want to try out the game editor (uforadiant), install gtksourceview -before running this build. +If you're going to install the package on a host whose CPU lacks +streaming SIMD extensions, set SSE=no in the script's environment. To +find out whether SSE is supported, try "grep sse /proc/cpuinfo". If +you get no output, you don't have SSE. -If you're going to install the package on a host whose CPU lacks streaming -SIMD extensions, set SSE=no in the script's environment. To find out -whether SSE is supported, try "grep sse /proc/cpuinfo". If you get no -output, you don't have SSE. +By default, ufoai is built with SDL2. If you'd prefer SDL1, run this +script with SDL2=no in the environment. -By default, ufoai is built with SDL1. If you'd prefer SDL2, install -SDL2 and SDL2_ttf, then run this script with SDL2=yes in the environment. +Optional *broken* stuff: The map editor for UFO:AI is called +uforadiant. It's disabled by default because it's broken: it +segfaults on startup on Slackware-current (October 2021) and the +SlackBuild maintainer hasn't figured out why, yet. If you want +to try uforadiant, install the optional dependencies gtkglext and +gtksourceview, then build with RADIANT=yes in the environment. If you +try this and uforadiant *doesn't* segfault for you, *please* contact +the maintainer! diff --git a/games/ufoai/icons/ufo/16.png b/games/ufoai/icons/ufo/16.png Binary files differnew file mode 100644 index 000000000000..4dac684395fc --- /dev/null +++ b/games/ufoai/icons/ufo/16.png diff --git a/games/ufoai/icons/ufo/256.png b/games/ufoai/icons/ufo/256.png Binary files differnew file mode 100644 index 000000000000..6841287ee7fc --- /dev/null +++ b/games/ufoai/icons/ufo/256.png diff --git a/games/ufoai/icons/ufo/32.png b/games/ufoai/icons/ufo/32.png Binary files differnew file mode 100644 index 000000000000..661da0327587 --- /dev/null +++ b/games/ufoai/icons/ufo/32.png diff --git a/games/ufoai/icons/ufo/48.png b/games/ufoai/icons/ufo/48.png Binary files differnew file mode 100644 index 000000000000..abf22852525a --- /dev/null +++ b/games/ufoai/icons/ufo/48.png diff --git a/games/ufoai/icons/ufo/64.png b/games/ufoai/icons/ufo/64.png Binary files differnew file mode 100644 index 000000000000..f923ef7ec7ac --- /dev/null +++ b/games/ufoai/icons/ufo/64.png diff --git a/games/ufoai/icons/ufoded/16.png b/games/ufoai/icons/ufoded/16.png Binary files differnew file mode 100644 index 000000000000..1739be7e18bc --- /dev/null +++ b/games/ufoai/icons/ufoded/16.png diff --git a/games/ufoai/icons/ufoded/256.png b/games/ufoai/icons/ufoded/256.png Binary files differnew file mode 100644 index 000000000000..5e318a9f0135 --- /dev/null +++ b/games/ufoai/icons/ufoded/256.png diff --git a/games/ufoai/icons/ufoded/32.png b/games/ufoai/icons/ufoded/32.png Binary files differnew file mode 100644 index 000000000000..7e4b45e2a87b --- /dev/null +++ b/games/ufoai/icons/ufoded/32.png diff --git a/games/ufoai/icons/ufoded/48.png b/games/ufoai/icons/ufoded/48.png Binary files differnew file mode 100644 index 000000000000..ebd83a0c052c --- /dev/null +++ b/games/ufoai/icons/ufoded/48.png diff --git a/games/ufoai/icons/ufoded/64.png b/games/ufoai/icons/ufoded/64.png Binary files differnew file mode 100644 index 000000000000..67a5d63988a9 --- /dev/null +++ b/games/ufoai/icons/ufoded/64.png diff --git a/games/ufoai/icons/uforadiant/16.png b/games/ufoai/icons/uforadiant/16.png Binary files differnew file mode 100644 index 000000000000..da67002fc4ab --- /dev/null +++ b/games/ufoai/icons/uforadiant/16.png diff --git a/games/ufoai/icons/uforadiant/32.png b/games/ufoai/icons/uforadiant/32.png Binary files differnew file mode 100644 index 000000000000..7b9ba7abc1e7 --- /dev/null +++ b/games/ufoai/icons/uforadiant/32.png diff --git a/games/ufoai/icons/uforadiant/48.png b/games/ufoai/icons/uforadiant/48.png Binary files differnew file mode 100644 index 000000000000..8cb95c15f560 --- /dev/null +++ b/games/ufoai/icons/uforadiant/48.png diff --git a/games/ufoai/icons/uforadiant/64.png b/games/ufoai/icons/uforadiant/64.png Binary files differnew file mode 100644 index 000000000000..c761edef8e64 --- /dev/null +++ b/games/ufoai/icons/uforadiant/64.png diff --git a/games/ufoai/man/ufo.6 b/games/ufoai/man/ufo.6 new file mode 100644 index 000000000000..8002578ef792 --- /dev/null +++ b/games/ufoai/man/ufo.6 @@ -0,0 +1,51 @@ +.\" This man page was written by Markus Koschany in August 2013. It is provided +.\" under the GNU General Public License 2 or (at your option) any later version. +.TH ufo 6 "October 2021" "ufoai-2.5" "SlackBuilds.org" +.SH NAME +ufo \- UFO: Alien Invasion client +.SH SYNOPSIS +.PP +\fBufo\fR [\fB+<internal command> \fIoption\fR \fIvalue\fP] ... +.SH DESCRIPTION +\fBufo\fP is the client for the strategy game UFO: Alien Invasion (\fBufoai\fR). +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Display this help +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Disable console output +.TP +\fB+<internal command>\fR +Options passed by "+<internal command>" are the same as the in-game console understands. For the in-game console press SHIFT+ESC. +Use the in-game \fBcvarlist\fR to get a list of all available options for the game. +.SS Internal commands +.TP +\fBsnd\_init\fR +Set this to 0 to start without sound\&. +.TP +\fBvid\_fullscreen\fR +Set this to 1 to start in fullscreen mode\&. + +.SH "FILES" +All data files are part of a pk3 file in \fI/usr/share/games/ufoai/base/\fR. You can extract them (pk3 files are just zip files) +and place them in the home directory of the user running the game. Use the path \fI~/.ufoai/<VERSION>/base/\fR to place +these files. The files that are not located in the pk3 files have a higher priority than the files that are stored in the pk3 +files. So you are able to replace any file you want like this. You can also add new maps and other game content to the \fIbase/\fR +directory in your users home directory to be able to use new game content. +.TP +\fB~/.ufoai/<VERSION>/base/config.cfg\fR +Game configuration\&. +.TP +\fBkeys.cfg\fR +Game key bindings\&. +.SH EXAMPLES +.TP +\fBufo +snd_init 0 +vid_fullscreen 1\fR +Start ufo without sound and in fullscreen mode. +.SH "SEE ALSO" +.PP +\fBufoded\fR(6) +\fBufo2map\fR(6) +\fBufomodel\fR(6) +\fBufoslicer\fR(6) diff --git a/games/ufoai/man/ufo2map.6 b/games/ufoai/man/ufo2map.6 new file mode 100644 index 000000000000..21380c32f36c --- /dev/null +++ b/games/ufoai/man/ufo2map.6 @@ -0,0 +1,188 @@ +.\" This man page was written by Markus Koschany in July 2013. It is provided +.\" under the GNU General Public License 2 or (at your option) any later version. +.TH ufo2map "6" "October 2021" "ufoai-2.5" "SlackBuilds.org" +.SH NAME +ufo2map \- UFO: Alien Invasion map compiler +.SH SYNOPSIS +.B ufo2map +\fI<param1 <subparam1> <subparam2> <\fR...\fI>> <param2> <\fR...\fI> \fR[\fImap\fR] +.SH DESCRIPTION +This is the UFO: AI map compiler. +.SH OPTIONS +.SS "General options:" +.TP +\fB\-h\fR \fB\-\-help\fR +: print (this) help and exit +.TP +\fB\-nice\fR <prio> +: priority level [unix nice level from \fB\-20\fR to 19 where 19 is the lowest priority] +.TP +\fB\-nofootstep\fR +: don't generate a footstep file +.TP +\fB\-tracefile\fR +: generate two csv files describing the floors and walls found by the trace functions +.TP +\fB\-debugfile\fR (TODO) +: generate a trace debug file. The client can load the file to highlight map obstructions +.TP +\fB\-stats\fR \fB\-\-statistics\fR +: print statistics and quit. may be used with \fB\-check\fR or \fB\-fix\fR +.TP +\fB\-v\fR \fB\-\-verbosity\fR <int> +: set verbosity. higher <int> gives more output +if it is required, this should be the first option +0 \- no stdout, 1 \- only check/fix messages, 2 \- (compile) only mapname +2 \- (check/fix) mapname if findings, 4 \- normal output, +5 \- extra output, 6 \- dump (a lot extra from BSPing) +.TP +\fB\-V\fR \fB\-\-version\fR +: return Version and Revision level +.TP +\fB\-material\fR +: generate a material (.mat) file, do not proceed to compilation +.SS "Lighting options:" +.TP +\fB\-extra\fR +: extra light samples +.TP +\fB\-nolighting\fR TYPE +: don't perform the lighting calculations, where TYPE is one of day, night, all +default is all +.TP +\fB\-quant\fR +: lightquant \- lightmap resolution downscale (e.g. 4 = 1 << 4) (values between 1 and 6) +.TP +\fB\-scale\fR +: global light scale factor +.TP +\fB\-saturation\fR +: saturation factor (e.g. 1.5 \- default is 1.0) +.TP +\fB\-contrast\fR +: contrast factor (e.g. 1.05, default is 1.0) +.TP +\fB\-t\fR \fB\-\-threads\fR +: thread amount +.SS "Binary space partitioning (BSPing) options:" +.TP +\fB\-block\fR <xl> <yl> +: +.HP +\fB\-blocks\fR <xl> <yl> <xh> <yh>: +.TP +\fB\-subdivide\fR +: subdivide brushes for better light effects (but higher polycount) +.TP +\fB\-surface\fR +: surface light scaling (float value) +.TP +\fB\-entity\fR +: entity light scaling (float value) +.TP +\fB\-fulldetail\fR +: don't treat details (and trans surfaces) as details +.TP +\fB\-info\fR +: print bsp file info +.TP +\fB\-micro\fR <float> +: warn if a brush has a volume lower than the specified float. +brushes are tested after CSG. +.TP +\fB\-nobackclip\fR +: draw downward pointing faces. (so actors cannot see up through floors +in first person view). default is to set SURF_NODRAW to downard faces. +.TP +\fB\-nocsg\fR +: +.TP +\fB\-gamedir\fR +: Add another game dir to the search directories +.TP +\fB\-nodetail\fR +: skip detail brushes +.TP +\fB\-nomerge\fR +: skip node face merging +.TP +\fB\-noprune\fR +: don't prune (or cut) nodes +.TP +\fB\-noshare\fR +: +.TP +\fB\-notjunc\fR +: +.TP +\fB\-nowater\fR +: skip water brushes in compilation +.TP +\fB\-noweld\fR +: +.TP +\fB\-onlyents\fR +: modify existing bsp file with entities from map file +.TP +\fB\-exportlightmaps\fR +: write lightmaps into tga images +.TP +\fB\-verboseentities\fR +: also be verbose about submodels (entities) +.PP +.SS Mapping options: +.IP +These options operate on map file only. No bsp file is created. +Output prefixed by an asterisk (*) indicates operations that would change the map file. +\fB\-check\fR : check source map, only print information. +\fB\-fix\fR : same subparameters as \fB\-check\fR, changes the source map file. +.IP +subparameters for \fB\-check\fR and \fB\-fix\fR +.TP +all +: performs all checks and fixes. This is the default. +.TP +bru brushes +: includes 'lvl tex mfc mbr'. Performs all checks and fixes associated with brushes. +.TP +ent entities +: performs all checks and fixes associated with entities. +.TP +con contained +: checks for brushes contained entirely within other brushes. includes coincident duplicates. +.TP +isc intersection +: report intersection between optimisable brushes from worldspawn and func_group entities +.IP +this is not included in all or bru as it is not always a bad thing +.TP +mbr microbrush <float> +: test for brushes smaller than <float> unit^3. this is done without the csg +.IP +step, unlike the bsp \fB\-micro\fR option. default 1 unit^3. +.TP +lvl levelflags +: if no levelflags for a brush or entity are set, all of them are set +.TP +flv filllevelflags +: ensure set levelflag bits are uninterrupted +.TP +ndr nodraws +: assigns SURF_NODRAW to hidden faces +.TP +tex textures +: warns when no texture or error texture is assigned. +.IP +ensures special textures and content/surface flags are consistent. +.TP +mfc mixedfacecontents +: ensures the contentflags are the same on each face of each brush. +.TP +zft zfighting +: intersecting brushes with a common face: prevent textures shimmering together +.SH "SEE ALSO" +.PP +\fBufo\fR(6) +\fBufoded\fR(6) +\fBufomodel\fR(6) +\fBufoslicer\fR(6) diff --git a/games/ufoai/man/ufoded.6 b/games/ufoai/man/ufoded.6 new file mode 100644 index 000000000000..2a5389b4e7b0 --- /dev/null +++ b/games/ufoai/man/ufoded.6 @@ -0,0 +1,42 @@ +.\" This man page was written by Markus Koschany in August 2013. It is provided +.\" under the GNU General Public License 2 or (at your option) any later version. +.TH ufoded 6 "October 2021" "ufoai-2.5" "SlackBuilds.org" +.SH NAME +ufoded \- UFO: Alien Invasion dedicated server +.SH SYNOPSIS +.PP +\fBufoded\fR [\fB+<internal command> \fIoption\fR \fIvalue\fP] ... +.SH DESCRIPTION +\fBufoded\fP is the dedicated server for the strategy game UFO: Alien Invasion. +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Display this help +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Disable console output +.TP +\fB+<internal command>\fR +Options passed by "+<internal command>" are the same as the in-game console understands. For the in-game console press SHIFT+ESC. +Use the in-game \fBcvarlist\fR to get a list of all available options for the game. +.SH "FILES" +All these files are part of a pk3 file in \fI/usr/share/games/ufoai/base/\fR. You can extract them (pk3 files are just zip files) +and place them in the home directory of the user running the dedicated server. Use the path \fI~/.ufoai/<VERSION>/base/\fR to place +these files. The files that are not located in the pk3 files have a higher priority than the files that are stored in the pk3 +files. So you are able to replace any file you want like this. You can also add new maps and other game content to the \fIbase/\fR +directory in your users home directory to be able to use new content in the game. +.TP +\fBdedicated.cfg\fR +Dedicated server config\&. +.TP +\fBautoexec.cfg\fR +Commands that are executed when starting the dedicated server\&. +.TP +\fBmapcycle.txt\fR +This defines the map cycle that the dedicated server will use\&. +.SH SEE ALSO +.PP +\fBufo\fR(6) +\fBufo2map\fR(6) +\fBufomodel\fR(6) +\fBufoslicer\fR(6) diff --git a/games/ufoai/man/ufomodel.6 b/games/ufoai/man/ufomodel.6 new file mode 100644 index 000000000000..88011e411d62 --- /dev/null +++ b/games/ufoai/man/ufomodel.6 @@ -0,0 +1,50 @@ +.\" This man page was written by Markus Koschany in July 2013. It is provided +.\" under the GNU General Public License 2 or (at your option) any later version. +.TH ufomodel "6" "October 2021" "ufoai-2.5" "SlackBuilds.org" +.SH NAME +ufomodel \- optimizer for model files +.SH DESCRIPTION +UFO: Alien invasion developer tool to modify and optimize model files. +.SH OPTIONS +.TP +\fB\-mdx\fR +generate mdx files +.TP +\fB\-skinfix\fR +fix skins for md2 models +.TP +\fB\-glcmds\fR +remove the unused glcmds from md2 models +.TP +\fB\-check\fR +perform general checks for all the models +.TP +\fB\-skinedit\fR <filename> +edit skin of a model +.TP +\fB\-skinnum\fR <filename> +edit the skin numbers of a model +.TP +\fB\-info\fR <filename> +show model information +.TP +\fB\-overwrite\fR +overwrite existing mdx files +.TP +\fB\-s\fR <float> +sets the smoothness value for normal\-smoothing (in the range \fB\-1\fR.0 to 1.0) +.TP +\fB\-f\fR <filename> +build tangentspace for the specified model file +.TP +\fB\-v\fR \fB\-\-verbose\fR +print debug messages +.TP +\fB\-h\fR \fB\-\-help\fR +show this help screen +.SH "SEE ALSO" +.PP +\fBufo\fR(6) +\fBufoded\fR(6) +\fBufo2map\fR(6) +\fBufoslicer\fR(6) diff --git a/games/ufoai/man/uforadiant.6 b/games/ufoai/man/uforadiant.6 new file mode 100644 index 000000000000..7ddc3977e057 --- /dev/null +++ b/games/ufoai/man/uforadiant.6 @@ -0,0 +1,49 @@ +.TH UFORADIANT 6 "October 2021" "ufoai-2.5" "SlackBuilds.org" +.SH NAME +uforadiant \- UFO: Alien Invasion Mapeditor + +.SH SYNOPSIS +.PP +\fBuforadiant\fR + +.SH DESCRIPTION +This manual page documents briefly the +.B uforadiant +command. +.PP +\fBuforadiant\fP is the map editor for the strategy game UFO: Alien Invasion. + +.SH OPTIONS +.PP +Options are passed to the gtk init function. + +.SH "FILES" +.TP +\fB~/.ufoai/radiant/settings.xml\fR +Editor configuration\&. +.TP +\fB~/.ufoai/radiant/shortcuts.ini\fR +Key bindings\&. +.TP +\fBbase/ufos/entities.ufo\fR +This file is included in the 0ufos.pk3 in your system wide UFO:AI installation directory and defines the entities the editor can add to maps\&. + +.SH "SEE ALSO" +.PP +\fBufo\fR(6) + +.SH AUTHOR +\fBuforadiant\fP was written by the UFO: Alien Invasion team and based on the GPLed release of GtkRadiant 1.5 by id Software. +.PP +This manual page was written by Florian Ludwig <dino@phidev.org>, +for the Debian project (but may be used by others). It was +modified slightly by B. Watson <yalhcru@gmail.com> for the SlackBuilds.org +project. + +.SH "SEE ALSO" +.PP +\fBufo\fR(6) +\fBufoded\fR(6) +\fBufo2map\fR(6) +\fBufomodel\fR(6) +\fBufoslicer\fR(6) diff --git a/games/ufoai/man/ufoslicer.6 b/games/ufoai/man/ufoslicer.6 new file mode 100644 index 000000000000..95b34efcbd7b --- /dev/null +++ b/games/ufoai/man/ufoslicer.6 @@ -0,0 +1,40 @@ +.\" This man page was written by Markus Koschany in July 2013. It is provided +.\" under the GNU General Public License 2 or (at your option) any later version. +.TH ufoslicer "6" "October 2021" "ufoai-2.5" "SlackBuilds.org" +.SH NAME +ufoslicer \- an UFO:AI map slicer +.SH SYNOPSIS +.B ufoslicer +\fI\-t N \-s N \-c \-m bspfile\fR +.SH DESCRIPTION +.TP +UFO Alien Invasion developer tool to slice map files. +.SH OPTIONS +.TP +\fB\-t\fR N += use slice thickness of N units. +.TP +\fB\-s\fR N += use scale factor of N. +.TP +\fB\-c\fR += create a single contour map. +.TP +\fB\-m\fR += create multiple contour maps. +.HP +\fB\-h\fR|\-\-help = show this help screen. +.PP +.SH EXAMPLES +ufoslicer \fB\-t\fR 64 \fB\-s\fR 8 maps/farm +.PP +The above command would slice the map "farm.bsp", moving by 64 units between slices and +would create a 1/8th scale bitmap file. +.PP +The default for \fB\-t\fR is 64 units. +.SH "SEE ALSO" +.PP +\fBufo\fR(6) +\fBufoded\fR(6) +\fBufo2map\fR(6) +\fBufomodel\fR(6) diff --git a/games/ufoai/mkicons.sh b/games/ufoai/mkicons.sh new file mode 100644 index 000000000000..a0c886f91a64 --- /dev/null +++ b/games/ufoai/mkicons.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# create PNG icons for ufoai. +# requires icoutils and perl-rename from SBo. +# this is a support script, not to be run from within the SlackBuild. +# please do not remove this from git! + +SRC=${TMP:-/tmp}/SBo/ufoai-${VERSION:-2.5} + +mkdir -p icons +cd icons +for i in $SRC/build/projects/*.ico; do + name="$( basename $i .ico )" + mkdir -p $name + ( cd $name + icotool -x $i + rename.pl 's,.*_(\d+)x.*,$1.png,' * + ) +done + +# upstream doesn't ship 64x64 icons, let's make them. +convert -resize 64x64 ufo/256.png ufo/64.png +convert -resize 64x64 ufoded/256.png ufoded/64.png + +# the radiant icon is tiny, make a better one. +mkdir -p uforadiant +composite radiant/32.png ufo/64.png -geometry +16+28 uforadiant/64.png +convert -resize 48x48 uforadiant/64.png uforadiant/48.png +convert -resize 32x32 uforadiant/64.png uforadiant/32.png +convert -resize 16x16 uforadiant/64.png uforadiant/16.png +rm -rf radiant diff --git a/games/ufoai/patches/bug-949301-mxml.patch b/games/ufoai/patches/bug-949301-mxml.patch new file mode 100644 index 000000000000..678a0b8e3bee --- /dev/null +++ b/games/ufoai/patches/bug-949301-mxml.patch @@ -0,0 +1,29 @@ +From: Markus Koschany <apo@debian.org> +Date: Mon, 17 Feb 2020 22:49:06 +0100 +Subject: bug 949301 mxml + +Bug-Debian: https://bugs.debian.org/949301 +Origin: https://sourceforge.net/p/ufoai/code/ci/163073ab9527cdaa33d77a713b8e46ff462a2b5c/ +--- + src/common/xml.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/common/xml.cpp b/src/common/xml.cpp +index 1629c90..8323752 100644 +--- a/src/common/xml.cpp ++++ b/src/common/xml.cpp +@@ -519,8 +519,13 @@ static mxml_type_t mxml_ufo_type_cb (xmlNode_t* node) + /* You can lookup attributes and/or use the + * element name, hierarchy, etc... */ + const char* type = mxmlElementGetAttr(node, "type"); +- if (type == nullptr) ++ if (type == nullptr) { ++#ifdef MXML_MAJOR_VERSION ++ type = mxmlGetElement(node); ++#else + type = node->value.element.name; ++#endif ++ } + + if (!strcmp(type, "int")) + return MXML_INTEGER; diff --git a/games/ufoai/patches/initialize-entityString.patch b/games/ufoai/patches/initialize-entityString.patch new file mode 100644 index 000000000000..cdbf9e52bd96 --- /dev/null +++ b/games/ufoai/patches/initialize-entityString.patch @@ -0,0 +1,26 @@ +From: Markus Koschany <apo@debian.org> +Date: Tue, 25 Apr 2017 14:31:16 +0200 +Subject: initialize entityString + +Initialize entityString to avoid that ufo2map will randomly segfault when +compiling the maps. + +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860680 +Forwarded: https://sourceforge.net/p/ufoai/code/ci/bae827ba025ff1d3a56b402c27aa84401914acc4/ +--- + src/tools/ufo2map/map.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tools/ufo2map/map.cpp b/src/tools/ufo2map/map.cpp +index 47c49f3..f56c55e 100644 +--- a/src/tools/ufo2map/map.cpp ++++ b/src/tools/ufo2map/map.cpp +@@ -1227,7 +1227,7 @@ void LoadMapFile (const char* filename) + /* Set the number of tiles to 1. This is fix for ufo2map right now. */ + mapTiles.numTiles = 1; + +- char entityString[MAX_TOKEN_CHARS]; ++ char entityString[MAX_TOKEN_CHARS] = ""; + const char* ump = GetUMPName(filename); + if (ump != nullptr) + ParseUMP(ump, entityString, false); diff --git a/games/ufoai/patches/segfault-reactionfire-mode-bug-861979.patch b/games/ufoai/patches/segfault-reactionfire-mode-bug-861979.patch new file mode 100644 index 000000000000..d8575fe169dc --- /dev/null +++ b/games/ufoai/patches/segfault-reactionfire-mode-bug-861979.patch @@ -0,0 +1,36 @@ +From: Markus Koschany <apo@debian.org> +Date: Sun, 7 May 2017 18:46:50 +0200 +Subject: segfault reactionfire mode bug 861979 + +Forwarded: http://ufoai.org/forum/index.php/topic,9111.0.html +Origin: https://sourceforge.net/p/ufoai/code/ci/9cad041f0931b1f49e0c70f32e351a7227f0d2ff/ +--- + src/game/inv_shared.cpp | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/src/game/inv_shared.cpp b/src/game/inv_shared.cpp +index 708e708..e5a73a5 100644 +--- a/src/game/inv_shared.cpp ++++ b/src/game/inv_shared.cpp +@@ -633,9 +633,6 @@ const fireDef_t* Item::getSlowestFireDef () const + */ + const objDef_t* Item::getReactionFireWeaponType () const + { +- if (!this) +- return nullptr; +- + if (def()) { + const fireDef_t* fd = getFiredefs(); + if (fd && fd->reaction) +@@ -999,9 +996,9 @@ Item* Inventory::findInContainer (const containerIndex_t contId, const Item* con + */ + bool Inventory::holdsReactionFireWeapon () const + { +- if (getRightHandContainer()->getReactionFireWeaponType()) ++ if (getRightHandContainer() != nullptr && getRightHandContainer()->getReactionFireWeaponType()) + return true; +- if (getLeftHandContainer()->getReactionFireWeaponType()) ++ if (getLeftHandContainer() != nullptr && getLeftHandContainer()->getReactionFireWeaponType()) + return true; + return false; + } diff --git a/games/ufoai/patches/series b/games/ufoai/patches/series new file mode 100644 index 000000000000..345b9b459ea0 --- /dev/null +++ b/games/ufoai/patches/series @@ -0,0 +1,3 @@ +initialize-entityString.patch +segfault-reactionfire-mode-bug-861979.patch +bug-949301-mxml.patch diff --git a/games/ufoai/slack-desc b/games/ufoai/slack-desc index ed917bb4df34..e77f8f03dd71 100644 --- a/games/ufoai/slack-desc +++ b/games/ufoai/slack-desc @@ -14,6 +14,6 @@ ufoai: game captures the spirit of the UFO: Enemy Unknown, the first one in ufoai: the X-COM series. It tries to combine military realism with science ufoai: fiction with the weirdness of an alien invasion. The game, however, ufoai: is not a remake or a sequel. -ufoai: It runs on a modified Quake 2 game engine. ufoai: -ufoai: Homepage: http://ufoai.org +ufoai: This package @INCLUDES@ uforadiant, the map editor. +ufoai: This package was built with SDL @SDLVER@. diff --git a/games/ufoai/ufoai.SlackBuild b/games/ufoai/ufoai.SlackBuild index b1d5861f1078..1a3ceef558bd 100644 --- a/games/ufoai/ufoai.SlackBuild +++ b/games/ufoai/ufoai.SlackBuild @@ -2,7 +2,8 @@ # Slackware build script for ufoai -# Written by Joze Zobec <jozze.zepl@gmail.com> +# Written by Joze Zobec <email removed> +# Now maintained by B. Watson <yalhcru@gmail.com> # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -15,8 +16,22 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# 20170706 bkw: -# - fix build on -current +# 20211017 bkw: BUILD=3 +# - fix build on -current again: +# - disable building with BFD. +# - -std=c++11 +# - new-style icons. +# - make .desktop files validate. +# - get rid of useless 'memory' binary. +# - document missing optional dep, gtkglext. +# - patches from Debian that (hopefully) prevent segfaults. +# - make the game default to running in a window, as there are +# issues with fullscreen on -current with (at least) intel video. +# - disable uforadiant by default, it segfaults on startup and +# I haven't figured out why yet. +# - slack-desc reflects builds options (sdl 1/2, uforadiant). + +# 20170706 bkw: fix build on -current # 20151126 bkw: # - fix build on systems that have SDL2 but not SDL2_ttf @@ -36,7 +51,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=ufoai VERSION=${VERSION:-2.5} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -48,9 +63,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -74,12 +86,14 @@ else LIBDIRSUFFIX="" fi -# If gtksourceview is available build the radiant editor -if pkg-config --exists gtksourceview-2.0 ; then - radiant="--enable-uforadiant" -else - radiant="--disable-uforadiant" -fi +# If gtksourceview and gtkglext are installed and RADIANT=yes, build +# the uforadiant editor. +radiant="--disable-uforadiant" + +[ "${RADIANT:-no}" = "yes" ] && \ + pkg-config --exists gtksourceview-2.0 && \ + pkg-config --exists gtkglext-1.0 && \ + radiant="--enable-uforadiant" if [ "${SSE:-yes}" = "no" ]; then sseopt="--disable-sse" @@ -98,16 +112,35 @@ mv $PRGNAM-$VERSION-source $PRGNAM-$VERSION cd $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION-data.tar chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ # 20170706 bkw: fix build with gcc7 echo 'CXXFLAGS += -Wno-narrowing' >> build/flags.mk -[ "${SDL2:-no}" = "no" ] && EXTRAOPT="--disable-sdl2" +# 20211017 bkw: apply patches from Debian's build 6. +for i in $( cat $CWD/patches/series ); do + patch -p1 < $CWD/patches/$i +done + +# 20211017 bkw: change the default from fullscreen to windowed. This +# is helpful because on my hardware, at least, the game crashes when +# it tries to to fullscreen... and takes the whole X server with it. +# This is just the default; users can switch to fullscreen from +# within the game if they want. +sed -i '/"vid_fullscreen"/s,"1","0",' src/client/cl_video.cpp + +# 20211017 bkw: bfd gratuitous API changes. This disables bfd, which +# means the game can't print a backtrace if it crashes. Since we +# install the binaries stripped, the backtrace wouldn't have been +# all that useful anyway. +sed -i '/check_header.*bfd\.h/d' configure + +# 20211017 bkw: it ignores environment CXXFLAGS, and we need this, so: +echo 'CXXFLAGS += -std=c++11' >> build/flags.mk + +# 20211017 bkw: leave this here, but default to yes. +[ "${SDL2:-yes}" = "no" ] && EXTRAOPT="--disable-sdl2" CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -117,51 +150,91 @@ CXXFLAGS="$SLKCFLAGS" \ --datadir=/usr/share/games/$PRGNAM \ --enable-release \ $sseopt \ - --enable-memory \ + --disable-memory \ + --disable-testall \ --enable-ufo \ --enable-ufoded \ --enable-ufoslicer \ $EXTRAOPT \ $radiant -make +# Normally it's "make V=1" for verbose build, but here it's different. +make Q='' make lang -make maps -make pk3 -BINARIES= +# We get "make: nothing to be done for..." for these 2. +# make maps +# make pk3 # Manual install: first the data... mkdir -p $PKG/usr/share/games/$PRGNAM $PKG/usr/games cp -a base $PKG/usr/share/games/$PRGNAM/ # ...then the binaries -if [ "$radiant" = "--enable-uforadiant" ]; then +if [ -x radiant/uforadiant ]; then cp -a radiant $PKG/usr/share/games/$PRGNAM/ rm -f $PKG/usr/share/games/$PRGNAM/radiant/uforadiant BINARIES="radiant/uforadiant" fi -BINARIES="$BINARIES ufo ufoded ufo2map ufomodel memory ufoslicer" +BINARIES="$BINARIES ufo ufoded ufo2map ufomodel ufoslicer" install -s -m0755 $BINARIES $PKG/usr/games/ -# .desktop files, icons and man pages... +# 20211017 bkw: make the .desktop files validate +sed -i -e 's,Application;,,' \ + -e '/^Encoding/d' \ + -e '/^Icon/s,\.xpm,,' \ + debian/*.desktop +sed -i '/^StartupNotify=false/d' debian/uforadiant.desktop + +# .desktop files, old-style icons mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps $PKG/usr/man/man6 install -m 0644 debian/*.desktop $PKG/usr/share/applications/ install -m 0644 debian/*.xpm $PKG/usr/share/pixmaps/ -install -m 0644 debian/*.6 $PKG/usr/man/man6/ + +# man pages taken from more recent debian (ufoai_2.5-6.debian.tar.xz) and +# modified for this SlackBuild. For one thing, I made them all section 6. +install -m 0644 $CWD/man/*.6 $PKG/usr/man/man6/ gzip $PKG/usr/man/man6/*.6 +ln -s ufo.6.gz $PKG/usr/man/man6/$PRGNAM.6.gz + +# new-style icons, created by mkicons.sh, q.v. +for i in $CWD/icons/*; do + app="$( basename $i )" + if [ -e $PKG/usr/games/$app ]; then + for png in $CWD/icons/$app/*.png; do + px="$( basename "$png" .png )" + size=${px}x${px} + dir=$PKG/usr/share/icons/hicolor/$size/apps + mkdir -p $dir + cat $png > $dir/$app.png + done + fi +done # Get rid of uforadiant stuff if we don't have uforadiant -[ "$radiant" = "" ] && rm $PKG/usr/share/applications/uforadiant.desktop \ - $PKG/usr/man/man6/uforadiant.6.gz $PKG/usr/share/pixmaps/uforadiant.xpm +if [ -x radiant/uforadiant ]; then + INCLUDES="includes" + # This looks like it doesn't belong + rm -f $PKG/usr/share/games/$PRGNAM/radiant/prefabs/pipes.map +else + INCLUDES="does NOT include" + rm $PKG/usr/share/applications/uforadiant.desktop \ + $PKG/usr/man/man6/uforadiant.6.gz \ + $PKG/usr/share/pixmaps/uforadiant.xpm +fi + +SDLVER="1.2" +ldd $PKG/usr/games/ufo | grep -q SDL2 && SDLVER="2.0" mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a LICENSES README COPYING $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install -cat $CWD/slack-desc > $PKG/install/slack-desc +sed -e "s,@INCLUDES@,$INCLUDES," \ + -e "s,@SDLVER@,$SDLVER," \ + $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG diff --git a/games/ufoai/ufoai.info b/games/ufoai/ufoai.info index 8ae4ce4f2468..27468ac4be1b 100644 --- a/games/ufoai/ufoai.info +++ b/games/ufoai/ufoai.info @@ -1,8 +1,8 @@ PRGNAM="ufoai" VERSION="2.5" -HOMEPAGE="http://ufoai.org" -DOWNLOAD="http://downloads.sourceforge.net/ufoai/ufoai-2.5-source.tar.bz2 \ - http://downloads.sourceforge.net/ufoai/ufoai-2.5-data.tar" +HOMEPAGE="https://ufoai.org" +DOWNLOAD="https://downloads.sourceforge.net/ufoai/ufoai-2.5-source.tar.bz2 \ + https://downloads.sourceforge.net/ufoai/ufoai-2.5-data.tar" MD5SUM="01d13816e674ed87f5343366783f2697 \ 2389eb26ed2c189008fd4586a0f5e067" DOWNLOAD_x86_64="" |