diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-07-06 02:27:56 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-07-06 04:37:54 -0400 |
commit | 3144840d8387b9c7f8b60c6381ad9c0060878296 (patch) | |
tree | e2b13b55967565ec30111adfe55f3ea726d211aa /games-roguelike/dwarf-fortress | |
parent | games-roguelike/dwarf-fortress: drop 0.44.12 (diff) | |
download | gentoo-3144840d8387b9c7f8b60c6381ad9c0060878296.tar.gz gentoo-3144840d8387b9c7f8b60c6381ad9c0060878296.tar.bz2 gentoo-3144840d8387b9c7f8b60c6381ad9c0060878296.zip |
games-roguelike/dwarf-fortress: misc ebuild adjustments
No fundamental changes, but some extras for the accumulated PR:
- adjust patches (scrubbed, fixed some malformation wrt missing files
headers and a blank line, and included right line terminators so
sed/dos2unix isn't needed)
- added basic icon for .desktop
- remove duplicate pkgconfig DEPEND (only needed in BDEPEND)
- add missing quotes for dobin's FILESDIR
- use prefixify_ro, failed to hprefixify as it did not exist in WORKDIR
- move DOC_CONTENTS to src_install and respect variable scope
- add libglvnd[X] and glib:2 to RDEPEND (injected by pkg-config)
- make libsdl[opengl] unconditional, don't see much worth as optfeature
given currently need GL libraries either way
(could argue audio may well be unconditional too, but left alone)
- add [-minimal] to libsndfile optfeature or it gives confusing
"not found" errors
- further misc style adjustments
Thanks to everyone that worked on this.
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'games-roguelike/dwarf-fortress')
-rw-r--r-- | games-roguelike/dwarf-fortress/Manifest | 1 | ||||
-rw-r--r-- | games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild | 95 | ||||
-rw-r--r-- | games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-missing-cmath.patch (renamed from games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-fix-cmath.patch) | 11 | ||||
-rw-r--r-- | games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fixes.patch (renamed from games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fix-729002.patch) | 65 |
4 files changed, 77 insertions, 95 deletions
diff --git a/games-roguelike/dwarf-fortress/Manifest b/games-roguelike/dwarf-fortress/Manifest index 8b96ead81a7a..84e82c2074f3 100644 --- a/games-roguelike/dwarf-fortress/Manifest +++ b/games-roguelike/dwarf-fortress/Manifest @@ -1,2 +1,3 @@ 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 dwarf-fortress.png 271 BLAKE2B cbc14917de1556b25d3817298215beedc4cb01075b8454e38b2d314bdf22f8c20c4bf2332f0d731c7e4c6d6a60056361565221ce3db2c7a15fdf934bff01df54 SHA512 08bdc0e084f861b6e6a8b12e3bc93b9703f2a4cbc133d62d1c2931daf81ccd70b728853d5c05bed19a1ef477cf4ad10fce263bbab7d9cad3b60658f17063acf6 diff --git a/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild b/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild index 8df73a95939f..e94ca7db6dd6 100644 --- a/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild +++ b/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild @@ -3,95 +3,90 @@ EAPI=8 -inherit prefix optfeature toolchain-funcs desktop readme.gentoo-r1 +inherit desktop flag-o-matic optfeature prefix readme.gentoo-r1 toolchain-funcs -MY_PV=$(ver_rs 1- _ "$(ver_cut 2-)") -MY_P=df_${MY_PV} +MY_P="df_$(ver_rs 1- _ $(ver_cut 2-))" -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" -) +DESCRIPTION="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 ) + https://dev.gentoo.org/~ionen/distfiles/${PN}.png" +S="${WORKDIR}/df_linux" LICENSE="free-noncomm BSD BitstreamVera" SLOT="0" KEYWORDS="-* ~amd64 ~x86" IUSE="debug" -RDEPEND="media-libs/glew:0= - media-libs/libsdl[joystick,video] +RDEPEND=" + dev-libs/glib:2 + media-libs/glew:0= + media-libs/libglvnd[X] + media-libs/libsdl[joystick,opengl,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} +# libsndfile, openal and ncurses are only needed at compile-time, +# optfeature through dlopen() at runtime if requested +DEPEND=" + ${RDEPEND} media-libs/libsndfile media-libs/openal - sys-libs/ncurses-compat:5[unicode] - virtual/pkgconfig" + sys-libs/ncurses-compat:5[unicode]" BDEPEND="virtual/pkgconfig" -QA_PREBUILT="/opt/${PN}/libs/Dwarf_Fortress" +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." +PATCHES=( + "${FILESDIR}"/${P}-missing-cmath.patch + "${FILESDIR}"/${P}-segfault-fixes.patch +) 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" + # remove prebuilt libraries that are provided by the system + rm libs/*.so* || die } src_compile() { tc-export CXX PKG_CONFIG - emake -f "${FILESDIR}/Makefile.native" + # -DDEBUG is recognized to give additional debug output + append-cppflags -D$(usev !debug N)DEBUG + + emake -f "${FILESDIR}"/Makefile.native } src_install() { insinto /opt/${PN} - doins -r raw data libs + doins -r data libs raw - dobin ${FILESDIR}/dwarf-fortress + fperms +x /opt/${PN}/libs/Dwarf_Fortress - readme.gentoo_create_doc - dodoc README.linux *.txt + dobin "$(prefixify_ro "${FILESDIR}"/dwarf-fortress)" - fperms 755 /opt/${PN}/libs/Dwarf_Fortress + doicon "${DISTDIR}"/${PN}.png + make_desktop_entry dwarf-fortress "Dwarf Fortress" - make_desktop_entry dwarf-fortress "Dwarf Fortress" "dwarf-fortress" Game + dodoc README.linux *.txt + + local DOC_CONTENTS=" + Dwarf Fortress has been installed to ${EPREFIX}/opt/${PN}. This is + symlinked to ~/.${PN} when ${PN} is run. For more information on what + exactly is replaced, see ${EPREFIX}/usr/bin/${PN}. Note: This means + that the primary entry point is ${EPREFIX}/usr/bin/${PN}, do not run + ${EPREFIX}/opt/${PN}/libs/Dwarf_Fortress." + readme.gentoo_create_doc } 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] + optfeature "audio output" "media-libs/openal media-libs/libsndfile[-minimal]" } 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-missing-cmath.patch index 21017f6b41b1..a3028764afac 100644 --- 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-missing-cmath.patch @@ -1,11 +1,8 @@ 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" +--- a/g_src/ttf_manager.cpp ++++ b/g_src/ttf_manager.cpp +@@ -2,2 +2,3 @@ #include "init.h" - #include <iostream> +#include <cmath> - - using namespace std; - + #include <iostream> 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-fixes.patch index 0f0a9a672874..24c43be41188 100644 --- 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-fixes.patch @@ -1,49 +1,38 @@ -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 +Fixes segfault / infinite loop with OpenAL and anything higher +than -O1 mostly due to missing return values. +https://bugs.gentoo.org/703384 +https://bugs.gentoo.org/703386 https://bugs.gentoo.org/729002 - -diff --git a/g_src/enabler.cpp b/g_src/enabler.cpp +https://www.bay12games.com/dwarves/mantisbt/view.php?id=11564 --- a/g_src/enabler.cpp +++ b/g_src/enabler.cpp -@@ -590,6 +590,10 @@ int enablerst::loop(string cmdline) { - +@@ -591,4 +591,6 @@ // 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); } +@@ -251,5 +251,4 @@ + }
+ // Deinit OpenAL
+- alcMakeContextCurrent(NULL);
+ alcDestroyContext(context);
+ alcCloseDevice(device);
+@@ -481,5 +480,5 @@ + 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); }
+@@ -491,5 +490,5 @@ + 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); }
|