Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 856685 - games-roguelike/dwarf-fortress: Add gtk? USE flag and remove hard dependency
Summary: games-roguelike/dwarf-fortress: Add gtk? USE flag and remove hard dependency
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2022-07-06 12:10 UTC by Finn Rayment
Modified: 2022-10-09 20:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
GTK hard-dep patch (dwarf-fortress-0.47.05-r1.patch,6.94 KB, application/mbox)
2022-07-06 12:10 UTC, Finn Rayment
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Finn Rayment 2022-07-06 12:10:08 UTC
Created attachment 790322 [details]
GTK hard-dep patch

Following a quick discussion on GitHub (PR 26127, I believe my account is too young for URLs), I have made the required changes to the new ebuild that was released today which will now allow us to build dwarf-fortress without having to pull GTK.

For a quick explanation, the only reason GTK is pulled is for a small dialog when the game is opened which will ask if the user would like to enter fullscreen. The patch has been sitting in svenstaro/dwarf_fortress_unfuck (GitHub) for the past year and a half and I have been using it in order to play without pulling GTK.

To briefly explain the patch, a make variable HAVE_GTK is introduced and is used to #ifdef all GTK code. If the game is run in a terminal, it should ask the user via. a simple stdin request.

I don't pretend to be fluent in ebuilds, but I (hopefully) have done most of the work already. I have attached a diff with three file modifications: the ebuild, Makefile.native and my proposed patch.

Thanks.
Comment 1 Finn Rayment 2022-08-24 04:26:40 UTC
I've gone ahead and opened my own PR. See https://github.com/gentoo/gentoo/pull/26994
Comment 2 Larry the Git Cow gentoo-dev 2022-10-09 12:08:49 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f452038d6b0f5b676e3d933d40f2fd5a797c576

commit 1f452038d6b0f5b676e3d933d40f2fd5a797c576
Author:     Finn Rayment <finn@rayment.fr>
AuthorDate: 2022-08-24 04:22:13 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2022-10-09 12:08:35 +0000

    games-roguelike/dwarf-fortress: Added gui? USE flag and removed hard dep.
    
    GTK was required for runtime but was only used for a single fullscreen
    dialog prompt when the config [WINDOWED:PROMPT].
    
    Now, if libgraphics is compiled without using GTK, the game will not ask
    at all if run from a window manager, but instead open in windowed mode.
    However, if the game is run from a terminal, a simple scanf procedure
    will ask the user for yes/no before deciding.
    
    Signed-off-by: Finn Rayment <finn@rayment.fr>
    Bug: https://bugs.gentoo.org/856685
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 ....05.ebuild => dwarf-fortress-0.47.05-r1.ebuild} |   7 +-
 .../dwarf-fortress/files/Makefile.native           |   9 +-
 .../files/dwarf-fortress-0.47.05-nogtk.patch       | 119 +++++++++++++++++++++
 .../dwarf-fortress-0.47.05-segfault-fixes.patch    |  16 ++-
 4 files changed, 143 insertions(+), 8 deletions(-)
Comment 3 Finn Rayment 2022-10-09 20:44:22 UTC
Closed as merged.