From bae47ff3c99b9b5c33c03c250734a57578042116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 4 May 2014 14:37:27 +0200 Subject: [PATCH 01/10] use native Gtk2 crash dialogs on Linux closes #3872 closes #3849 --- Makefile | 2 ++ OpenRA.Game/Platform.cs | 3 +++ error-dialog.sh | 11 +++++++++++ packaging/linux/deb/DEBIAN/control | 2 +- packaging/linux/pkgbuild/PKGBUILD | 2 +- packaging/linux/rpm/openra.spec | 2 ++ 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 error-dialog.sh diff --git a/Makefile b/Makefile index 5ab9c331f5..4ba93c89ad 100644 --- a/Makefile +++ b/Makefile @@ -328,6 +328,8 @@ install-core: default @$(INSTALL_PROGRAM) thirdparty/Newtonsoft.Json.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) thirdparty/RestSharp.dll "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) -m +rx "error-dialog.sh" "$(DATA_INSTALL_DIR)" + @echo "#!/bin/sh" > openra @echo 'BINDIR=$$(dirname $$(readlink -f $$0))' >> openra @echo 'ROOTDIR="$${BINDIR%'"$(bindir)"'}"' >> openra diff --git a/OpenRA.Game/Platform.cs b/OpenRA.Game/Platform.cs index be1e52f53b..2c0c6fc699 100644 --- a/OpenRA.Game/Platform.cs +++ b/OpenRA.Game/Platform.cs @@ -129,6 +129,9 @@ namespace OpenRA ).F(title, message, icon, logsButton, logsPath, faqButton, faqPath, quitButton); } + if (CurrentPlatform == PlatformType.Linux && File.Exists("/usr/bin/zenity") && File.Exists("/usr/bin/xdg-open")) + process = "error-dialog.sh"; + var psi = new ProcessStartInfo(process, args); psi.UseShellExecute = false; psi.CreateNoWindow = true; diff --git a/error-dialog.sh b/error-dialog.sh new file mode 100755 index 0000000000..9fd72ec12d --- /dev/null +++ b/error-dialog.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +zenity --error --title "OpenRA" --text "OpenRA has encountered a fatal error." + +zenity --question --title "OpenRA" --text="Would you like have a look at the crash log files?" || exit + +xdg-open ~/.openra/Logs + +zenity --question --title "OpenRA" --text="Would you like to read the FAQ?" || exit + +xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ \ No newline at end of file diff --git a/packaging/linux/deb/DEBIAN/control b/packaging/linux/deb/DEBIAN/control index 0252c2ea77..ef487f9cbf 100644 --- a/packaging/linux/deb/DEBIAN/control +++ b/packaging/linux/deb/DEBIAN/control @@ -3,7 +3,7 @@ Version: {VERSION} Architecture: all Maintainer: Chris Forbes Installed-Size: {SIZE} -Depends: libopenal1, mono-runtime (>= 2.10), libmono-system-core4.0-cil, libmono-system-drawing4.0-cil, libmono-system-windows-forms4.0-cil, libfreetype6, libc6, libasound2, libgl1-mesa-glx, libgl1-mesa-dri +Depends: libopenal1, mono-runtime (>= 2.10), libmono-system-core4.0-cil, libmono-system-drawing4.0-cil, libmono-system-windows-forms4.0-cil, libfreetype6, libc6, libasound2, libgl1-mesa-glx, libgl1-mesa-dri, xdg-utils, zenity Section: games Priority: extra Homepage: http://www.open-ra.org/ diff --git a/packaging/linux/pkgbuild/PKGBUILD b/packaging/linux/pkgbuild/PKGBUILD index 030b4b4801..dcbb1f1555 100644 --- a/packaging/linux/pkgbuild/PKGBUILD +++ b/packaging/linux/pkgbuild/PKGBUILD @@ -7,7 +7,7 @@ arch=('any') url="http://open-ra.org" license=('GPL3') groups=() -depends=('mono' 'openal' 'mesa' 'freetype2' 'glibc' 'alsa-lib') +depends=('mono' 'openal' 'mesa' 'freetype2' 'glibc' 'alsa-lib' 'xdg-utils' 'zenity') makedepends=('git' 'unzip' 'wget') optdepends=('gksu: Elevation for installing game packages on Gnome platforms' 'kdesudo: Elevation for installing game packages on KDE platforms') diff --git a/packaging/linux/rpm/openra.spec b/packaging/linux/rpm/openra.spec index 81c946331e..1267d459ad 100644 --- a/packaging/linux/rpm/openra.spec +++ b/packaging/linux/rpm/openra.spec @@ -22,6 +22,8 @@ Requires: libdl.so.2 Requires: libm.so.6 Requires: libpthread.so.0 Requires: librt.so.1 +Requires: xdg-utils +Requires: zenity Prefix: /usr Source: %{name}-%{version}.tar.gz From 46230e2a81825f9765beda2993abfb923217687d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 14 May 2014 13:41:33 +0200 Subject: [PATCH 02/10] condense into one graphical crash dialog make it more robust against missing dependencies --- error-dialog.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/error-dialog.sh b/error-dialog.sh index 9fd72ec12d..371ea3f178 100755 --- a/error-dialog.sh +++ b/error-dialog.sh @@ -1,11 +1,3 @@ #!/bin/sh - -zenity --error --title "OpenRA" --text "OpenRA has encountered a fatal error." - -zenity --question --title "OpenRA" --text="Would you like have a look at the crash log files?" || exit - -xdg-open ~/.openra/Logs - -zenity --question --title "OpenRA" --text="Would you like to read the FAQ?" || exit - -xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ \ No newline at end of file +ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files." +$ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ \ No newline at end of file From 73704a2a84b7e41e47c0f0cc9e06836561d7b34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 14 May 2014 13:42:06 +0200 Subject: [PATCH 03/10] copy launch scripts during Linux make install --- Makefile | 4 +++- packaging/linux/buildpackage.sh | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4ba93c89ad..47cf4c1ce1 100644 --- a/Makefile +++ b/Makefile @@ -328,7 +328,9 @@ install-core: default @$(INSTALL_PROGRAM) thirdparty/Newtonsoft.Json.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) thirdparty/RestSharp.dll "$(DATA_INSTALL_DIR)" - @$(INSTALL_PROGRAM) -m +rx "error-dialog.sh" "$(DATA_INSTALL_DIR)" +ifeq ($(shell uname),Linux) + @$(CP) *.sh "$(DATA_INSTALL_DIR)" +endif @echo "#!/bin/sh" > openra @echo 'BINDIR=$$(dirname $$(readlink -f $$0))' >> openra diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 7498cccf26..aab32387c0 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -24,9 +24,6 @@ make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" # Native library dependencies cp "$DEPSDIR"/* "$PWD/packaging/linux/$ROOTDIR/usr/lib/openra/" || exit 3 -# Launch scripts (executed by Desura) -cp *.sh "$PWD/packaging/linux/$ROOTDIR/usr/lib/openra/" || exit 3 - # Icons and .desktop files make install-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" From 8dd0c34a56c5e24f6fca1b7cf558f62a9329f244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 14 May 2014 13:42:23 +0200 Subject: [PATCH 04/10] document the launch scripts --- launch-dedicated.sh | 1 + launch-editor.sh | 1 + launch-game.sh | 1 + launch-replay.sh | 1 + 4 files changed, 4 insertions(+) diff --git a/launch-dedicated.sh b/launch-dedicated.sh index 780770d769..51285222df 100755 --- a/launch-dedicated.sh +++ b/launch-dedicated.sh @@ -1,4 +1,5 @@ #!/bin/bash +# example launch script, see https://github.com/OpenRA/OpenRA/wiki/Dedicated for details Name="Dedicated-Server" Mod="ra" Dedicated="True" diff --git a/launch-editor.sh b/launch-editor.sh index f700b0ff9c..c390cb1ae0 100755 --- a/launch-editor.sh +++ b/launch-editor.sh @@ -1,2 +1,3 @@ #!/bin/sh +# launch script (executed by Desura) exec mono OpenRA.Editor.exe "$@" \ No newline at end of file diff --git a/launch-game.sh b/launch-game.sh index ae207f3f9b..090f030f69 100755 --- a/launch-game.sh +++ b/launch-game.sh @@ -1,2 +1,3 @@ #!/bin/sh +# launch script (executed by Desura) exec mono OpenRA.Game.exe Server.Dedicated=False Server.DedicatedLoop=False "$@" \ No newline at end of file diff --git a/launch-replay.sh b/launch-replay.sh index 2190b61bb6..6c1af06098 100755 --- a/launch-replay.sh +++ b/launch-replay.sh @@ -1,3 +1,4 @@ #!/bin/bash +# TODO choose the correct Game.Mod instead of crashing cd ${0%/*} exec mono OpenRA.Game.exe Launch.Replay="$@" \ No newline at end of file From 0a5d78bbf146fad1a58d948e7b1477264a99dcfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 14 May 2014 13:44:40 +0200 Subject: [PATCH 05/10] fix missing hard-coded native deps after make install --- Makefile | 1 + packaging/linux/buildpackage.sh | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 47cf4c1ce1..24d603aee9 100644 --- a/Makefile +++ b/Makefile @@ -327,6 +327,7 @@ install-core: default @$(INSTALL_PROGRAM) thirdparty/MaxMind.GeoIP2.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) thirdparty/Newtonsoft.Json.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) thirdparty/RestSharp.dll "$(DATA_INSTALL_DIR)" + @$(CP) thirdparty/${platformdeps}/* "$(DATA_INSTALL_DIR)" ifeq ($(shell uname),Linux) @$(CP) *.sh "$(DATA_INSTALL_DIR)" diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index aab32387c0..18dbca4a09 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -21,9 +21,6 @@ cd ../.. # Copy files for OpenRA.Game.exe and OpenRA.Editor.exe as well as all dependencies. make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" -# Native library dependencies -cp "$DEPSDIR"/* "$PWD/packaging/linux/$ROOTDIR/usr/lib/openra/" || exit 3 - # Icons and .desktop files make install-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" From a9664691e60dbbf77f04fce8d14a1645eb54ca76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 17 May 2014 09:34:22 +0200 Subject: [PATCH 06/10] always spawn the native error dialog --- OpenRA.Game/Platform.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Platform.cs b/OpenRA.Game/Platform.cs index 2c0c6fc699..d8a30889b0 100644 --- a/OpenRA.Game/Platform.cs +++ b/OpenRA.Game/Platform.cs @@ -129,7 +129,7 @@ namespace OpenRA ).F(title, message, icon, logsButton, logsPath, faqButton, faqPath, quitButton); } - if (CurrentPlatform == PlatformType.Linux && File.Exists("/usr/bin/zenity") && File.Exists("/usr/bin/xdg-open")) + if (CurrentPlatform == PlatformType.Linux) process = "error-dialog.sh"; var psi = new ProcessStartInfo(process, args); From 65829bb58cf7bd1606f04367e1313e285c63c501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 17 May 2014 09:35:05 +0200 Subject: [PATCH 07/10] GitHub URLs have changed https://developer.github.com/changes/2014-04-25-user-content-security/ --- packaging/package-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/package-all.sh b/packaging/package-all.sh index d151e95847..011eda972e 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -21,7 +21,7 @@ make package # Remove the mdb files that are created during `make` find . -path "*.mdb" -delete -wget https://raw.github.com/wiki/OpenRA/OpenRA/Changelog.md +wget https://raw.githubusercontent.com/wiki/OpenRA/OpenRA/Changelog.md markdown Changelog.md > CHANGELOG.html markdown README.md > README.html markdown CONTRIBUTING.md > CONTRIBUTING.html From 991ddf035a35d58820e2a273b79418c1b2d86cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 17 May 2014 09:36:19 +0200 Subject: [PATCH 08/10] put all remaining WinForms targets together so it is easier to get rid of them --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 24d603aee9..cdfb51620b 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ INSTALL_PROGRAM = $(INSTALL) -m755 INSTALL_DATA = $(INSTALL) -m644 # program targets -CORE = rsdl2 rnull game utility irc crashdialog +CORE = rsdl2 rnull game utility irc TOOLS = editor tsbuild ralint VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`) @@ -253,11 +253,11 @@ $(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog)))) # default: dependencies core -core: game renderers mods utility crashdialog +core: game renderers mods utility ralint -tools: editor tsbuild ralint +tools: editor tsbuild crashdialog -package: dependencies core editor docs version +package: dependencies core editor crashdialog docs version mods: mod_ra mod_cnc mod_d2k mod_ts From c17aa2f467e3418105153a48f3d519695599897d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 17 May 2014 09:36:44 +0200 Subject: [PATCH 09/10] don't ship OpenRA.CrashDialog.exe on Mac/Linux --- packaging/linux/buildpackage.sh | 3 +++ packaging/osx/buildpackage.sh | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 18dbca4a09..cc38f3f577 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -24,6 +24,9 @@ make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" # Icons and .desktop files make install-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" +# Remove the WinForms dialog which is replaced with a native one provided by zenity +rm $PWD/packaging/linux/$ROOTDIR/usr/lib/openra/OpenRA.CrashDialog.exe + # Documentation mkdir -p $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/ cp *.html $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/ diff --git a/packaging/osx/buildpackage.sh b/packaging/osx/buildpackage.sh index c076f31894..d5c943a208 100755 --- a/packaging/osx/buildpackage.sh +++ b/packaging/osx/buildpackage.sh @@ -16,9 +16,11 @@ fi cp -rv template.app OpenRA.app cp -rv $2/* $3/* "OpenRA.app/Contents/Resources/" || exit 3 -# Icon isn't used, and editor doesn't work. +# Remove unused icon rm OpenRA.app/Contents/Resources/OpenRA.ico +# Remove broken WinForms applications rm OpenRA.app/Contents/Resources/OpenRA.Editor.exe +rm OpenRA.app/Contents/Resources/OpenRA.CrashDialog.exe # Package app bundle into a zip and clean up zip OpenRA-$1 -r -9 OpenRA.app From fcc49b2cf4e357509445ad97a80ccb96fc1e603d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 17 May 2014 10:18:55 +0200 Subject: [PATCH 10/10] clean up old Changelog files --- packaging/package-all.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 011eda972e..5feda0b25a 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -21,6 +21,7 @@ make package # Remove the mdb files that are created during `make` find . -path "*.mdb" -delete +rm Changelog.md wget https://raw.githubusercontent.com/wiki/OpenRA/OpenRA/Changelog.md markdown Changelog.md > CHANGELOG.html markdown README.md > README.html