From d26ee1094a2844525e3651b777875dfc73ceff7b Mon Sep 17 00:00:00 2001 From: Matthew Bowra-Dean Date: Tue, 4 Jan 2011 17:35:50 +1300 Subject: [PATCH] Rework GTK launcher and linux packages slightly --- Makefile | 8 ++------ OpenRA.Launcher.Gtk/main.c | 10 +++++++++- packaging/linux/buildpackage.sh | 3 ++- packaging/linux/openra-bin | 3 --- 4 files changed, 13 insertions(+), 11 deletions(-) delete mode 100644 packaging/linux/openra-bin diff --git a/Makefile b/Makefile index 842fbae1c0..adc19ea3d4 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll third PHONY = core tools package all mods clean distclean CC = gcc -CFLAGS = -O2 -Wall +CFLAGS = -O2 -Wall -m32 .SUFFIXES: core: game renderers mod_ra mod_cnc @@ -222,7 +222,6 @@ install: all gtklaunch @$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) $(INSTALL_DIR) @$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/cnc @$(INSTALL_PROGRAM) $(mod_cnc_TARGET) $(INSTALL_DIR)/mods/cnc - @$(INSTALL_PROGRAM) gtklaunch $(INSTALL_DIR) @-cp $(foreach f,$(shell ls mods/cnc --hide=*.dll),mods/cnc/$(f)) $(INSTALL_DIR)/mods/cnc @cp -r mods/cnc/maps $(INSTALL_DIR)/mods/cnc @@ -249,11 +248,8 @@ install: all gtklaunch @cp --parents -r thirdparty/Tao $(INSTALL_DIR) @$(INSTALL_PROGRAM) thirdparty/ICSharpCode.SharpZipLib.dll $(INSTALL_DIR) - @echo "#!/bin/sh" > openra - @echo "cd "$(datadir)"/openra" >> openra - @echo "./gtklaunch" >> openra @$(INSTALL_PROGRAM) -d $(BIN_INSTALL_DIR) - @$(INSTALL_PROGRAM) -m +rx openra $(BIN_INSTALL_DIR) + @$(INSTALL_PROGRAM) -T gtklaunch $(BIN_INSTALL_DIR)/openra uninstall: @-rm -r $(INSTALL_DIR) diff --git a/OpenRA.Launcher.Gtk/main.c b/OpenRA.Launcher.Gtk/main.c index 22c2fa112f..e77b171748 100644 --- a/OpenRA.Launcher.Gtk/main.c +++ b/OpenRA.Launcher.Gtk/main.c @@ -434,6 +434,14 @@ int main(int argc, char ** argv) { GtkWidget * hbox1, * hbox2, * vbox; + int res = chdir("../share/openra"); + + if (0 != res) + { + g_error("Couldn't change to OpenRA working directory"); + return 1; + } + server_init(WEBSERVER_PORT); gtk_init(&argc, &argv); @@ -453,7 +461,7 @@ int main(int argc, char ** argv) util_get_mod_list(mod_list_callback); - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_vbox_new(FALSE, 0); hbox1 = gtk_hbox_new(FALSE, 0); hbox2 = gtk_hbox_new(FALSE, 0); diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 2015683f1a..742b051dff 100644 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -15,12 +15,13 @@ rm -rf root # Game files mkdir -p root/usr/bin/ -cp openra-bin root/usr/bin/openra +cp -T $BUILTDIR/gtklaunch root/usr/bin/openra mkdir -p root/usr/share/openra/ cp -R $BUILTDIR/* "root/usr/share/openra/" || exit 3 # Remove unneeded files rm root/usr/share/openra/OpenRA.Launcher.exe +rm root/usr/share/openra/gtklaunch # Desktop Icons mkdir -p root/usr/share/applications/ diff --git a/packaging/linux/openra-bin b/packaging/linux/openra-bin deleted file mode 100644 index 6427a55f84..0000000000 --- a/packaging/linux/openra-bin +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd /usr/share/openra -./gtklaunch