Bug 78781 - games-roguelike/tome ebuild enhancement proposal (sld and gtk clients)
Bug#: 78781 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: RESOLVED Severity: enhancement Priority: P2
Resolution: FIXED Assigned To: games@gentoo.org Reported By: gralves@gmail.com
Component: Games
URL: 
Summary: games-roguelike/tome ebuild enhancement proposal (sld and gtk clients)
Keywords:  
Status Whiteboard: 
Opened: 2005-01-20 01:02 0000
Description:   Opened: 2005-01-20 01:02 0000
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 From Gustavo Ribeiro Alves 2005-01-20 02:38:42 0000 -------
Created an attachment (id=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 From Chris Gianelloni (RETIRED) 2005-01-20 05:41:20 0000 -------
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 From Gustavo Ribeiro Alves 2005-01-20 09:55:24 0000 -------
Created an attachment (id=49046) [details]
Proposed ebuild that also builds the gtk and sdl clients

Ebuild with suggested modifications

------- Comment #4 From Chris Gianelloni (RETIRED) 2005-02-22 17:23:31 0000 -------
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 From Gustavo Ribeiro Alves 2005-03-07 20:40:23 0000 -------
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 From Wil Hunt 2005-05-23 17:59:40 0000 -------
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 From Wil Hunt 2005-05-23 18:03:46 0000 -------
(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 From Tupone Alfredo 2006-02-28 12:40:55 0000 -------
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 From Fabian Groffen 2006-03-04 13:25:43 0000 -------
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 From Tupone Alfredo 2006-03-05 13:22:16 0000 -------
Created an attachment (id=81445) [details]
ebuild 2.3.3 patch to compile for macosx

Please, check if this will fix your compilation

------- Comment #11 From Fabian Groffen 2006-03-06 11:43:08 0000 -------
Created an attachment (id=81549) [details]
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 From Fabian Groffen 2006-03-07 11:48:30 0000 -------
@tupone: thanks for the commit.

can we close this bug now?

------- Comment #13 From Gustavo Ribeiro Alves 2006-03-07 12:04:35 0000 -------
Wow. I thought this bug was forgotten!

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