From b50b3ac36257169c7cfb48f5a3557c126a543bcc Mon Sep 17 00:00:00 2001 From: Roger Freitas Pereira Date: Sat, 21 Dec 2024 16:42:04 -0300 Subject: [PATCH 1/2] dwarffortress: update to 51.02, adopt. --- srcpkgs/dwarffortress/files/dwarffortress | 50 ++++++++++++++++------- srcpkgs/dwarffortress/template | 27 ++++++------ 2 files changed, 48 insertions(+), 29 deletions(-) diff --git a/srcpkgs/dwarffortress/files/dwarffortress b/srcpkgs/dwarffortress/files/dwarffortress index e40fc75e3cec01..3d0992ede4e433 100644 --- a/srcpkgs/dwarffortress/files/dwarffortress +++ b/srcpkgs/dwarffortress/files/dwarffortress @@ -1,26 +1,29 @@ #!/bin/sh ## dwarf fortress wrapper written and maintained by # Robert Stancil -# +# # MIT License # # Copyright (c) 2019 Robert Stancil # -# 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 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 diff --git a/srcpkgs/dwarffortress/template b/srcpkgs/dwarffortress/template index 423e050f257817..37db843512ab10 100644 --- a/srcpkgs/dwarffortress/template +++ b/srcpkgs/dwarffortress/template @@ -1,33 +1,30 @@ # Template file for 'dwarffortress' pkgname=dwarffortress -version=0.47.05 -revision=2 -_urlver=${version#*.} +version=51.02 +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 " +maintainer="Rutpiv " 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=beab7a987ea2857da2aecee7ac2deccf6ab2ffaa3d229eee062758567ecdc3a7 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 } From e580ce5a2581d56422b5f1501ecd7a2d5d09b1d8 Mon Sep 17 00:00:00 2001 From: Roger Freitas Pereira Date: Sat, 21 Dec 2024 20:53:34 -0300 Subject: [PATCH 2/2] Dwarf-Therapist: update to 42.1.9, adopt. --- srcpkgs/Dwarf-Therapist/template | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/srcpkgs/Dwarf-Therapist/template b/srcpkgs/Dwarf-Therapist/template index fd3eb5925f08b9..502ffd12418286 100644 --- a/srcpkgs/Dwarf-Therapist/template +++ b/srcpkgs/Dwarf-Therapist/template @@ -1,16 +1,21 @@ # Template file for 'Dwarf-Therapist' pkgname=Dwarf-Therapist -version=41.2.1 +version=42.1.9 revision=1 build_style=cmake makedepends="qt5-declarative-devel libcap-devel hicolor-icon-theme" depends="dwarffortress" short_desc="Management tool designed to run side-by-side with Dwarf Fortress" -maintainer="Robert Stancil " +maintainer="Rutpiv " license="GPL-3.0-or-later" homepage="https://github.com/Dwarf-Therapist/Dwarf-Therapist/" distfiles="https://github.com/Dwarf-Therapist/Dwarf-Therapist/archive/v${version}.tar.gz" -checksum=ec954daff6e03d9d44153ed3df90685de3a7a07431fd47639d83b2f5b3f62e4b +checksum=c591a434b722e1d0f862e21780fcd1a9ed81b3819d4961e6ecebe1d287859a7e + +post_build() { + vsed -i dist/xdg/applications/dwarftherapist.desktop \ + -e 's|^Exec=dwarftherapist$|Exec=ptrace_cap_wrapper dwarftherapist|' +} post_install() { vbin dist/ptrace_scope/patch_df_ptracer