From 83669dd50bbbcef093b30e9ecc727050e3baa90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 14 Sep 2013 21:53:29 +0200 Subject: [PATCH 1/7] install icons, desktop shortcuts and launchers in Makefile avoid redundancy with package build scripts add uninstall rules --- Makefile | 22 ++++++++++++++++++---- packaging/linux/buildpackage.sh | 21 +++++---------------- packaging/linux/openra-bin | 3 --- packaging/linux/openra-editor-bin | 3 --- 4 files changed, 23 insertions(+), 26 deletions(-) delete mode 100755 packaging/linux/openra-bin delete mode 100755 packaging/linux/openra-editor-bin diff --git a/Makefile b/Makefile index 41078e5e09fa..0289b4d61084 100644 --- a/Makefile +++ b/Makefile @@ -318,12 +318,16 @@ install-core: default @echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra @echo 'cd "$${DATADIR}/openra"' >> openra @echo 'exec mono OpenRA.Game.exe "$$@"' >> openra - @$(INSTALL_DIR) "$(BIN_INSTALL_DIR)" @$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)" - @-$(RM) openra + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications" + + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/" + @$(CP_R) packaging/linux/hicolor/ "$(DESTDIR)$(datadir)/icons" + install-tools: tools @-echo "Installing OpenRA tools to $(DATA_INSTALL_DIR)" @$(INSTALL_DIR) "$(DATA_INSTALL_DIR)" @@ -335,16 +339,26 @@ install-tools: tools @echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra-editor @echo 'cd "$${DATADIR}/openra"' >> openra-editor @echo 'exec mono OpenRA.Editor.exe "$$@"' >> openra-editor - @$(INSTALL_DIR) "$(BIN_INSTALL_DIR)" @$(INSTALL_PROGRAM) -m +rx openra-editor "$(BIN_INSTALL_DIR)" - @-$(RM) openra-editor + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications" + uninstall: @-$(RM_R) "$(DATA_INSTALL_DIR)" @-$(RM_F) "$(BIN_INSTALL_DIR)/openra" @-$(RM_F) "$(BIN_INSTALL_DIR)/openra-editor" + @-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra.desktop" + @-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra-editor.desktop" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/16x16/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra-editor.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra-editor.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png" help: @echo to compile, run: diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 4d6228b0cf3a..87a34c2355a3 100644 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -15,22 +15,11 @@ ROOTDIR=root # Clean up rm -rf $ROOTDIR -# Game files -mkdir -p $ROOTDIR/usr/bin/ -cp -T openra-bin $ROOTDIR/usr/bin/openra -cp -T openra-editor-bin $ROOTDIR/usr/bin/openra-editor -mkdir -p $ROOTDIR/usr/share/openra/ -cp -R $BUILTDIR/* "$ROOTDIR/usr/share/openra/" || exit 3 - -# Launch scripts (executed by Desura) -cp ../../*.sh "$ROOTDIR/usr/share/openra/" || exit 3 - -# Desktop Icons -mkdir -p $ROOTDIR/usr/share/applications/ -cp *.desktop "$ROOTDIR/usr/share/applications/" - -mkdir -p $ROOTDIR/usr/share/icons/ -cp -r hicolor $ROOTDIR/usr/share/icons/ +# Copy files +cd ../.. +make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" + +cd packaging/linux ( echo "Building Debian package." diff --git a/packaging/linux/openra-bin b/packaging/linux/openra-bin deleted file mode 100755 index 0d4ba2622a5e..000000000000 --- a/packaging/linux/openra-bin +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd /usr/share/openra -mono OpenRA.Game.exe "$@" diff --git a/packaging/linux/openra-editor-bin b/packaging/linux/openra-editor-bin deleted file mode 100755 index cfc55f05f8f6..000000000000 --- a/packaging/linux/openra-editor-bin +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd /usr/share/openra -mono OpenRA.Editor.exe "$@" From de4c224b5c7e0d186bdd4fc3f1b6777629a03fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 14 Sep 2013 22:56:55 +0200 Subject: [PATCH 2/7] separate RALint tests from regular builds --- .travis.yml | 1 + Makefile | 14 ++++++++++---- OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj | 1 - OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj | 1 - OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 1 - 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 43140100e9ee..a3cf69fe87a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ install: # Run the build script which will automatically call RALint and ensure that the IDE project files are still valid. script: - make all + - make test - xbuild # Only watch the development branch. diff --git a/Makefile b/Makefile index 0289b4d61084..077bf088929f 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,6 @@ mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll mod_ra_KIND = library mod_ra_DEPS = $(STD_MOD_DEPS) $(utility_TARGET) $(geoip_TARGET) mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(utility_TARGET) $(geoip_TARGET) -mod_ra_EXTRA_CMDS = mono --debug RALint.exe ra PROGRAMS += mod_ra mod_ra: $(mod_ra_TARGET) @@ -144,7 +143,6 @@ mod_cnc_TARGET = mods/cnc/OpenRA.Mods.Cnc.dll mod_cnc_KIND = library mod_cnc_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) mod_cnc_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) -mod_cnc_EXTRA_CMDS = mono --debug RALint.exe cnc PROGRAMS += mod_cnc mod_cnc: $(mod_cnc_TARGET) @@ -154,7 +152,6 @@ mod_d2k_TARGET = mods/d2k/OpenRA.Mods.D2k.dll mod_d2k_KIND = library mod_d2k_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) $(mod_cnc_TARGET) mod_d2k_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) -mod_d2k_EXTRA_CMDS = mono --debug RALint.exe d2k PROGRAMS += mod_d2k mod_d2k: $(mod_d2k_TARGET) @@ -164,7 +161,6 @@ mod_ts_TARGET = mods/ts/OpenRA.Mods.TS.dll mod_ts_KIND = library mod_ts_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) mod_ts_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) -mod_ts_EXTRA_CMDS = mono --debug RALint.exe ts PROGRAMS += mod_ts mod_ts: $(mod_ts_TARGET) @@ -195,6 +191,16 @@ ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS) PROGRAMS += ralint ralint: $(ralint_TARGET) +test: + @mono --debug RALint.exe ra + @echo "OpenRA.Lint: ra mod yaml checks passed." + @mono --debug RALint.exe cnc + @echo "OpenRA.Lint: cnc mod yaml checks passed." + @mono --debug RALint.exe d2k + @echo "OpenRA.Lint: d2k mod yaml checks passed." + @mono --debug RALint.exe ts + @echo "OpenRA.Lint: ts mod yaml checks passed." + # Builds and exports tilesets from a bitmap tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs') tsbuild_TARGET = OpenRA.TilesetBuilder.exe diff --git a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj index 8b636b73908f..35ce9c327241 100644 --- a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj +++ b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj @@ -43,7 +43,6 @@ - AllRules.ruleset diff --git a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj index 3f749abf5daf..31d3e8665f5d 100644 --- a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj +++ b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj @@ -43,7 +43,6 @@ - DEBUG; diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index b19714e39fb9..804b7179f279 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -44,7 +44,6 @@ - AllRules.ruleset From fb91b81dd5d65abc1b2b02bd29dffd9e5656a09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 8 Sep 2013 18:16:21 +0200 Subject: [PATCH 3/7] =?UTF-8?q?rename=20RALint=20=E2=86=92=20OpenRA.Lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 12 ++++++------ .../RALint.csproj => OpenRA.Lint/OpenRA.Lint.csproj | 8 ++++---- {RALint => OpenRA.Lint}/Settings.StyleCop | 0 RALint/RALint.cs => OpenRA.Lint/YamlChecker.cs | 8 ++++---- OpenRA.sln | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) rename RALint/RALint.csproj => OpenRA.Lint/OpenRA.Lint.csproj (96%) rename {RALint => OpenRA.Lint}/Settings.StyleCop (100%) rename RALint/RALint.cs => OpenRA.Lint/YamlChecker.cs (92%) diff --git a/Makefile b/Makefile index 077bf088929f..86cca5c13128 100644 --- a/Makefile +++ b/Makefile @@ -183,8 +183,8 @@ OpenRA.Editor.Form1.resources: editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor_TARGET) # Analyses mod yaml for easy to detect errors -ralint_SRCS := $(shell find RALint/ -iname '*.cs') -ralint_TARGET = RALint.exe +ralint_SRCS := $(shell find OpenRA.Lint/ -iname '*.cs') +ralint_TARGET = OpenRA.Lint.exe ralint_KIND = exe ralint_DEPS = $(fileformats_TARGET) $(game_TARGET) ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS) @@ -192,13 +192,13 @@ PROGRAMS += ralint ralint: $(ralint_TARGET) test: - @mono --debug RALint.exe ra + @mono --debug OpenRA.Lint.exe ra @echo "OpenRA.Lint: ra mod yaml checks passed." - @mono --debug RALint.exe cnc + @mono --debug OpenRA.Lint.exe cnc @echo "OpenRA.Lint: cnc mod yaml checks passed." - @mono --debug RALint.exe d2k + @mono --debug OpenRA.Lint.exe d2k @echo "OpenRA.Lint: d2k mod yaml checks passed." - @mono --debug RALint.exe ts + @mono --debug OpenRA.Lint.exe ts @echo "OpenRA.Lint: ts mod yaml checks passed." # Builds and exports tilesets from a bitmap diff --git a/RALint/RALint.csproj b/OpenRA.Lint/OpenRA.Lint.csproj similarity index 96% rename from RALint/RALint.csproj rename to OpenRA.Lint/OpenRA.Lint.csproj index de6c32c3b8a4..cff0dbe68bf0 100644 --- a/RALint/RALint.csproj +++ b/OpenRA.Lint/OpenRA.Lint.csproj @@ -8,8 +8,8 @@ {F9FA4D9F-2302-470A-8A07-6E37F488C124} Exe Properties - RALint - RALint + OpenRA + OpenRA.Lint v3.5 512 @@ -36,7 +36,7 @@ true full false - ..\ + .. DEBUG;TRACE prompt 4 @@ -70,7 +70,7 @@ - + diff --git a/RALint/Settings.StyleCop b/OpenRA.Lint/Settings.StyleCop similarity index 100% rename from RALint/Settings.StyleCop rename to OpenRA.Lint/Settings.StyleCop diff --git a/RALint/RALint.cs b/OpenRA.Lint/YamlChecker.cs similarity index 92% rename from RALint/RALint.cs rename to OpenRA.Lint/YamlChecker.cs index ead78bede15b..9416a990faa2 100644 --- a/RALint/RALint.cs +++ b/OpenRA.Lint/YamlChecker.cs @@ -14,21 +14,21 @@ using OpenRA.FileFormats; using OpenRA.Traits; -namespace RALint +namespace OpenRA.Lint { - static class RALint + static class YamlChecker { static int errors = 0; static void EmitError(string e) { - Console.WriteLine("RALint(1,1): Error: {0}", e); + Console.WriteLine("OpenRA.Lint(1,1): Error: {0}", e); ++errors; } static void EmitWarning(string e) { - Console.WriteLine("RALint(1,1): Warning: {0}", e); + Console.WriteLine("OpenRA.Lint(1,1): Warning: {0}", e); } static int Main(string[] args) diff --git a/OpenRA.sln b/OpenRA.sln index 97e078699f9b..1f7cfd708794 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -21,7 +21,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Editor", "OpenRA.Edi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.TilesetBuilder", "OpenRA.TilesetBuilder\OpenRA.TilesetBuilder.csproj", "{1A8E50CC-EE32-4E57-8842-0C39C8EA7541}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RALint", "RALint\RALint.csproj", "{F9FA4D9F-2302-470A-8A07-6E37F488C124}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Lint", "OpenRA.Lint\OpenRA.Lint.csproj", "{F9FA4D9F-2302-470A-8A07-6E37F488C124}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}" EndProject From 80179a19c278e66cf4fb1b184014179a8ccf8140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 15 Sep 2013 11:43:26 +0200 Subject: [PATCH 4/7] spaces to tabs --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 86cca5c13128..36ce93d83507 100644 --- a/Makefile +++ b/Makefile @@ -224,8 +224,8 @@ tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormN utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs') utility_TARGET = OpenRA.Utility.exe utility_KIND = exe -utility_DEPS = $(fileformats_TARGET) $(game_TARGET) -utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll System.Windows.Forms.dll +utility_DEPS = $(fileformats_TARGET) $(game_TARGET) +utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll System.Windows.Forms.dll PROGRAMS += utility utility: $(utility_TARGET) From 5f27b051033920711dec7096b65c3af128f111f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 15 Sep 2013 12:04:14 +0200 Subject: [PATCH 5/7] update documentation --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 36ce93d83507..5cd75c097693 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,12 @@ # to compile with development tools, run: # make all # +# to check the official mods for erroneous yaml files, run: +# make test +# +# to generate documentation aimed at modders, run: +# make docs +# # to install, run: # make [prefix=/foo] [bindir=/bar/bin] install # @@ -373,6 +379,12 @@ help: @echo to compile with development tools, run: @echo \ \ make all @echo + @echo to check the official mods for erroneous yaml files, run: + @echo \ \ make test + @echo + @echo to generate documentation aimed at modders, run: + @echo \ \ make docs + @echo @echo to install, run: @echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install @echo From 7a4f29afc6f74f3fd9e3a22a2dcb25e2447a80c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 15 Sep 2013 12:11:14 +0200 Subject: [PATCH 6/7] apt-get update in before_install --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a3cf69fe87a6..ee87d72f273c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,10 @@ language: c # Make sure build dependencies are installed. +before_install: + - sudo apt-get update install: - - sudo apt-get update && sudo apt-get install mono-gmcs cli-common-dev libsdl1.2debian libgl1-mesa-glx libopenal1 libfreetype6 + - sudo apt-get install mono-gmcs cli-common-dev libsdl1.2debian libgl1-mesa-glx libopenal1 libfreetype6 # Run the build script which will automatically call RALint and ensure that the IDE project files are still valid. script: From 29d93f7d9d52cc44111ed9e10401979df1473eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 20 Sep 2013 18:37:15 +0200 Subject: [PATCH 7/7] separate Linux only shortcuts and icons from make install --- Makefile | 19 +++++++++++++------ packaging/linux/buildpackage.sh | 8 +++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 5cd75c097693..8442ab00dbbf 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ # to install with development tools, run: # make [prefix=/foo] [bindir=/bar/bin] install-all # +# to install Linux desktop files and icons: +# make install-shortcuts +# # to uninstall, run: # make uninstall # @@ -334,12 +337,6 @@ install-core: default @$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)" @-$(RM) openra - @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" - @$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications" - - @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/" - @$(CP_R) packaging/linux/hicolor/ "$(DESTDIR)$(datadir)/icons" - install-tools: tools @-echo "Installing OpenRA tools to $(DATA_INSTALL_DIR)" @$(INSTALL_DIR) "$(DATA_INSTALL_DIR)" @@ -355,6 +352,13 @@ install-tools: tools @$(INSTALL_PROGRAM) -m +rx openra-editor "$(BIN_INSTALL_DIR)" @-$(RM) openra-editor +install-shortcuts: shortcuts + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/" + @$(CP_R) packaging/linux/hicolor/ "$(DESTDIR)$(datadir)/icons" + + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" @$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications" @@ -391,6 +395,9 @@ help: @echo to install with development tools, run: @echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install-all @echo + @echo to install Linux desktop files and icons + @echo \ \ make install-shortcuts + @echo @echo to uninstall, run: @echo \ \ make uninstall @echo diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 87a34c2355a3..77354f4b5587 100644 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -15,10 +15,16 @@ ROOTDIR=root # Clean up rm -rf $ROOTDIR -# Copy files 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" +# Launch scripts (executed by Desura) +cp *.sh "$PWD/packaging/linux/$ROOTDIR/usr/share/openra/" || exit 3 + +# Icons and .desktop files +make install-shortcuts + cd packaging/linux (