commit: ba3b4d77139a67e2866f60cfb87f68b5f2e3302c Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> AuthorDate: Sun Jul 20 07:50:46 2025 +0000 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> CommitDate: Sun Jul 20 08:14:42 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba3b4d77
games-roguelike/dwarf-fortress: Version bump to 51.13, now binary-only Upstream still ships the source code for the graphical component, but it has frequently been unusable or has at least required heavy patching. We are no longer interested in trying to fix code that is so blatantly broken. There is little need to build this from source when the rest is proprietary anyway. The game writes its save data among the rest of the game files. This was previously worked around using copies and symlinks, but this was messy, and went against upstream's advice of not extracting newer versions over the top of older versions. We now set up an overlay with bubblewrap instead. The user data directory has moved from ~/.dwarf-fortress to ~/.local/share/dwarf-fortress. No old save data is migrated because version 50.01 broke compatibility anyway. 32-bit x86 is no longer supported by upstream. Closes: https://bugs.gentoo.org/702918 Closes: https://bugs.gentoo.org/739328 Closes: https://bugs.gentoo.org/831875 Closes: https://bugs.gentoo.org/906145 Closes: https://bugs.gentoo.org/937581 Closes: https://bugs.gentoo.org/952854 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> games-roguelike/dwarf-fortress/Manifest | 1 + .../dwarf-fortress/dwarf-fortress-51.13.ebuild | 62 ++++++++++++++++++++++ .../dwarf-fortress/files/dwarf-fortress | 25 ++------- 3 files changed, 68 insertions(+), 20 deletions(-) diff --git a/games-roguelike/dwarf-fortress/Manifest b/games-roguelike/dwarf-fortress/Manifest index 84e82c2074f3..500fbef65999 100644 --- a/games-roguelike/dwarf-fortress/Manifest +++ b/games-roguelike/dwarf-fortress/Manifest @@ -1,3 +1,4 @@ DIST df_47_05_linux.tar.bz2 12725420 BLAKE2B 80987f05de2db2796a53cc8767ee7aa5c78674dff725efc0dafe07dc4118e56c7814cbf92507fe9b76a385e182405c7d6759cb6bcc942385110df1dc1a3b3af4 SHA512 9ea46fa12a80266cd09363f1aea8cdd059a5ebeefb453c4a46ffbb1115486409003c3caca95a1b6010da4040d04b781182c59e57a6cc033cd7de4507299f7534 DIST df_47_05_linux32.tar.bz2 13487455 BLAKE2B be604dd2fd480c5609da801013dfdae26964760c0a92c4b3d2d8369800eee7ca9c1b1c2313cc67357feee3c6d425bf7f9f67cab53d2e771ab59055bc4c3329d0 SHA512 e9b9cf6995c24b403347159a35cfe4b57603bdb777c78639beb2799d9bf31317edec54fb92b17dbb90df6001b905d43285a35e9446768d12a746492b2fd34fe7 +DIST df_51_13_linux.tar.bz2 17651148 BLAKE2B 002dfccfa18cc7d2304d9862821b7f1cdb38c0b936fb14c4b05d6b08f4b2f27c81b33934daa0ba4c61dbcd4b36c2d835373042cd6ccdad21a6813040b2b63f5b SHA512 e198fe28e009db9e65c99e7c14c15ec3c36620c7ddd6a6ed10c6baec72f5f52b55f275668a2aad976a3085aba7ea668f3b463ae687cd1a9a6343a85cf757b2ef DIST dwarf-fortress.png 271 BLAKE2B cbc14917de1556b25d3817298215beedc4cb01075b8454e38b2d314bdf22f8c20c4bf2332f0d731c7e4c6d6a60056361565221ce3db2c7a15fdf934bff01df54 SHA512 08bdc0e084f861b6e6a8b12e3bc93b9703f2a4cbc133d62d1c2931daf81ccd70b728853d5c05bed19a1ef477cf4ad10fce263bbab7d9cad3b60658f17063acf6 diff --git a/games-roguelike/dwarf-fortress/dwarf-fortress-51.13.ebuild b/games-roguelike/dwarf-fortress/dwarf-fortress-51.13.ebuild new file mode 100644 index 000000000000..9dfffc2c148d --- /dev/null +++ b/games-roguelike/dwarf-fortress/dwarf-fortress-51.13.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit desktop prefix xdg + +MY_P="df_${PV//./_}" + +DESCRIPTION="Single-player fantasy game" +HOMEPAGE="https://www.bay12games.com/dwarves/" +SRC_URI="https://www.bay12games.com/dwarves/${MY_P}_linux.tar.bz2 + https://dev.gentoo.org/~ionen/distfiles/${PN}.png" +S="${WORKDIR}" + +LICENSE="free-noncomm BSD BitstreamVera" +SLOT="0" +KEYWORDS="-* ~amd64" + +RDEPEND=" + media-libs/libsdl2[joystick,opengl,video] + media-libs/sdl2-image[png] + sys-apps/bubblewrap +" + +BDEPEND=" + dev-util/patchelf +" + +DIR="/opt/${PN}" +QA_PREBUILT="${DIR#/}/*" + +src_compile() { + patchelf --set-rpath "${EPREFIX}${DIR}" dwarfort *.so* || die +} + +src_install() { + insinto "${DIR}" + exeinto "${DIR}" + + doins -r data/ + # libsdl_mixer_plugin.so seems unused. It is referenced in + # music_and_sound.cpp but not in any binaries. + doexe dwarfort libfmod_plugin.so libfmod.so.* libg_src_lib.so + + dobin "$(prefixify_ro "${FILESDIR}"/dwarf-fortress)" + + doicon -s 128 "${DISTDIR}"/${PN}.png + make_desktop_entry dwarf-fortress "Dwarf Fortress" + + dodoc *.txt +} + +pkg_postinst() { + xdg_pkg_postinst + + local pv + for pv in ${REPLACING_VERSIONS}; do + # Check https://dwarffortresswiki.org/Release_information when bumping. + ver_test ${pv%%.*} -lt 50.01 && ewarn "Save data from ${pv} is not compatible with this new major version." + done +} diff --git a/games-roguelike/dwarf-fortress/files/dwarf-fortress b/games-roguelike/dwarf-fortress/files/dwarf-fortress index 23b9c348754c..d81d4475ea15 100644 --- a/games-roguelike/dwarf-fortress/files/dwarf-fortress +++ b/games-roguelike/dwarf-fortress/files/dwarf-fortress @@ -1,24 +1,9 @@ #!/bin/sh -gamesdir=/opt/dwarf-fortress -install="$HOME/.dwarf-fortress" +set -eu -do_install() { - cp -rn "$gamesdir"/data "$install"/ - # DF gets unhappy when this is out of sync - cp -f "$gamesdir"/data/index "$install"/data/ - cp -rsn "$gamesdir"/* "$install"/ -} +srcdir="/opt/dwarf-fortress" +dstdir="${XDG_DATA_HOME:-${HOME}/.local/share}/dwarf-fortress" -if [ -d "$install" ]; then - # delete dangling symlinks - find -L "$install/" -type l -delete - # ignore "are the same file" errors - do_install 2>/dev/null -else - mkdir "$install" || exit - do_install || exit -fi - -cd "$install" || exit -exec ./libs/Dwarf_Fortress "$@" +mkdir -p "${dstdir}/upperdir" "${dstdir}/workdir" +exec bwrap --bind / / --dev-bind /dev /dev --overlay-src "${srcdir}" --overlay "${dstdir}/upperdir" "${dstdir}/workdir" "${dstdir}/upperdir" --chdir "${dstdir}/upperdir" -- ./dwarfort "${@}"
