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.
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).
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.
Created attachment 49046 [details] Proposed ebuild that also builds the gtk and sdl clients Ebuild with suggested modifications
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.
This probably is A64 related (since I can build it here). Should we fill a bug at www.t-o-m-e.net?
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.
(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
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
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)
Created attachment 81445 [details, diff] ebuild 2.3.3 patch to compile for macosx Please, check if this will fix your compilation
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.
@tupone: thanks for the commit. can we close this bug now?
Wow. I thought this bug was forgotten! It seems to work right for me. Since I started the bug I'll close it.