Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 78781 - games-roguelike/tome ebuild enhancement proposal (sld and gtk clients)
Summary: games-roguelike/tome ebuild enhancement proposal (sld and gtk clients)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-20 01:02 UTC by Gustavo Ribeiro Alves
Modified: 2006-03-07 12:04 UTC (History)
1 user (show)

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


Attachments
Proposed ebuild that also builds the gtk and sdl clients (tome-2.3.1-r1.ebuild,3.25 KB, text/plain)
2005-01-20 02:38 UTC, Gustavo Ribeiro Alves
Details
Proposed ebuild that also builds the gtk and sdl clients (tome-2.3.1-r1.ebuild,3.32 KB, text/plain)
2005-01-20 09:55 UTC, Gustavo Ribeiro Alves
Details
ebuild 2.3.3 patch to compile for macosx (ppc-macos.ebuild,573 bytes, patch)
2006-03-05 13:22 UTC, Tupone Alfredo
Details | Diff
improved ebuild 2.3.3 patch to compile for macosx (tome.diff,732 bytes, patch)
2006-03-06 11:43 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Ribeiro Alves 2005-01-20 01:02:59 UTC
The current tome ebuild only builds the ncurses and X11 client where SDL and GTK ones are available, it also is unecessarely dependant of X.

This is a proposal to alter the ebuild in order to make it build whatever clients are available given the use flags, and only then.

It is not easy to alter the Makefiles with sed commands (what is currently being done whit the current ebuild). So I propose a two part solution:

1) Create a new Makefile that accept command line options for COPTS, INCLUDES, DEFINES and LIBS . Use the ebuild system and SED to change the TOME Makefile into it.

2) Pass the options as command line ones to the makefile.
Comment 1 Gustavo Ribeiro Alves 2005-01-20 02:38:42 UTC
Created attachment 49026 [details]
Proposed ebuild that also builds the gtk and sdl clients

This bugs compiles and runs on my machine. Just one reserve: I couldn't figure
out how to block an ebuild if neither of its use flags are set, so I use an
'if' on the unpack section of it (there should probably be a better way of
doing this but I don't know).
Comment 2 Chris Gianelloni (RETIRED) gentoo-dev 2005-01-20 05:41:20 UTC
Using the if statements is the right way to go about it.  Personally, I would say that you should build the ncurses interface as the default, as all ebuilds should be able to complete with any combination of USE flags (that's policy).

Currently the ebuild won't build if none of those flags are set.

Instead, it should be more like this:

if ! use sdl and ! use X and ! use gtk and ! use ncurses; then
    ewarn "Using ncurses interface as default"
    GENTOO_TOME_USE=" $GENTOO_TOME_USE -DUSE_GCU "
    GENTOO_TOME_LIBS=" $GENTOO_TOME_LIBS -lncurses "
fi

That way, the ebuild will complete no matter what.  The only way it would fail is if ncurses is not available on the machine, which it should be as it is in the system profile for all architectures.  With it done like this, someone could still build, say, the gtk interface only, but if they didn't have any of these in USE, it would default to ncurses.
Comment 3 Gustavo Ribeiro Alves 2005-01-20 09:55:24 UTC
Created attachment 49046 [details]
Proposed ebuild that also builds the gtk and sdl clients

Ebuild with suggested modifications
Comment 4 Chris Gianelloni (RETIRED) gentoo-dev 2005-02-22 17:23:31 UTC
Hrrrmn... I can't get this to build on amd64... I keep getting errors...

main-gtk.c: In function `change_graf_mode_event_handler':
main-gtk.c:3709: warning: cast from pointer to integer of different size
main-gtk.c: In function `change_dith_mode_event_handler':
main-gtk.c:3727: warning: cast from pointer to integer of different size
main-gtk.c: At top level:
main-gtk.c:4352: warning: initializer element is not computable at load time
main-gtk.c:4352: error: initializer element is not constant
main-gtk.c:4352: error: (near initialization for `main_menu_items[4].callback_action')
main-gtk.c:4352: error: initializer element is not constant
main-gtk.c:4352: error: (near initialization for `main_menu_items[4]')
main-gtk.c:4354: warning: initializer element is not computable at load time
main-gtk.c:4354: error: initializer element is not constant
main-gtk.c:4354: error: (near initialization for `main_menu_items[5].callback_action')

There's tons more, but I clipped it to be nice.  With USE="-gtk" it builds perfectly.
Comment 5 Gustavo Ribeiro Alves 2005-03-07 20:40:23 UTC
This probably is A64 related (since I can build it here). Should we fill a bug at www.t-o-m-e.net?
Comment 6 Wil Hunt 2005-05-23 17:59:40 UTC
ebuild should respect the -X USE flag.

The current ToME ebuild requires some X packages even when -X, etc. is set in
make.conf USE clause.  ToME can run without X and can be compiled appropriately
with the appropriate make confiugrations.  It would be nice if ToME respected
the -X flag and build a console/curses-only version instead.  Currently, the
ebuild module creates a ToME that is compatible with curses AND X.
Comment 7 Wil Hunt 2005-05-23 18:03:46 UTC
(In reply to comment #6)
> ebuild should respect the -X USE flag.

Ok, after actually reading the whole bug, I see that this is already known.  Sorry!

Wil
Comment 8 Tupone Alfredo gentoo-dev 2006-02-28 12:40:55 UTC
Fixed in CVS.
Dropped support for ppc-macos as sdl-image and sd-ttf have not ppc-macos either stable or testing in KEYWORDS.
ppc-macos please test and add sdl-image, sdl-ttf and tome-2.3.3 ~ppc-macos 
Comment 9 Fabian Groffen gentoo-dev 2006-03-04 13:25:43 UTC
I keyworded the missing packages, but I get a compile time error:

gcc -Wall -O1 -pipe -g  -I/usr/X11R6/include -Ilua -I. -DUSE_X11 -DUSE_EGO_GRAPHICS -DUSE_TRANSPARENCY -DSUPPORT_GAMMA -DUSE_PRECISE_CMOVIE -DUSE_UNIXSOCK -DUSE_LUA -DIRC_SERVER=\"irc.worldirc.org\" -DIRC_PORT=\"6667\" -DIRC_CHANNEL=\"#tome\" -DDEFAULT_PATH=\"./lib/\"   -Wl,-z,now -o tolua lua/lapi.o lua/lcode.o lua/ldebug.o lua/ldo.o lua/lfunc.o lua/lgc.o lua/llex.o lua/lmem.o lua/lobject.o lua/lparser.o lua/lstate.o lua/lstring.o lua/ltable.o lua/ltests.o lua/ltm.o lua/lundump.o lua/lvm.o lua/lzio.o lua/lauxlib.o lua/lbaselib.o lua/ldblib.o lua/liolib.o lua/lstrlib.o lua/tolua_lb.o lua/tolua_rg.o lua/tolua_tt.o lua/tolua_tm.o lua/tolua_gp.o lua/tolua_eh.o lua/tolua_bd.o lua/tolua.c lua/tolualua.c -L/usr/X11R6/lib -lX11
/usr/bin/ld: unknown flag: -z
collect2: ld returned 1 exit status
make: *** [tolua] Error 1

This will need some work for Darwin (bindnow flags)
Comment 10 Tupone Alfredo gentoo-dev 2006-03-05 13:22:16 UTC
Created attachment 81445 [details, diff]
ebuild 2.3.3 patch to compile for macosx

Please, check if this will fix your compilation
Comment 11 Fabian Groffen gentoo-dev 2006-03-06 11:43:08 UTC
Created attachment 81549 [details, diff]
improved ebuild 2.3.3 patch to compile for macosx

I like to use Diego's bindnow-flags function here instead.

Compilation is fine, only problem I see is that the sdl mode doesn't work, it generates a runtime trap, and SDL complaining about memory leaks and stuff.  The game looks good in the other modes (Xaw, X11, curses) though.
Comment 12 Fabian Groffen gentoo-dev 2006-03-07 11:48:30 UTC
@tupone: thanks for the commit.

can we close this bug now?
Comment 13 Gustavo Ribeiro Alves 2006-03-07 12:04:35 UTC
Wow. I thought this bug was forgotten!

It seems to work right for me. Since I started the bug I'll close it.