From 8ce227613953aac526701696bbeda9a03dae7a0e Mon Sep 17 00:00:00 2001 From: hasufell Date: Tue, 16 Feb 2016 21:16:04 +0100 Subject: [PATCH] games-strategy/zod-engine: initial import of version 20110906 --- .../files/zod-engine-20110906-build.patch | 593 +++++++ ...engine-20110906-proper-linux-support.patch | 1390 +++++++++++++++++ .../zod-engine/zod-engine-20110906.exheres-0 | 75 + 3 files changed, 2058 insertions(+) create mode 100644 packages/games-strategy/zod-engine/files/zod-engine-20110906-build.patch create mode 100644 packages/games-strategy/zod-engine/files/zod-engine-20110906-proper-linux-support.patch create mode 100644 packages/games-strategy/zod-engine/zod-engine-20110906.exheres-0 diff --git a/packages/games-strategy/zod-engine/files/zod-engine-20110906-build.patch b/packages/games-strategy/zod-engine/files/zod-engine-20110906-build.patch new file mode 100644 index 00000000..90028550 --- /dev/null +++ b/packages/games-strategy/zod-engine/files/zod-engine-20110906-build.patch @@ -0,0 +1,593 @@ +From: Julian Ospald +Date: Sun Aug 12 09:26:49 UTC 2012 +Subject: build system + +respect CXX and CXXFLAGS + +--- zod_engine/zod_src/makefile ++++ zod_engine/zod_src/makefile +@@ -1,6 +1,6 @@ +-CC=g++ +-CFLAGS=-c -g `sdl-config --cflags` -D DISABLE_OPENGL -D DISABLE_REGCHECK +-LDFLAGS=`sdl-config --libs` -lSDL_image -lSDL_mixer -lSDL_ttf -lm -lmysqlclient ++CXX ?= g++ ++CXXFLAGS += $(shell sdl-config --cflags) -D DISABLE_OPENGL -D DISABLE_REGCHECK ++LIBS += $(shell sdl-config --libs) -lSDL_image -lSDL_mixer -lSDL_ttf -lm -lmysqlclient + INCLUDES= + BASEFILES = common.cpp zsdl.cpp event_handler.cpp socket_handler.cpp server_socket.cpp client_socket.cpp zhud.cpp zfont_engine.cpp zfont.cpp zmini_map.cpp cursor.cpp zgui_window.cpp zbuildlist.cpp zsound_engine.cpp zmusic_engine.cpp zcomp_message_engine.cpp zpath_finding.cpp zpath_finding_astar.cpp zsettings.cpp zsdl_opengl.cpp zportrait.cpp zteam.cpp ztray.cpp zmysql.cpp zpsettings.cpp ztime.cpp zvote.cpp zunitrating.cpp zencrypt_aes.cpp zolists.cpp zgui_main_menu_base.cpp zgui_main_menu_widget.cpp + COREFILES = zcore.cpp zserver.cpp zserver_events.cpp zserver_commands.cpp zclient.cpp zplayer.cpp zplayer_events.cpp zbot.cpp zbot_events.cpp SDL_rotozoom.cpp +@@ -18,423 +18,426 @@ + MAPEDITOR_OFILES = map_editor.o $(CPPFILES:.cpp=.o) + DATE = `date +%m-%d-%y` + ++ifdef DATA_PATH ++ CXXFLAGS += -D DATA_PATH=\"$(DATA_PATH)\" ++endif + + main: $(OFILES) +- $(CC) -o $(EXENAME) $(OFILES) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) -o $(EXENAME) $(OFILES) $(LDFLAGS) $(LIBS) + + map_editor: $(MAPEDITOR_OFILES) +- $(CC) -o $(MAPEDITOR_NAME) $(MAPEDITOR_OFILES) $(LDFLAGS) ++ $(CXX) $(CXXFLAGS) -o $(MAPEDITOR_NAME) $(MAPEDITOR_OFILES) $(LDFLAGS) $(LIBS) + + #base files ----------------------------------- + + map_editor.o: map_editor.cpp +- $(CC) $(CFLAGS) $(INCLUDES) map_editor.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) map_editor.cpp + + main.o: main.cpp main.h +- $(CC) $(CFLAGS) $(INCLUDES) main.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) main.cpp + + common.o: common.cpp common.h +- $(CC) $(CFLAGS) $(INCLUDES) common.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) common.cpp + + zsdl.o: zsdl.cpp zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zsdl.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zsdl.cpp + + zsdl_opengl.o: zsdl_opengl.cpp zsdl_opengl.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zsdl_opengl.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zsdl_opengl.cpp + + event_handler.o: event_handler.cpp event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) event_handler.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) event_handler.cpp + + socket_handler.o: socket_handler.cpp socket_handler.h constants.h +- $(CC) $(CFLAGS) $(INCLUDES) socket_handler.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) socket_handler.cpp + + server_socket.o: server_socket.cpp server_socket.h socket_handler.h constants.h +- $(CC) $(CFLAGS) $(INCLUDES) server_socket.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) server_socket.cpp + + client_socket.o: client_socket.cpp client_socket.h socket_handler.h constants.h +- $(CC) $(CFLAGS) $(INCLUDES) client_socket.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) client_socket.cpp + + zhud.o: zhud.cpp zhud.h zsdl.h zobject.h zmini_map.h zfont_engine.h +- $(CC) $(CFLAGS) $(INCLUDES) zhud.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zhud.cpp + + zfont_engine.o: zfont_engine.cpp zfont_engine.h zfont.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zfont_engine.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zfont_engine.cpp + + zfont.o: zfont.cpp zfont.h zfont.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zfont.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zfont.cpp + + zmini_map.o: zmini_map.cpp zmini_map.h zmap.h zsdl.h zobject.h +- $(CC) $(CFLAGS) $(INCLUDES) zmini_map.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zmini_map.cpp + + cursor.o: cursor.cpp cursor.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) cursor.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) cursor.cpp + + zgui_window.o: zgui_window.cpp zgui_window.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zgui_window.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zgui_window.cpp + + zbuildlist.o: zbuildlist.cpp zbuildlist.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zbuildlist.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zbuildlist.cpp + + zsound_engine.o: zsound_engine.cpp zsound_engine.h constants.h zsdl.h zmap.h +- $(CC) $(CFLAGS) $(INCLUDES) zsound_engine.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zsound_engine.cpp + + zmusic_engine.o: zmusic_engine.cpp zmusic_engine.h constants.h zsdl.h zmap.h +- $(CC) $(CFLAGS) $(INCLUDES) zmusic_engine.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zmusic_engine.cpp + + zcomp_message_engine.o: zcomp_message_engine.cpp zcomp_message_engine.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zcomp_message_engine.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zcomp_message_engine.cpp + + zpath_finding.o: zpath_finding.cpp zpath_finding.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zpath_finding.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zpath_finding.cpp + + zpath_finding_astar.o: zpath_finding_astar.cpp zpath_finding_astar.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zpath_finding_astar.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zpath_finding_astar.cpp + + zsettings.o: zsettings.cpp zsettings.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zsettings.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zsettings.cpp + + zportrait.o: zportrait.cpp zportrait.h constants.h zsdl.h zsdl_opengl.h +- $(CC) $(CFLAGS) $(INCLUDES) zportrait.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zportrait.cpp + + zteam.o: zteam.cpp zteam.h constants.h zsdl.h zsdl_opengl.h +- $(CC) $(CFLAGS) $(INCLUDES) zteam.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zteam.cpp + + zmysql.o: zmysql.cpp zmysql.h constants.h common.h zpsettings.h +- $(CC) $(CFLAGS) $(INCLUDES) zmysql.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zmysql.cpp + + zpsettings.o: zpsettings.cpp zpsettings.h +- $(CC) $(CFLAGS) $(INCLUDES) zpsettings.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zpsettings.cpp + + ztime.o: ztime.cpp ztime.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) ztime.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ztime.cpp + + zvote.o: zvote.cpp zvote.h zmap.h zfont_engine.h +- $(CC) $(CFLAGS) $(INCLUDES) zvote.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zvote.cpp + + zunitrating.o: zunitrating.cpp zunitrating.h zmap.h constants.h +- $(CC) $(CFLAGS) $(INCLUDES) zunitrating.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zunitrating.cpp + + zencrypt_aes.o: zencrypt_aes.cpp zencrypt_aes.h +- $(CC) $(CFLAGS) $(INCLUDES) zencrypt_aes.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zencrypt_aes.cpp + + zolists.o: zolists.cpp zolists.h +- $(CC) $(CFLAGS) $(INCLUDES) zolists.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zolists.cpp + + zgui_main_menu_base.o: zgui_main_menu_base.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) zgui_main_menu_base.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zgui_main_menu_base.cpp + + zgui_main_menu_widget.o: zgui_main_menu_widget.cpp zgui_main_menu_widgets.h +- $(CC) $(CFLAGS) $(INCLUDES) zgui_main_menu_widget.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zgui_main_menu_widget.cpp + + #core files ----------------------------------- + + zcore.o: zcore.cpp zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zcore.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zcore.cpp + + zserver.o: zserver.cpp zserver.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zserver.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zserver.cpp + + zserver_events.o: zserver_events.cpp zserver.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zserver_events.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zserver_events.cpp + + zserver_commands.o: zserver_commands.cpp zserver.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zserver_commands.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zserver_commands.cpp + + zclient.o: zclient.cpp zclient.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zclient.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zclient.cpp + + zplayer.o: zplayer.cpp zplayer.h zclient.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zplayer.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zplayer.cpp + + zplayer_events.o: zplayer_events.cpp zplayer.h zclient.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zplayer_events.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zplayer_events.cpp + + zbot.o: zbot.cpp zbot.h zclient.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zbot.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zbot.cpp + + zbot_events.o: zbot_events.cpp zbot.h zclient.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) zbot_events.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zbot_events.cpp + + ztray.o: ztray.cpp ztray.h zclient.h zcore.h event_handler.h +- $(CC) $(CFLAGS) $(INCLUDES) ztray.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ztray.cpp + + SDL_rotozoom.o: SDL_rotozoom.cpp SDL_rotozoom.h +- $(CC) $(CFLAGS) $(INCLUDES) SDL_rotozoom.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) SDL_rotozoom.cpp + + #effect files --------------------------------- + + ebullet.o: ebullet.cpp ebullet.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) ebullet.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ebullet.cpp + + elaser.o: elaser.cpp elaser.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) elaser.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) elaser.cpp + + eflame.o: eflame.cpp eflame.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) eflame.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) eflame.cpp + + epyrofire.o: epyrofire.cpp epyrofire.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) epyrofire.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) epyrofire.cpp + + etoughrocket.o: etoughrocket.cpp etoughrocket.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etoughrocket.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etoughrocket.cpp + + etoughmushroom.o: etoughmushroom.cpp etoughmushroom.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etoughmushroom.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etoughmushroom.cpp + + etoughsmoke.o: etoughsmoke.cpp etoughsmoke.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etoughsmoke.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etoughsmoke.cpp + + elightrocket.o: elightrocket.cpp elightrocket.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) elightrocket.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) elightrocket.cpp + + elightinitfire.o: elightinitfire.cpp elightinitfire.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) elightinitfire.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) elightinitfire.cpp + + emomissilerockets.o: emomissilerockets.cpp emomissilerockets.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) emomissilerockets.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) emomissilerockets.cpp + + emissilecrockets.o: emissilecrockets.cpp emissilecrockets.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) emissilecrockets.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) emissilecrockets.cpp + + erobotdeath.o: erobotdeath.cpp erobotdeath.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) erobotdeath.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) erobotdeath.cpp + + eunitparticle.o: eunitparticle.cpp eunitparticle.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) eunitparticle.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) eunitparticle.cpp + + edeath.o: edeath.cpp edeath.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) edeath.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) edeath.cpp + + estandard.o: estandard.cpp estandard.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) estandard.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) estandard.cpp + + edeathsparks.o: edeathsparks.cpp edeathsparks.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) edeathsparks.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) edeathsparks.cpp + + eturrentmissile.o: eturrentmissile.cpp eturrentmissile.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) eturrentmissile.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) eturrentmissile.cpp + + esideexplosion.o: esideexplosion.cpp esideexplosion.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) esideexplosion.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) esideexplosion.cpp + + ecannondeath.o: ecannondeath.cpp ecannondeath.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) ecannondeath.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ecannondeath.cpp + + erockparticle.o: erockparticle.cpp erockparticle.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) erockparticle.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) erockparticle.cpp + + erockturrent.o: erockturrent.cpp erockturrent.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) erockturrent.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) erockturrent.cpp + + emapobjectturrent.o: emapobjectturrent.cpp emapobjectturrent.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) emapobjectturrent.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) emapobjectturrent.cpp + + ebridgeturrent.o: ebridgeturrent.cpp ebridgeturrent.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) ebridgeturrent.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ebridgeturrent.cpp + + ecraneconco.o: ecraneconco.cpp ecraneconco.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) ecraneconco.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ecraneconco.cpp + + erobotturrent.o: erobotturrent.cpp erobotturrent.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) erobotturrent.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) erobotturrent.cpp + + etrack.o: etrack.cpp etrack.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etrack.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etrack.cpp + + etankdirt.o: etankdirt.cpp etankdirt.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etankdirt.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etankdirt.cpp + + etanksmoke.o: etanksmoke.cpp etanksmoke.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etanksmoke.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etanksmoke.cpp + + etankoil.o: etankoil.cpp etankoil.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etankoil.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etankoil.cpp + + etankspark.o: etankspark.cpp etankspark.h zsdl.h zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) etankspark.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) etankspark.cpp + + #robot files ---------------------------------- + + rgrunt.o: rgrunt.cpp rgrunt.h zrobot.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) rgrunt.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) rgrunt.cpp + + rpsycho.o: rpsycho.cpp rpsycho.h zrobot.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) rpsycho.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) rpsycho.cpp + + rtough.o: rtough.cpp rtough.h zrobot.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) rtough.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) rtough.cpp + + rsniper.o: rsniper.cpp rsniper.h zrobot.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) rsniper.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) rsniper.cpp + + rpyro.o: rpyro.cpp rpyro.h zrobot.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) rpyro.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) rpyro.cpp + + rlaser.o: rlaser.cpp rlaser.h zrobot.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) rlaser.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) rlaser.cpp + + #vehicle files -------------------------------- + + vjeep.o: vjeep.cpp vjeep.h zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) vjeep.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) vjeep.cpp + + vlight.o: vlight.cpp vlight.h zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) vlight.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) vlight.cpp + + vmedium.o: vmedium.cpp vmedium.h zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) vmedium.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) vmedium.cpp + + vheavy.o: vheavy.cpp vheavy.h zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) vheavy.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) vheavy.cpp + + vmissilelauncher.o: vmissilelauncher.cpp vmissilelauncher.h zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) vmissilelauncher.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) vmissilelauncher.cpp + + vapc.o: vapc.cpp vapc.h zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) vapc.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) vapc.cpp + + vcrane.o: vcrane.cpp vcrane.h zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) vcrane.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) vcrane.cpp + + #cannon files --------------------------------- + + cgatling.o: cgatling.cpp cgatling.h zcannon.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) cgatling.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) cgatling.cpp + + cgun.o: cgun.cpp cgun.h zcannon.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) cgun.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) cgun.cpp + + chowitzer.o: chowitzer.cpp chowitzer.h zcannon.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) chowitzer.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) chowitzer.cpp + + cmissilecannon.o: cmissilecannon.cpp cmissilecannon.h zcannon.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) cmissilecannon.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) cmissilecannon.cpp + + #building files ------------------------------- + + bfort.o: bfort.cpp bfort.h zbuilding.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) bfort.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) bfort.cpp + + brobot.o: brobot.cpp brobot.h zbuilding.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) brobot.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) brobot.cpp + + bvehicle.o: bvehicle.cpp bvehicle.h zbuilding.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) bvehicle.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) bvehicle.cpp + + bradar.o: bradar.cpp bradar.h zbuilding.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) bradar.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) bradar.cpp + + brepair.o: brepair.cpp brepair.h zbuilding.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) brepair.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) brepair.cpp + + bbridge.o: bbridge.cpp bbridge.h zbuilding.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) bbridge.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) bbridge.cpp + + #object files --------------------------------- + + zmap.o: zmap.cpp zmap.h constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zmap.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zmap.cpp + + zmap_crater_graphics.o: zmap_crater_graphics.cpp constants.h zsdl.h +- $(CC) $(CFLAGS) $(INCLUDES) zmap_crater_graphics.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zmap_crater_graphics.cpp + + zeffect.o: zeffect.cpp zeffect.h +- $(CC) $(CFLAGS) $(INCLUDES) zeffect.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zeffect.cpp + + zobject.o: zobject.cpp zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) zobject.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zobject.cpp + + zrobot.o: zrobot.cpp zrobot.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) zrobot.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zrobot.cpp + + zbuilding.o: zbuilding.cpp zbuilding.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) zbuilding.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zbuilding.cpp + + zcannon.o: zcannon.cpp zcannon.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) zcannon.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zcannon.cpp + + zvehicle.o: zvehicle.cpp zvehicle.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) zvehicle.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) zvehicle.cpp + + oflag.o: oflag.cpp oflag.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) oflag.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) oflag.cpp + + orock.o: orock.cpp orock.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) orock.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) orock.cpp + + ogrenades.o: ogrenades.cpp ogrenades.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) ogrenades.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ogrenades.cpp + + orockets.o: orockets.cpp orockets.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) orockets.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) orockets.cpp + + ohut.o: ohut.cpp ohut.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) ohut.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ohut.cpp + + omapobject.o: omapobject.cpp omapobject.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) omapobject.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) omapobject.cpp + + abird.o: abird.cpp abird.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) abird.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) abird.cpp + + ahutanimal.o: ahutanimal.cpp ahutanimal.h zobject.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) ahutanimal.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) ahutanimal.cpp + + #gui files --------------------------------- + + gwproduction.o: gwproduction.cpp gwproduction.h zgui_window.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) gwproduction.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gwproduction.cpp + + gwproduction_us.o: gwproduction_us.cpp gwproduction.h zgui_window.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) gwproduction_us.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gwproduction_us.cpp + + gwproduction_fus.o: gwproduction_fus.cpp gwproduction.h zgui_window.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) gwproduction_fus.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gwproduction_fus.cpp + + gwlogin.o: gwlogin.cpp gwlogin.h zgui_window.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) gwlogin.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gwlogin.cpp + + gwcreateuser.o: gwcreateuser.cpp gwcreateuser.h zgui_window.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) gwcreateuser.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gwcreateuser.cpp + + gwfactory_list.o: gwfactory_list.cpp gwfactory_list.h zgui_window.h constants.h zsdl.h zmap.h common.h +- $(CC) $(CFLAGS) $(INCLUDES) gwfactory_list.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gwfactory_list.cpp + + gmm_change_teams.o: gmm_change_teams.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) gmm_change_teams.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmm_change_teams.cpp + + gmm_main_menu.o: gmm_main_menu.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) gmm_main_menu.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmm_main_menu.cpp + + gmm_manage_bots.o: gmm_manage_bots.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) gmm_manage_bots.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmm_manage_bots.cpp + + gmm_player_list.o: gmm_player_list.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) gmm_player_list.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmm_player_list.cpp + + gmm_select_map.o: gmm_select_map.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) gmm_select_map.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmm_select_map.cpp + + gmm_options.o: gmm_options.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) gmm_options.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmm_options.cpp + + gmm_warning.o: gmm_warning.cpp zgui_main_menu_base.h +- $(CC) $(CFLAGS) $(INCLUDES) gmm_warning.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmm_warning.cpp + + gmmw_button.o: gmmw_button.cpp zgui_main_menu_widgets.h +- $(CC) $(CFLAGS) $(INCLUDES) gmmw_button.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmmw_button.cpp + + gmmw_label.o: gmmw_label.cpp zgui_main_menu_widgets.h +- $(CC) $(CFLAGS) $(INCLUDES) gmmw_label.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmmw_label.cpp + + gmmw_list.o: gmmw_list.cpp zgui_main_menu_widgets.h +- $(CC) $(CFLAGS) $(INCLUDES) gmmw_list.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmmw_list.cpp + + gmmw_radio.o: gmmw_radio.cpp zgui_main_menu_widgets.h +- $(CC) $(CFLAGS) $(INCLUDES) gmmw_radio.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmmw_radio.cpp + + gmmw_team_color.o: gmmw_team_color.cpp zgui_main_menu_widgets.h +- $(CC) $(CFLAGS) $(INCLUDES) gmmw_team_color.cpp ++ $(CXX) -c $(CXXFLAGS) $(INCLUDES) gmmw_team_color.cpp + + zip: + zip zod_src_${DATE}.zip *.cpp *.h makefile +--- zod_engine/zod_launcher_src/makefile ++++ zod_engine/zod_launcher_src/makefile +@@ -1,2 +1,11 @@ ++CXX ?= g++ ++CXXFLAGS += `wx-config --cppflags` ++LIBS += `wx-config --libs` ++EXENAME = zod_launcher ++ ++ifdef DATA_PATH ++ CXXFLAGS += -DDATA_PATH=\"$(DATA_PATH)\" ++endif ++ + default: +- g++ -g -o zod_launcher *.cpp `wx-config --cppflags` `wx-config --libs` ++ $(CXX) $(CXXFLAGS) -o $(EXENAME) *.cpp $(LDFLAGS) $(LIBS) diff --git a/packages/games-strategy/zod-engine/files/zod-engine-20110906-proper-linux-support.patch b/packages/games-strategy/zod-engine/files/zod-engine-20110906-proper-linux-support.patch new file mode 100644 index 00000000..5ba559f4 --- /dev/null +++ b/packages/games-strategy/zod-engine/files/zod-engine-20110906-proper-linux-support.patch @@ -0,0 +1,1390 @@ +diff -burN zod_engine/zod_launcher_src/common.cpp zod_engine.new/zod_launcher_src/common.cpp +--- zod_engine/zod_launcher_src/common.cpp 2011-03-22 12:05:11.000000000 +0100 ++++ zod_engine.new/zod_launcher_src/common.cpp 2012-05-05 22:50:56.000000000 +0200 +@@ -9,24 +9,216 @@ + #include + #include + #include ++ ++#define OSPATH_SEP '\\' ++ + #else + #include + #include + #include ++ ++#define OSPATH_SEP '/' ++ + #endif + + namespace COMMON + { + +-void create_folder(char *foldername) ++//base data path for the engine ++static char base_path[FILENAME_MAX]; ++//home (user specific) data path for the engine ++static char home_path[FILENAME_MAX]; ++ ++static bool path_concat(const char *base, const char *file, char *dest) ++{ ++ size_t i; ++ size_t len; ++ char c; ++ bool was_sep; ++ ++ // base path is an OS specific path ++ len = 0; ++ for (i = 0; len < (FILENAME_MAX - 1) && base[i] != '\0'; i++) ++ dest[len++] = base[i]; ++ ++ // this also catches base[i] != '\0' ++ if (len == (FILENAME_MAX - 1)) ++ return false; ++ ++ ++ // ensure base is terminated by OSPATH_SEP ++ if (len == 0 || dest[len - 1] != OSPATH_SEP) ++ dest[len++] = OSPATH_SEP; ++ ++ was_sep = true; ++ ++ // file name could have both '/' or '\\' for path separation ++ for (i = 0; len < (FILENAME_MAX - 1) && file[i] != '\0'; i++) { ++ char c = file[i]; ++ if (c == '/' || c == '\\') { ++ // ignore double separators ++ if (was_sep) ++ continue; ++ ++ c = OSPATH_SEP; ++ was_sep = true; ++ } else { ++ was_sep = false; ++ } ++ ++ dest[len++] = c; ++ } ++ ++ if (file[i] != '\0') ++ return false; ++ ++ dest[len] = '\0'; ++ return true; ++} ++ ++static bool file_exists(const char*filename) ++{ ++#ifdef _WIN32 ++ DWORD attrs = GetFileAttributes(filename); ++ return (attrs != INVALID_FILE_ATTRIBUTES); ++ ++#else ++ ++ return (access(filename, R_OK) == 0); ++ ++#endif ++ ++} ++ ++void init_file_paths(const char *bin_path) + { +-#ifdef WIN32 //if windows ++ base_path[0] = '\0'; ++ ++#ifdef DATA_PATH ++ //compilation defined base path, ignore if too long ++ if (strlen(DATA_PATH) < FILENAME_MAX) ++ strcpy(base_path, DATA_PATH); ++#endif ++ ++ if (base_path[0] == '\0' && bin_path && bin_path[0] != '\0') { ++ //default to binary path dirname ++ char dirname[FILENAME_MAX]; ++ size_t len; ++ ++ len = strlen(bin_path); ++ if (len < FILENAME_MAX) { ++ strcpy(base_path, bin_path); ++ //find the last separator ++ do len--; while (len > 0 && base_path[len] != OSPATH_SEP); ++ ++ base_path[len] = '\0'; ++ } ++ } ++ ++ // if no explicit directory is specified ++ // default to current working directory ++ if (base_path[0] == '\0') ++ strcpy(base_path, "."); ++ ++ // get home path ++ home_path[0] = '\0'; ++ ++#ifdef _WIN32 ++ // on Windows home path is equivalent to base path ++ strcpy(home_path, base_path); ++ ++#else ++ // on Unix platforms use a specific directory in home ++ const char *home = getenv("HOME"); ++ if (home && home[0] != '\0') { ++ if (path_concat(home, ".zod-engine", home_path)) ++ create_folder(home_path); ++ else ++ home_path[0] = '\0'; ++ } ++ ++#endif ++ ++} ++ ++void create_folder(const char *foldername) ++{ ++#ifdef _WIN32 //if windows + mkdir(foldername); + #else + mkdir(foldername,-1); + #endif + } + ++FILE *open_file_read(const char *filename, bool binary) ++{ ++ char path[FILENAME_MAX]; ++ const char *mode; ++ FILE *fp; ++ ++ fp = NULL; ++ mode = (binary)? "rb" : "r"; ++ if (home_path[0] != '\0') { ++ // if home directory is available, pick the file from there, ++ // as there is where we can find user specific overrides ++ // of our files ++ if (path_concat(home_path, filename, path)) ++ fp = fopen(path, mode); ++ } ++ ++ if (!fp) { ++ // retrieve the file from the data directory ++ if (path_concat(base_path, filename, path)) ++ fp = fopen(path, mode); ++ } ++ ++ return fp; ++} ++ ++FILE *open_file_write(const char *filename, bool binary, bool append) ++{ ++ FILE *fp = NULL; ++ if (home_path[0] != '\0') { ++ //files can only be created in home path ++ char path[FILENAME_MAX]; ++ ++ if (path_concat(home_path, filename, path)) { ++ // determine open mode ++ char mode[3]; ++ ++ mode[0] = (append)? 'a' : 'w'; ++ mode[1] = (binary)? 'b' : '\0'; ++ mode[2] = '\0'; ++ fp = fopen(path, mode); ++ } ++ } ++ ++ return fp; ++} ++ ++bool get_os_path(const char *filename, bool read_only, char *dest) ++{ ++ ++ if (read_only) ++ { ++ if (home_path[0]) ++ { ++ if (path_concat(home_path, filename, dest) && file_exists(dest)) ++ return true; ++ } ++ ++ return path_concat(base_path, filename, dest) && file_exists(dest); ++ ++ } ++ else ++ { ++ if (home_path[0] != '\0') ++ return path_concat(home_path, filename, dest); ++ else ++ return false; ++ } ++} ++ + double current_time() + { + #ifdef WIN32 +diff -burN zod_engine/zod_launcher_src/common.h zod_engine.new/zod_launcher_src/common.h +--- zod_engine/zod_launcher_src/common.h 2011-03-22 12:05:11.000000000 +0100 ++++ zod_engine.new/zod_launcher_src/common.h 2012-05-05 22:51:24.000000000 +0200 +@@ -3,11 +3,16 @@ + + namespace COMMON + { ++ ++ extern void init_file_paths(const char *bin_path); ++ extern bool get_os_path(const char *filename, bool read_only, char *dest); ++ extern void create_folder(const char *foldername); ++ extern FILE *open_file_read(const char *filename, bool binary); ++ extern FILE *open_file_write(const char *filename, bool binary, bool append); + extern void split(char *dest, char *message, char split, int *initial, int d_size, int m_size); + extern void clean_newline(char *message, int size); + extern void lcase(char *message, int m_size); + extern double current_time(); +- extern void create_folder(char *foldername); + extern void uni_pause(int m_sec); + extern char *wtoc_s(const wchar_t *input); + extern char *wtoc(const wchar_t *input, char *dest, int size); +diff -burN zod_engine/zod_launcher_src/store_settings.cpp zod_engine.new/zod_launcher_src/store_settings.cpp +--- zod_engine/zod_launcher_src/store_settings.cpp 2011-03-22 12:05:11.000000000 +0100 ++++ zod_engine.new/zod_launcher_src/store_settings.cpp 2012-05-06 16:14:49.000000000 +0200 +@@ -11,7 +11,7 @@ + { + FILE *fp; + +- fp = fopen("zod_launcher_settings.txt", "w"); ++ fp = open_file_write("zod_launcher_settings.txt", false, false); + + if(!fp) return; + +@@ -45,7 +45,7 @@ + { + FILE *fp; + +- fp = fopen("zod_launcher_settings.txt", "r"); ++ fp = open_file_read("zod_launcher_settings.txt", false); + + if(!fp) return; + +I file binari zod_engine/zod_launcher_src/zod_launcher e zod_engine.new/zod_launcher_src/zod_launcher sono diversi +diff -burN zod_engine/zod_launcher_src/zod_launcherApp.cpp zod_engine.new/zod_launcher_src/zod_launcherApp.cpp +--- zod_engine/zod_launcher_src/zod_launcherApp.cpp 2011-03-22 12:05:11.000000000 +0100 ++++ zod_engine.new/zod_launcher_src/zod_launcherApp.cpp 2012-05-05 22:32:45.000000000 +0200 +@@ -9,11 +9,17 @@ + + #include "zod_launcherApp.h" + #include "zod_launcherFrm.h" ++#include "common.h" + + IMPLEMENT_APP(zod_launcherFrmApp) + + bool zod_launcherFrmApp::OnInit() + { ++ // initialize file system ++ wxString bin_path(argv[0]); ++ COMMON::init_file_paths(bin_path.mb_str(wxConvUTF8)); ++ ++ // create form + zod_launcherFrm* frame = new zod_launcherFrm(NULL); + SetTopWindow(frame); + frame->Show(); +diff -burN zod_engine/zod_launcher_src/zod_launcherFrm.cpp zod_engine.new/zod_launcher_src/zod_launcherFrm.cpp +--- zod_engine/zod_launcher_src/zod_launcherFrm.cpp 2011-03-22 12:35:01.000000000 +0100 ++++ zod_engine.new/zod_launcher_src/zod_launcherFrm.cpp 2012-05-06 16:16:19.000000000 +0200 +@@ -10,6 +10,7 @@ + + #include "zod_launcherFrm.h" + #include "store_settings.h" ++#include "common.h" + + //Do not add custom headers between + //Header Include Start and Header Include End +@@ -215,7 +216,7 @@ + #ifdef _WIN32 + message = wxT("zod_engine.exe"); + #else +- message = wxT("./zod"); ++ message = wxT("zod"); + #endif + + if(WxEdit1->GetValue().length()) +diff -burN zod_engine/zod_src/cgatling.cpp zod_engine.new/zod_src/cgatling.cpp +--- zod_engine/zod_src/cgatling.cpp 2011-09-06 17:35:10.000000000 +0200 ++++ zod_engine.new/zod_src/cgatling.cpp 2012-05-05 17:26:16.000000000 +0200 +@@ -53,7 +53,7 @@ + for(j=0;j + #include + #include ++#include + #include "common.h" + + #ifdef _WIN32 + #include + #include + #include ++ ++#define OSPATH_SEP '\\' ++ + #else + #include + #include +@@ -16,20 +20,257 @@ + #include + #include + #include ++ ++#define OSPATH_SEP '/' ++ + #endif + + namespace COMMON + { + +-void create_folder(char *foldername) ++//base data path for the engine ++static char base_path[FILENAME_MAX]; ++//home (user specific) data path for the engine ++static char home_path[FILENAME_MAX]; ++ ++static bool path_concat(const char *base, const char *file, char *dest) ++{ ++ size_t i; ++ size_t len; ++ char c; ++ bool was_sep; ++ ++ // base path is an OS specific path ++ len = 0; ++ for (i = 0; len < (FILENAME_MAX - 1) && base[i] != '\0'; i++) ++ dest[len++] = base[i]; ++ ++ // this also catches base[i] != '\0' ++ if (len == (FILENAME_MAX - 1)) ++ return false; ++ ++ ++ // ensure base is terminated by OSPATH_SEP ++ if (len == 0 || dest[len - 1] != OSPATH_SEP) ++ dest[len++] = OSPATH_SEP; ++ ++ was_sep = true; ++ ++ // file name could have both '/' or '\\' for path separation ++ for (i = 0; len < (FILENAME_MAX - 1) && file[i] != '\0'; i++) { ++ char c = file[i]; ++ if (c == '/' || c == '\\') { ++ // ignore double separators ++ if (was_sep) ++ continue; ++ ++ c = OSPATH_SEP; ++ was_sep = true; ++ } else { ++ was_sep = false; ++ } ++ ++ dest[len++] = c; ++ } ++ ++ if (file[i] != '\0') ++ return false; ++ ++ dest[len] = '\0'; ++ return true; ++} ++ ++static vector scan_folder(string foldername) ++{ ++ vector list; ++ ++#ifdef _WIN32 ++ ++ HANDLE hFind = INVALID_HANDLE_VALUE; ++ WIN32_FIND_DATA ffd; ++ ++ foldername += "*"; ++ ++ hFind = FindFirstFile(foldername.c_str(), &ffd); ++ ++ if(INVALID_HANDLE_VALUE == hFind) return filelist; ++ ++ do ++ { ++ if(!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) ++ list.push_back((char*)ffd.cFileName); ++ } ++ while (FindNextFile(hFind, &ffd) != 0); ++ ++ FindClose(hFind); ++ ++#else ++ ++ DIR *dp; ++ struct dirent *dirp; ++ ++ dp = opendir(foldername.c_str()); ++ ++ if (dp) { ++ ++ while ((dirp = readdir(dp)) != NULL) ++ { ++ if(dirp->d_type == DT_REG) ++ list.push_back(dirp->d_name); ++ } ++ ++ closedir(dp); ++ } ++ ++#endif ++ ++ return list; ++} ++ ++static bool file_exists(const char*filename) ++{ ++#ifdef _WIN32 ++ ++ DWORD attrs = GetFileAttributes(filename); ++ return (attrs != INVALID_FILE_ATTRIBUTES); ++ ++#else ++ ++ return (access(filename, R_OK) == 0); ++ ++#endif ++ ++} ++ ++void init_file_paths(const char *bin_path) ++{ ++ base_path[0] = '\0'; ++ ++#ifdef DATA_PATH ++ //compilation defined base path, ignore if too long ++ if (strlen(DATA_PATH) < FILENAME_MAX) ++ strcpy(base_path, DATA_PATH); ++#endif ++ ++ if (base_path[0] == '\0' && bin_path && bin_path[0] != '\0') { ++ //default to binary path dirname ++ char dirname[FILENAME_MAX]; ++ size_t len; ++ ++ len = strlen(bin_path); ++ if (len < FILENAME_MAX) { ++ strcpy(base_path, bin_path); ++ //find the last separator ++ do len--; while (len > 0 && base_path[len] != OSPATH_SEP); ++ ++ base_path[len] = '\0'; ++ } ++ } ++ ++ // if no explicit directory is specified ++ // default to current working directory ++ if (base_path[0] == '\0') ++ strcpy(base_path, "."); ++ ++ // get home path ++ home_path[0] = '\0'; ++ ++#ifdef _WIN32 ++ // on Windows home path is equivalent to base path ++ strcpy(home_path, base_path); ++ ++#else ++ // on Unix platforms use a specific directory in home ++ const char *home = getenv("HOME"); ++ if (home && home[0] != '\0') { ++ if (path_concat(home, ".zod-engine", home_path)) ++ create_folder(home_path); ++ else ++ home_path[0] = '\0'; ++ } ++ ++#endif ++ ++} ++ ++void create_folder(const char *foldername) + { +-#ifdef WIN32 //if windows ++#ifdef _WIN32 //if windows + mkdir(foldername); + #else + mkdir(foldername,-1); + #endif + } + ++bool get_os_path(const char *filename, bool read_only, char *dest) ++{ ++ ++ if (read_only) ++ { ++ if (home_path[0]) ++ { ++ if (path_concat(home_path, filename, dest) && file_exists(dest)) ++ return true; ++ } ++ ++ return path_concat(base_path, filename, dest) && file_exists(dest); ++ ++ } ++ else ++ { ++ if (home_path[0] != '\0') ++ return path_concat(home_path, filename, dest); ++ else ++ return false; ++ } ++} ++ ++FILE *open_file_read(const char *filename, bool binary) ++{ ++ char path[FILENAME_MAX]; ++ const char *mode; ++ FILE *fp; ++ ++ fp = NULL; ++ mode = (binary)? "rb" : "r"; ++ if (home_path[0] != '\0') { ++ // if home directory is available, pick the file from there, ++ // as there is where we can find user specific overrides ++ // of our files ++ if (path_concat(home_path, filename, path)) ++ fp = fopen(path, mode); ++ } ++ ++ if (!fp) { ++ // retrieve the file from the data directory ++ if (path_concat(base_path, filename, path)) ++ fp = fopen(path, mode); ++ } ++ ++ return fp; ++} ++ ++FILE *open_file_write(const char *filename, bool binary, bool append) ++{ ++ FILE *fp = NULL; ++ if (home_path[0] != '\0') { ++ //files can only be created in home path ++ char path[FILENAME_MAX]; ++ ++ if (path_concat(home_path, filename, path)) { ++ // determine open mode ++ char mode[3]; ++ ++ mode[0] = (append)? 'a' : 'w'; ++ mode[1] = (binary)? 'b' : '\0'; ++ mode[2] = '\0'; ++ fp = fopen(path, mode); ++ } ++ } ++ ++ return fp; ++} ++ + double current_time() + { + #ifdef WIN32 +@@ -139,7 +380,18 @@ + #ifdef _WIN32 //if windows + Sleep(m_sec); //win version + #else +- usleep(m_sec * 1000); //lin version ++ struct timespec ts; //use nanosleep() ++ int secs; ++ int mills; ++ int res; ++ ++ secs = m_sec / 1000; ++ mills = m_sec - secs * 1000; ++ ts.tv_sec = secs; ++ ts.tv_nsec = mills * 1000000L; ++ ++ do res = nanosleep(&ts, &ts); while (res == -1 && errno == EINTR); ++ + #endif + } + +@@ -229,7 +481,7 @@ + lt = time(NULL); + ptr = localtime(<); + +- ofp = fopen("reg_log.txt","a"); ++ ofp = open_file_write("reg_log.txt",false,true); + + strcpy(timebuf, asctime(ptr)); + clean_newline(timebuf, 100); +@@ -259,7 +511,7 @@ + { + FILE *fp; + +- fp = fopen(filename, "a"); ++ fp = open_file_write(filename, false, true); + + if(!fp) return false; + +@@ -270,51 +522,37 @@ + + vector directory_filelist(string foldername) + { +- vector filelist; ++ vector list; ++ vector base; ++ vector merged; ++ char path[FILENAME_MAX]; + +-#ifdef _WIN32 ++ // scan both base and home folders ++ if (path_concat(home_path, foldername.c_str(), path)) ++ list = scan_folder(path); + +- HANDLE hFind = INVALID_HANDLE_VALUE; +- WIN32_FIND_DATA ffd; ++ if (path_concat(base_path, foldername.c_str(), path)) ++ base = scan_folder(path); + +- foldername += "*"; ++ // for (size_t i=0;i::iterator el; + +- if(INVALID_HANDLE_VALUE == hFind) return filelist; ++ el = lower_bound(list.begin(), list.end(), base[i], sort_string_func); ++ if (el != list.end() && *el == base[i]) ++ continue; + +- do +- { +- if(!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) +- filelist.push_back((char*)ffd.cFileName); ++ merged.push_back(base[i]); + } +- while (FindNextFile(hFind, &ffd) != 0); +- +- FindClose(hFind); +- +-#else +- DIR *dp; +- struct dirent *dirp; +- +- if(!foldername.size()) foldername = "."; +- +- dp = opendir(foldername.c_str()); +- +- if(!dp) return filelist; +- +- while ((dirp = readdir(dp)) != NULL) +- { +- if(dirp->d_type == DT_REG) +- filelist.push_back(dirp->d_name); +- } +- +- closedir(dp); +- +-#endif + +- //for(int i=0;i &filelist, string extension) +diff -burN zod_engine/zod_src/common.h zod_engine.new/zod_src/common.h +--- zod_engine/zod_src/common.h 2011-09-06 17:35:07.000000000 +0200 ++++ zod_engine.new/zod_src/common.h 2012-05-05 20:39:00.000000000 +0200 +@@ -1,6 +1,7 @@ + #ifndef _COMMON_H_ + #define _COMMON_H_ + ++#include + #include + #include + #include +@@ -19,12 +20,16 @@ + int x, y; + }; + ++ extern void init_file_paths(const char *bin_path); ++ extern bool get_os_path(const char *filename, bool read_only, char*dest); ++ extern FILE *open_file_read(const char *filename, bool binary); ++ extern FILE *open_file_write(const char *filename, bool binary, bool append); + extern void split(char *dest, char *message, char split, int *initial, int d_size, int m_size); + extern void clean_newline(char *message, int size); + extern void lcase(char *message, int m_size); + extern void lcase(string &message); + extern double current_time(); +- extern void create_folder(char *foldername); ++ extern void create_folder(const char *foldername); + extern void uni_pause(int m_sec); + extern char *wtoc_s(const wchar_t *input); + extern char *wtoc(const wchar_t *input, char *dest, int size); +diff -burN zod_engine/zod_src/cursor.cpp zod_engine.new/zod_src/cursor.cpp +--- zod_engine/zod_src/cursor.cpp 2011-09-06 17:35:10.000000000 +0200 ++++ zod_engine.new/zod_src/cursor.cpp 2012-05-05 17:31:02.000000000 +0200 +@@ -24,56 +24,56 @@ + cursor[CURSOR_C][0][j].LoadBaseImage(filename_c); + + sprintf(filename_c, "assets/cursors/placed_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[PLACED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[PLACE_C][0][j].LoadBaseImage(temp_surface); + //cursor[PLACED_C][0][j] = IMG_Load_Error(filename_c); + //cursor[PLACE_C][0][j] = cursor[PLACED_C][0][j]; + + sprintf(filename_c, "assets/cursors/attacked_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[ATTACKED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[ATTACK_C][0][j].LoadBaseImage(temp_surface); + //cursor[ATTACKED_C][0][j] = IMG_Load_Error(filename_c); + //cursor[ATTACK_C][0][j] = cursor[ATTACKED_C][0][j]; + + sprintf(filename_c, "assets/cursors/grabbed_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[GRABBED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[GRAB_C][0][j].LoadBaseImage(temp_surface); + //cursor[GRABBED_C][0][j] = IMG_Load_Error(filename_c); + //cursor[GRAB_C][0][j] = cursor[GRABBED_C][0][j]; + + sprintf(filename_c, "assets/cursors/grenaded_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[GRENADED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[GRENADE_C][0][j].LoadBaseImage(temp_surface); + //cursor[GRENADED_C][0][j] = IMG_Load_Error(filename_c); + //cursor[GRENADE_C][0][j] = cursor[GRENADED_C][0][j]; + + sprintf(filename_c, "assets/cursors/repaired_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[REPAIRED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[REPAIR_C][0][j].LoadBaseImage(temp_surface); + //cursor[REPAIRED_C][0][j] = IMG_Load_Error(filename_c); + //cursor[REPAIR_C][0][j] = cursor[REPAIRED_C][0][j]; + + sprintf(filename_c, "assets/cursors/entered_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[ENTERED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[ENTER_C][0][j].LoadBaseImage(temp_surface); + //cursor[ENTERED_C][0][j] = IMG_Load_Error(filename_c); + //cursor[ENTER_C][0][j] = cursor[ENTERED_C][0][j]; + + sprintf(filename_c, "assets/cursors/exited_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[EXITED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[EXIT_C][0][j].LoadBaseImage(temp_surface); + //cursor[EXITED_C][0][j] = IMG_Load_Error(filename_c); + //cursor[EXIT_C][0][j] = cursor[EXITED_C][0][j]; + + sprintf(filename_c, "assets/cursors/cannoned_n%02d.png", j); +- temp_surface = IMG_Load(filename_c); ++ temp_surface = ZSDL_IMG_Load(filename_c, false); + cursor[CANNONED_C][0][j].LoadBaseImage(temp_surface, false); + cursor[CANNON_C][0][j].LoadBaseImage(temp_surface); + //cursor[CANNONED_C][0][j] = IMG_Load_Error(filename_c); +diff -burN zod_engine/zod_src/main.cpp zod_engine.new/zod_src/main.cpp +--- zod_engine/zod_src/main.cpp 2011-09-06 17:35:11.000000000 +0200 ++++ zod_engine.new/zod_src/main.cpp 2012-05-05 17:49:03.000000000 +0200 +@@ -42,7 +42,7 @@ + + printf("Welcome to the Zod Engine\n"); + +- if(argc<=1) starting_conditions.setdefaults(); ++ if(argc==1) starting_conditions.setdefaults(); + + //read in the arguments + starting_conditions.getoptions(argc, argv); +@@ -51,6 +51,9 @@ + //like we are trying to make a dedicated server that is supposed to connect to another server + starting_conditions.checkoptions(); + ++ //init engine search paths ++ COMMON::init_file_paths(argv[0]); ++ + //init this for the bots + ZCore::CreateRandomBotBypassData(bot_bypass_data, bot_bypass_size); + +diff -burN zod_engine/zod_src/map_editor.cpp zod_engine.new/zod_src/map_editor.cpp +--- zod_engine/zod_src/map_editor.cpp 2011-09-06 17:35:11.000000000 +0200 ++++ zod_engine.new/zod_src/map_editor.cpp 2012-05-05 21:50:20.000000000 +0200 +@@ -270,6 +270,8 @@ + //check if args ok + if(!checkargs(argv[0])) return 0; + ++ //init filesystem search paths ++ COMMON::init_file_paths(argv[0]); + //init SDL + SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); + screen = SDL_SetVideoMode(800,600,32,SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_RESIZABLE); +@@ -287,8 +289,15 @@ + ZSDL_Surface::SetHasHud(false); + + //TTF ++ char path[FILENAME_MAX]; ++ + TTF_Init(); +- ttf_font = TTF_OpenFont("assets/arial.ttf",10); ++ ttf_font = NULL; ++ if (COMMON::get_os_path("assets/arial.ttf", true, path)) ++ { ++ ttf_font = TTF_OpenFont(path,10); ++ } ++ + if (!ttf_font) printf("could not load arial.ttf\n"); + + //init stuff +@@ -499,10 +508,8 @@ + //save the map + { + bmp_filename = filename + ".bmp"; +- + printf("saving map screenshot: '%s'\n", bmp_filename.c_str()); +- +- SDL_SaveBMP(print_surface, bmp_filename.c_str()); ++ ZSDL_SaveBMP(print_surface, filename); + } + + SDL_FreeSurface(print_surface); +diff -burN zod_engine/zod_src/map_merger.cpp zod_engine.new/zod_src/map_merger.cpp +--- zod_engine/zod_src/map_merger.cpp 2011-09-06 17:35:11.000000000 +0200 ++++ zod_engine.new/zod_src/map_merger.cpp 2012-05-05 16:17:15.000000000 +0200 +@@ -16,6 +16,9 @@ + return 0; + } + ++ //init filesystem paths ++ COMMON::init_file_paths(argv[0]); ++ + printf("argc:%d\n", argc); + printf("output_map:'%s'\n", argv[1]); + printf("direction:'%s'\n", argv[2]); +diff -burN zod_engine/zod_src/ogrenades.cpp zod_engine.new/zod_src/ogrenades.cpp +--- zod_engine/zod_src/ogrenades.cpp 2011-09-06 17:35:11.000000000 +0200 ++++ zod_engine.new/zod_src/ogrenades.cpp 2012-05-05 17:28:25.000000000 +0200 +@@ -24,7 +24,7 @@ + + void OGrenades::Init() + { +- render_img.LoadBaseImage("assets/other/map_items/grenades.png");// = ZSDL_IMG_Load("assets/other/map_items/grenades.png"); ++ render_img.LoadBaseImage("assets/other/map_items/grenades.png");// = ZSDL_IMG_Load("assets/other/map_items/grenades.png", true); + } + + void OGrenades::DoRender(ZMap &the_map, SDL_Surface *dest, int shift_x, int shift_y) +diff -burN zod_engine/zod_src/ohut.cpp zod_engine.new/zod_src/ohut.cpp +--- zod_engine/zod_src/ohut.cpp 2011-09-06 17:35:11.000000000 +0200 ++++ zod_engine.new/zod_src/ohut.cpp 2012-05-05 17:28:13.000000000 +0200 +@@ -42,7 +42,7 @@ + for(i=0;imap_name.c_str(), "rb"); ++ fp = COMMON::open_file_read(p->map_name.c_str(), true); + + if(fp) + { +diff -burN zod_engine/zod_src/zsettings.cpp zod_engine.new/zod_src/zsettings.cpp +--- zod_engine/zod_src/zsettings.cpp 2011-09-06 17:35:08.000000000 +0200 ++++ zod_engine.new/zod_src/zsettings.cpp 2012-05-05 16:31:45.000000000 +0200 +@@ -393,7 +393,7 @@ + { + FILE *fp; + +- fp = fopen(filename.c_str(), "r"); ++ fp = COMMON::open_file_read(filename.c_str(), false); + + if(!fp) + { +@@ -555,7 +555,7 @@ + { + FILE *fp; + +- fp = fopen(filename.c_str(), "w"); ++ fp = COMMON::open_file_write(filename.c_str(), false, false); + + if(!fp) + { +diff -burN zod_engine/zod_src/zteam.cpp zod_engine.new/zod_src/zteam.cpp +--- zod_engine/zod_src/zteam.cpp 2011-09-06 17:35:07.000000000 +0200 ++++ zod_engine.new/zod_src/zteam.cpp 2012-05-05 17:31:56.000000000 +0200 +@@ -113,7 +113,7 @@ + } + + //save surface +- SDL_SaveBMP(src, filename.c_str()); ++ ZSDL_SaveBMP(src, filename); + + //free surface + SDL_FreeSurface(src); +@@ -264,7 +264,7 @@ + if(team == ZTEAM_BASE_TEAM) return; + + filename = "assets/teams/" + team_type_string[team] + "_palette.bmp"; +- surface = IMG_Load(filename.c_str()); ++ surface = ZSDL_IMG_Load(filename.c_str(), false); + + if(!surface) + { +@@ -294,7 +294,7 @@ + + team_palette[team].SaveSurfacePalette(filename); + +- //SDL_SaveBMP(team_palette[team], filename.c_str()); ++ //ZSDL_SaveBMP(team_palette[team], filename); + } + + void ZTeam::SaveAllPalettes() diff --git a/packages/games-strategy/zod-engine/zod-engine-20110906.exheres-0 b/packages/games-strategy/zod-engine/zod-engine-20110906.exheres-0 new file mode 100644 index 00000000..2a26a523 --- /dev/null +++ b/packages/games-strategy/zod-engine/zod-engine-20110906.exheres-0 @@ -0,0 +1,75 @@ +# Copyright 2016 Julian Ospald +# Distributed under the terms of the GNU General Public License v2 + +require gtk-icon-cache + +MY_P=zod_linux-${PV:0:4}-${PV:4:2}-${PV:6:2} +DESCRIPTION="Zod engine is a remake of the 1996 classic game by Bitmap Brothers called Z" +HOMEPAGE="http://zod.sourceforge.net/" +DOWNLOADS="mirror://sourceforge/zod/linux_releases/${MY_P}.tar.gz" + +LICENCES="all-rights-reserved GPL-3 LGPL-2.1" +SLOT="0" +PLATFORMS="~amd64 ~x86" + +DEPENDENCIES=" + build+run: + media-libs/SDL:0[X] + media-libs/SDL_image:1 + media-libs/SDL_ttf:0 + media-libs/SDL_mixer:0[midi][ogg] + virtual/mysql + x11-libs/wxGTK:2.8 +" + +WORK=${WORKBASE}/zod_engine + +# patches are upstreamed +DEFAULT_SRC_PREPARE_PATCHES=( + "${FILES}"/${PNV}-build.patch + "${FILES}"/${PNV}-proper-linux-support.patch +) + +src_prepare() { + default + + # remove unused files + edo find "${WORK}" -type f \( -name Thumbs.db -o -name "*.xcf" -o -name "*.ico" \) -delete + edo rm assets/{splash.png,WebCamScene.icescene} + + # fix some tool invocations + eval $(eclectic wxwidgets script 2.8-gtk2) + edo sed -i -e "s#-lmysqlclient#\$\(shell /usr/$(exhost --target)/bin/mysql_config \-\-libs\)#" \ + zod_src/makefile +} + +src_compile() { + emake -C zod_src DATA_PATH="\"/usr/share/${PN}\"" main map_editor + emake -C zod_launcher_src DATA_PATH="\"/usr/share/${PN}\"" +} + +src_install() { + dobin zod_src/zod + dodoc zod_engine_help.txt + + dobin zod_src/zod_map_editor + dodoc map_editor_help.txt + + dobin zod_launcher_src/zod_launcher + + insinto /usr/share/applications + hereins ${PN}.desktop <