diff options
author | Joshua Goins <josh@redstrate.com> | 2022-06-28 19:57:28 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-07-06 04:37:53 -0400 |
commit | 97a24df3591ca7bebd0fcd189e1da5f16240715c (patch) | |
tree | db9aac97bd5b45eb1e9ddca5efa7ff67111692f1 | |
parent | dev-lang/swig: drop 4.0.0 (diff) | |
download | gentoo-97a24df3591ca7bebd0fcd189e1da5f16240715c.tar.gz gentoo-97a24df3591ca7bebd0fcd189e1da5f16240715c.tar.bz2 gentoo-97a24df3591ca7bebd0fcd189e1da5f16240715c.zip |
games-roguelike/dwarf-fortress: add 0.47.05
Signed-off-by: Joshua Goins <josh@redstrate.com>
Co-authored-by: Sven Eusewig <sveneusewig@yahoo.de>
Co-authored-by: Wolfgang E. Sanyer <ezzieyguywuf@gmail.com>
Closes: https://bugs.gentoo.org/703384
Closes: https://bugs.gentoo.org/703386
Closes: https://bugs.gentoo.org/717752
Closes: https://bugs.gentoo.org/729002
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
4 files changed, 159 insertions, 0 deletions
diff --git a/games-roguelike/dwarf-fortress/Manifest b/games-roguelike/dwarf-fortress/Manifest index c42a144cfc72..f7f5a8d0f1fa 100644 --- a/games-roguelike/dwarf-fortress/Manifest +++ b/games-roguelike/dwarf-fortress/Manifest @@ -1,2 +1,4 @@ DIST df_44_12_linux.tar.bz2 12081683 BLAKE2B 2410e8da6af6a8ced45d3e95dc06e2d0f4e31dbdcd6b8d9945a761d2278532bb24c1095418aa22639eedded256b3d485fa128984e6282a491d4dc7bd9af8671b SHA512 03cd7f6800d44873b573cc5bffb12c7a246c3aba0ee8535001372df689a5179dc02592670fd87f2fd5de82421605f34152f6241307c8f7b9fb4d7b8704aed70c DIST df_44_12_linux32.tar.bz2 12686340 BLAKE2B bf1e1370930d91d2c9e72d3366bc79706092d1505853eb63c6160fea39822551d3276958ac6d2916b8f7825be0c054a037219210f0c2c18a731065a2dd1bb842 SHA512 5cd352acf310592c7e30442205b7fe590f421c5e3562959dcfd32a17d3d562347c2b32e3bc5835637c5550ce2c696c17b6dc910ee4cf766be07af306e83537db +DIST df_47_05_linux.tar.bz2 12725420 BLAKE2B 80987f05de2db2796a53cc8767ee7aa5c78674dff725efc0dafe07dc4118e56c7814cbf92507fe9b76a385e182405c7d6759cb6bcc942385110df1dc1a3b3af4 SHA512 9ea46fa12a80266cd09363f1aea8cdd059a5ebeefb453c4a46ffbb1115486409003c3caca95a1b6010da4040d04b781182c59e57a6cc033cd7de4507299f7534 +DIST df_47_05_linux32.tar.bz2 13487455 BLAKE2B be604dd2fd480c5609da801013dfdae26964760c0a92c4b3d2d8369800eee7ca9c1b1c2313cc67357feee3c6d425bf7f9f67cab53d2e771ab59055bc4c3329d0 SHA512 e9b9cf6995c24b403347159a35cfe4b57603bdb777c78639beb2799d9bf31317edec54fb92b17dbb90df6001b905d43285a35e9446768d12a746492b2fd34fe7 diff --git a/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild b/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild new file mode 100644 index 000000000000..8df73a95939f --- /dev/null +++ b/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit prefix optfeature toolchain-funcs desktop readme.gentoo-r1 + +MY_PV=$(ver_rs 1- _ "$(ver_cut 2-)") +MY_P=df_${MY_PV} + +DESCRIPTION="A single-player fantasy game" +HOMEPAGE="https://www.bay12games.com/dwarves" +SRC_URI="amd64? ( https://www.bay12games.com/dwarves/${MY_P}_linux.tar.bz2 ) + x86? ( https://www.bay12games.com/dwarves/${MY_P}_linux32.tar.bz2 )" +S="${WORKDIR}"/df_linux + +PATCHES=( + "${FILESDIR}/${P}-fix-cmath.patch" + "${FILESDIR}/${P}-segfault-fix-729002.patch" +) + +LICENSE="free-noncomm BSD BitstreamVera" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="debug" + +RDEPEND="media-libs/glew:0= + media-libs/libsdl[joystick,video] + media-libs/sdl-image[png] + media-libs/sdl-ttf + sys-libs/zlib:= + virtual/glu + x11-libs/gtk+:2" +# Yup, libsndfile, openal and ncurses are only needed at compile-time; the code +# dlopens them at runtime if requested. +DEPEND="${RDEPEND} + media-libs/libsndfile + media-libs/openal + sys-libs/ncurses-compat:5[unicode] + virtual/pkgconfig" +BDEPEND="virtual/pkgconfig" + +QA_PREBUILT="/opt/${PN}/libs/Dwarf_Fortress" + +DOC_CONTENTS="Dwarf Fortress has been installed to /opt/${PN}. This is + symlinked to ~/.dwarf-fortress when dwarf-fortress is run. + For more information on what exactly is replaced, see ${EROOT}/usr/bin/dwarf-fortress. + Note: This means that the primary entry point is ${EROOT}/usr/bin/dwarf-fortress. + Do not run /opt/${PN}/libs/Dwarf_Fortress." + +src_prepare() { + # fix line endings so the patches can apply properly + sed -i \ + -e 's/\r$//' \ + g_src/ttf_manager.cpp \ + g_src/music_and_sound_openal.cpp \ + || die + + default + + # dwarf fortress includes prebuilt libraries such as libstdc++ we won't use + rm -f libs/*.so* || die +} + +src_configure() { + hprefixify "${WORKDIR}/dwarf-fortress" + + CXXFLAGS+=" -D$(use debug || echo N)DEBUG" +} + +src_compile() { + tc-export CXX PKG_CONFIG + + emake -f "${FILESDIR}/Makefile.native" +} + +src_install() { + insinto /opt/${PN} + doins -r raw data libs + + dobin ${FILESDIR}/dwarf-fortress + + readme.gentoo_create_doc + dodoc README.linux *.txt + + fperms 755 /opt/${PN}/libs/Dwarf_Fortress + + make_desktop_entry dwarf-fortress "Dwarf Fortress" "dwarf-fortress" Game +} + +pkg_postinst() { + readme.gentoo_print_elog + + optfeature "text PRINT_MODE" sys-libs/ncurses-compat:5[unicode] + optfeature "audio output" "media-libs/openal media-libs/libsndfile" + optfeature "OpenGL PRINT_MODE" media-libs/libsdl[opengl] +} diff --git a/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-fix-cmath.patch b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-fix-cmath.patch new file mode 100644 index 000000000000..21017f6b41b1 --- /dev/null +++ b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-fix-cmath.patch @@ -0,0 +1,11 @@ +Fixes compilation due to missing <cmath> header required in this file. + +diff --git a/g_src/ttf_manager.cpp b/g_src/ttf_manager.cpp +@@ -1,6 +1,7 @@ + #include "ttf_manager.hpp" + #include "init.h" + #include <iostream> ++#include <cmath> + + using namespace std; + diff --git a/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fix-729002.patch b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fix-729002.patch new file mode 100644 index 000000000000..0f0a9a672874 --- /dev/null +++ b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fix-729002.patch @@ -0,0 +1,49 @@ +Fixes a bug due to OpenAL soft crashing the game on startup: https://www.bay12games.com/dwarves/mantisbt/view.php?id=11564 +Fixes a bug regarding an infinite loop on anything higher than -O1: https://www.bay12games.com/dwarves/mantisbt/view.php?id=11564 + +https://bugs.gentoo.org/729002 + +diff --git a/g_src/enabler.cpp b/g_src/enabler.cpp +--- a/g_src/enabler.cpp ++++ b/g_src/enabler.cpp +@@ -590,6 +590,10 @@ int enablerst::loop(string cmdline) { + + // Clean up graphical resources + delete renderer; ++ ++ return 0; + } + + void enablerst::override_grid_size(int x, int y) { +diff --git a/g_src/music_and_sound_openal.cpp b/g_src/music_and_sound_openal.cpp +--- a/g_src/music_and_sound_openal.cpp ++++ b/g_src/music_and_sound_openal.cpp +@@ -250,7 +250,11 @@ void musicsoundst::deinitsound() { + alDeleteBuffers(1, &buffer); + } + // Deinit OpenAL +- alcMakeContextCurrent(NULL); ++ ++ //alcMakeContextCurrent(NULL); ++ + alcDestroyContext(context); + alcCloseDevice(device); + +@@ -480,7 +484,9 @@ static bool init_openal() { + + void alEnable( ALenum capability ) { _alEnable(capability); } + void alDisable( ALenum capability ) { _alDisable(capability); } +-ALboolean alIsEnabled( ALenum capability ) { _alIsEnabled(capability); } ++ALboolean alIsEnabled( ALenum capability ) { return _alIsEnabled(capability); } + const ALchar* alGetString( ALenum param ) { return _alGetString(param); } + void alGetBooleanv( ALenum param, ALboolean* data ) { _alGetBooleanv(param, data); } + void alGetIntegerv( ALenum param, ALint* data ) { _alGetIntegerv(param, data); } +@@ -490,7 +496,9 @@ ALboolean alGetBoolean( ALenum param ) { return _alGetBoolean(param); } + ALint alGetInteger( ALenum param ) { return _alGetInteger(param); } + ALfloat alGetFloat( ALenum param ) { return _alGetFloat(param); } + ALdouble alGetDouble( ALenum param ) { return _alGetDouble(param); } +-ALenum alGetError( void ) { _alGetError(); } ++ALenum alGetError( void ) { return _alGetError(); } + ALboolean alIsExtensionPresent( const ALchar* extname ) { return _alIsExtensionPresent(extname); } + void* alGetProcAddress( const ALchar* fname ) { return _alGetProcAddress(fname); } + ALenum alGetEnumValue( const ALchar* ename ) { return _alGetEnumValue(ename); } |