dwarffortress: update to 51.11, adopt.

This commit is contained in:
Roger Freitas Pereira 2024-12-21 16:42:04 -03:00 committed by Duncan Overbruck
parent 2bf48fb1a6
commit 7aa3de73a5
2 changed files with 48 additions and 29 deletions

View file

@ -1,26 +1,29 @@
#!/bin/sh
## dwarf fortress wrapper written and maintained by
# Robert Stancil <robert.stancil@mavs.uta.edu>
#
#
# MIT License
#
# Copyright (c) 2019 Robert Stancil <robert.stancil@mavs.uta.edu>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# Modified by: Rutpiv <roger_freitas@live.com> in 2024 to adjust symlink
# creation and preserve existing save data by backing up old directories.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
##
@ -48,6 +51,22 @@ if [ -z ${XDG_DATA_HOME:-$HOME/.local/share} ]; then
exit
fi
# Check if an existing 'dwarffortress' directory with the old structure is found.
# If found, create a backup of the directory before removing it.
# The backup is stored as a tar.gz archive with a timestamp to prevent overwriting.
if [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress" ] &&
[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress/df" ]; then
echo "Existing old 'dwarffortress' directory found. Creating a backup..."
timestamp=$(date +%Y%m%d%H%M%S)
backup_file="${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress_backup_${timestamp}.tar.gz"
tar -czf "$backup_file" -C "${XDG_DATA_HOME:-$HOME/.local/share}" dwarffortress
echo "Backup created at $backup_file"
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress"
echo "Old 'dwarffortress' directory removed."
fi
if [ ! -d ${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress ]; then
_FORCE=yes
fi
@ -55,7 +74,10 @@ if [ $_FORCE ]
then
rm -rf ${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress
cp /usr/share/dwarffortress ${XDG_DATA_HOME:-$HOME/.local/share} -r
ln -s /usr/lib/dwarffortress/libs ${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress/
for lib in /usr/lib/dwarffortress/libs/*; do
ln -s "$lib" "${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress/"
done
ln -s /usr/bin/dwarfort ${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress/
fi
${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress/df
${XDG_DATA_HOME:-$HOME/.local/share}/dwarffortress/run_df

View file

@ -1,33 +1,30 @@
# Template file for 'dwarffortress'
pkgname=dwarffortress
version=0.47.05
revision=2
_urlver=${version#*.}
version=51.11
revision=1
_urlver=${version//./_}
archs="x86_64"
depends="gtk+ SDL SDL_ttf SDL_image virtual?libGL glu"
short_desc="Control a dwarven outpost in a randomly generated world"
maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
maintainer="Rutpiv <roger_freitas@live.com>"
license="custom: Proprietary"
homepage="http://www.bay12games.com/dwarves/"
distfiles="http://www.bay12games.com/dwarves/df_${_urlver//./_}_linux.tar.bz2"
checksum=ac74a6dbb7d7d9621f430405080322ab50c35f6632352ff2ea923f6dc5affca3
homepage="https://www.bay12games.com/dwarves/"
distfiles="https://www.bay12games.com/dwarves/df_${_urlver}_linux.tar.bz2"
checksum=e75730205326e5cc126978e3869cf8a52dc3f01e7f32de7e93500bbb517e2567
nostrip_files="Dwarf_Fortress"
nopie="distfiles are precompiled as PIE"
repository=nonfree
noshlibprovides=yes
post_extract() {
rm libs/libstdc++.so.6
rm libs/libgcc_s.so.1
}
do_install() {
vbin ${FILESDIR}/dwarffortress
vbin dwarfort
rm dwarfort
vmkdir /usr/share/dwarffortress
vmkdir /usr/lib/dwarffortress/libs
vcopy "libs/*" /usr/lib/dwarffortress/libs
rm -r libs
vcopy "*" /usr/share/dwarffortress/
vcopy lib* /usr/lib/dwarffortress/libs
rm lib*
vcopy * /usr/share/dwarffortress/
vlicense "readme.txt" dwarffortress.txt
}