From 759534e55227af4b4dbb298237b9e1f9ea646768 Mon Sep 17 00:00:00 2001 From: Vitaly Zdanevich Date: Fri, 14 Mar 2025 00:18:51 +0400 Subject: [PATCH] games-roguelike/tsl: new package [Migrated](https://github.com/leycec/raiagent/tree/master/games-roguelike/tsl) from the repo that will be [archived soon](https://github.com/leycec/raiagent/issues/117). The official website was unavailable - so I found the code in another place https://archive.org/details/ArchiveRL.7z and put it into my repo. I have two warnings, what to do with them? > * QA Notice: Files built without respecting CFLAGS have been detected > * Please include the following list of files in your report: > * /usr/bin/tsl-tty > * QA Notice: Files built without respecting LDFLAGS have been detected > * Please include the following list of files in your report: > * /usr/bin/tsl-tty Tried to add to ::guru but they do not like that upstream is dead https://github.com/gentoo/guru/pull/301 --- games-roguelike/tsl/Manifest | 1 + games-roguelike/tsl/metadata.xml | 15 +++ games-roguelike/tsl/tsl-0.40-r2.ebuild | 134 +++++++++++++++++++++++++ licenses/TSL | 67 +++++++++++++ 4 files changed, 217 insertions(+) create mode 100644 games-roguelike/tsl/Manifest create mode 100644 games-roguelike/tsl/metadata.xml create mode 100644 games-roguelike/tsl/tsl-0.40-r2.ebuild create mode 100644 licenses/TSL diff --git a/games-roguelike/tsl/Manifest b/games-roguelike/tsl/Manifest new file mode 100644 index 000000000..4c6497e25 --- /dev/null +++ b/games-roguelike/tsl/Manifest @@ -0,0 +1 @@ +DIST the-slimy-lichmummy-698f45f25c72f172434fe3ca5fce8e5df7f1e189.tar.bz2 232039 BLAKE2B cfa2936a2a141e04a8462c4b546e1a9e38b191789089c50c9ab3590d014bbf5f739536b7755bbfd67652e5d13d78ca13f25ec9394d3a2af6dae5a72395df5fcb SHA512 59ea7777f6caeccbee398aa59e73ebe3345dac597e2ad3fc0fc8d6ffc194bce56b86bca3ee1124cb7c7e0839d395e4ddd93ce14aacc4330a49e5b9edd4bd7744 diff --git a/games-roguelike/tsl/metadata.xml b/games-roguelike/tsl/metadata.xml new file mode 100644 index 000000000..22fad4e56 --- /dev/null +++ b/games-roguelike/tsl/metadata.xml @@ -0,0 +1,15 @@ + + + + + zdanevich.vitaly@ya.ru + Vitaly Zdanevich + + + vitaly-zdanevich/the-slimy-lichmummy + + + Build Allegro-based GUI + Build ncurses-based CLI + + diff --git a/games-roguelike/tsl/tsl-0.40-r2.ebuild b/games-roguelike/tsl/tsl-0.40-r2.ebuild new file mode 100644 index 000000000..2c2e7d093 --- /dev/null +++ b/games-roguelike/tsl/tsl-0.40-r2.ebuild @@ -0,0 +1,134 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 + +DESCRIPTION="The Slimy Lichmummy, an adventure game similar in style to the classic Rogue" +HOMEPAGE="http://www.happyponyland.net/roguelike.php" +SRC_URI="https://gitlab.com/vitaly-zdanevich/the-slimy-lichmummy/-/archive/698f45f25c72f172434fe3ca5fce8e5df7f1e189/the-slimy-lichmummy-698f45f25c72f172434fe3ca5fce8e5df7f1e189.tar.bz2" + +S="${WORKDIR}/the-slimy-lichmummy-698f45f25c72f172434fe3ca5fce8e5df7f1e189" +LICENSE="TSL BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="allegro ncurses" +REQUIRED_USE="|| ( allegro ncurses )" + +# TSL leverages shell scripts explicitly calling "gcc". We are most displeased. +BDEPEND="sys-devel/gcc" +DEPEND=" + allegro? ( media-libs/allegro:5 ) + ncurses? ( sys-libs/ncurses ) +" +RDEPEND="${DEPEND}" + +# Absolute dirname of the directory containing the Allegro-based GUI version. +TSL_GUI_DIRNAME="/usr/share/${PN}" + +# Prevent the "readme.gentoo-r1" eclass from autoformatting documentation via +# the external "fmt" and "echo -e" commands for readability. +DISABLE_AUTOFORMATTING=1 + +#FIXME: Uncomment this line to test "readme.gentoo-r1" documentation. +#FORCE_PRINT_ELOG=1 + +src_prepare() { + # Sanitize build scripts as follows: + # * Inject user $CFLAGS. + # * Force "-fcommon", which used to be the GCC default and which these + # build scripts assume as a basic prerequisite. GCC now defaults to + # "-fno-common" -- which, while safer, breaks everything with errors: + # /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: + # /var/tmp/portage/games-roguelike/tsl-0.40-r2/temp/cclgfSCH.o:(.bss+0x48): + # multiple definition of `game'; + # /var/tmp/portage/games-roguelike/tsl-0.40-r2/temp/ccJQOSUH.o:(.bss+0x23a0): + # first defined here + # * Prevent squelching of build failures. *sigh* + # * Respect the system-wide Allegro and ncurses configurations. + # + # Note that user $CFLAGS are intentionally *NOT* injected, as doing so + # causes segmentation faults at runtime. tl;dr: TSL is fragile, people. + + #FIXME: Sanitize the hardcoded "pkg-config" call away by: + #* Inheriting "toolchain-funcs" above. + #* Replacing "pkg-config" with "$(tc-getPKG_CONFIG)" below. + sed -i \ + -e 's~^\(gcc.*\)\\$~\1 -fcommon \\~' \ + -e '/exit 0/d' \ + -e 's~-lallegro -lallegro_image -lallegro_font~$(pkg-config --libs allegro-5 allegro_font-5 allegro_image-5)~' \ + -e 's~-lcurses~$(pkg-config --libs ncurses)~' \ + build_*.sh || die + + # Load Allegro assets from the installed GUI game directory. + sed -i \ + -e "s~\\([^\"]*\\.png\\)~${TSL_GUI_DIRNAME}/\\1~" \ + -e "s~\\([^\"]*\\.tga\\)~${TSL_GUI_DIRNAME}/\\1~" \ + allui.c || die + + eapply_user +} + +# Technically, we should be running "nbuild.php" to rebuild TSL build scripts +# on a per-system basis. But that requires adding a build-time PHP dependency, +# which smacks of overkill. For now, just run the bundled build scripts. +src_compile() { + # Since both the ncurses and Allegro build scripts ambigously install the + # same "tsl" command, avoid this collision by suffixing each uniquely. + if use ncurses; then + einfo 'Compiling "tsl-tty" ncurses interface...' + ./build_console.sh || die + mv tsl tsl-tty || die + fi + + if use allegro; then + einfo 'Compiling "tsl-gui" Allegro interface...' + ./build_gui.sh || die + mv tsl tsl-gui || die + fi +} + +src_install() { + # The ncurses build is entirely self-contained in its compiled executable. + if use ncurses; then + dobin tsl-tty + + DOC_CONTENTS+=" +The ncurses-based console version of The Slimy Lichmummy (TSL) is \"tsl-tty\". +" + fi + + # The Allegro build requires external assets. + if use allegro; then + dobin tsl-gui + + insinto "${TSL_GUI_DIRNAME}" + doins *.{png,tga} + + DOC_CONTENTS+=" +The Allegro-based GUI version of The Slimy Lichmummy (TSL) is \"tsl-gui\". +" + fi + + # Install documentation and configuration examples. + dodoc CHANGES.TXT README.TXT + docinto examples + dodoc tsl_conf_* + + # Generate Gentoo-specific documentation. + DOC_CONTENTS+=" +TSL is configurable by copying the example configuration file into your home +directory: e.g., + $ cp /usr/share/doc/${PV}/examples/tsl_conf_example ~/.tsl_conf + +TSL writes save and morgue files directly into your home directory as +~/TSL-SAVE and ~/morgue.txt (respectively). +" + readme.gentoo_create_doc +} + +# Print the "README.gentoo" file installed above on first installation. +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/licenses/TSL b/licenses/TSL new file mode 100644 index 000000000..69d670180 --- /dev/null +++ b/licenses/TSL @@ -0,0 +1,67 @@ +This is The Slimy Lichmummy (TSL).␍ +It can be retrieved from www.happyponyland.net.␍ +Copyright Ulf Åström (ulf.astrom@gmail.com)␍ +␍ +TSL is not free software. For several reasons I have not placed it␍ +under any conventional open source license. I might do so in the␍ +future, but for now the following shall apply:␍ +␍ +The source code is provided so you can compile it on any architecture␍ +and verify what runs inside your computer.␍ +␍ +You may distribute unmodified copies of the source package.␍ +␍ +I don't really mind unofficial patches or ports, but I prefer if you␍ +contact me first.␍ +␍ +You are not allowed to sell TSL in any form (source code or binaries).␍ +␍ +TSL comes with no warranty. Use it at your own risk.␍ +␍ +Some parts of the program are licensed under other conditions:␍ +␍ +mt19937ar.c is distributed under a BSD license; see COPYING_MT.TXT for details.␍ +␍ +The font is a modified "Terminus". See OFL.TXT for details.␍ +TSL contains a Mersenne-Twister implementation (mt19937ar.c).␍ +␍ + A C-program for MT19937, with initialization improved 2002/1/26.␍ + Coded by Takuji Nishimura and Makoto Matsumoto.␍ +␍ + Before using, initialize the state by using init_genrand(seed) ␍ + or init_by_array(init_key, key_length).␍ +␍ + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,␍ + All rights reserved. ␍ +␍ + Redistribution and use in source and binary forms, with or without␍ + modification, are permitted provided that the following conditions␍ + are met:␍ +␍ + 1. Redistributions of source code must retain the above copyright␍ + notice, this list of conditions and the following disclaimer.␍ +␍ + 2. Redistributions in binary form must reproduce the above copyright␍ + notice, this list of conditions and the following disclaimer in the␍ + documentation and/or other materials provided with the distribution.␍ +␍ + 3. The names of its contributors may not be used to endorse or promote ␍ + products derived from this software without specific prior written ␍ + permission.␍ +␍ + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS␍ + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT␍ + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR␍ + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR␍ + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,␍ + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,␍ + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR␍ + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF␍ + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING␍ + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS␍ + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.␍ +␍ +␍ + Any feedback is very welcome.␍ + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html␍ + email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)