diff --git a/.travis.yml b/.travis.yml index 6640891100..b518f8db77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,12 +34,13 @@ env: # call OpenRA to check for YAML errors # Run the NUnit tests script: - - travis_retry make all-dependencies - make all - test "$TRAVIS_OS_NAME" == "linux" && make check || echo "Skipping check" - test "$TRAVIS_OS_NAME" == "linux" && make check-scripts || echo "Skipping scripts check" - test "$TRAVIS_OS_NAME" == "linux" && make test || echo "Skipping tests" - - test "$TRAVIS_OS_NAME" == "linux" && make nunit || echo "Skipping nunit tests" + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + mono ~/.nuget/packages/nunit.consolerunner/3.11.1/tools/nunit3-console.exe --noresult OpenRA.Test.dll; + fi # Only watch the development branch and tagged release. branches: diff --git a/INSTALL.md b/INSTALL.md index ba85c8e5cf..bb494f8a0e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,15 +8,9 @@ Windows Compiling OpenRA requires the following dependencies: * [Windows PowerShell >= 4.0](http://microsoft.com/powershell) (included by default in recent Windows 10 versions) -* [.NET Framework 4.6.1 (Developer Pack)](https://dotnet.microsoft.com/download/dotnet-framework/net461) (or via Visual Studio 2017) +* [.NET Framework 4.7.2 (Developer Pack)](https://dotnet.microsoft.com/download/dotnet-framework/net472) (or via Visual Studio 2017) * [.NET Core 2.2 SDK](https://dotnet.microsoft.com/download/dotnet-core/2.2) (or via Visual Studio 2017) -Type `make dependencies` in a command terminal to download pre-compiled native libraries for: -* [SDL 2](http://www.libsdl.org/download-2.0.php) -* [FreeType](http://gnuwin32.sourceforge.net/packages/freetype.htm) -* [zlib](http://gnuwin32.sourceforge.net/packages/zlib.htm) -* [OpenAL](http://kcat.strangesoft.net/openal.html) -* [liblua 5.1](http://luabinaries.sourceforge.net/download.html) To compile OpenRA, open the `OpenRA.sln` solution in the main folder, build it from the command-line with MSBuild or use the Makefile analogue command `make all` scripted in PowerShell syntax. @@ -25,11 +19,17 @@ Run the game with `launch-game.cmd`. It can be handed arguments that specify the Linux ===== -Mono, version 5.4 or later, is required to compile OpenRA. You can add the [upstream mono repository](https://www.mono-project.com/download/stable/#download-lin) for your distro to obtain the latest version if your system packages are not sufficient. +Mono, version 5.18 or later, is required to compile OpenRA. You can add the [upstream mono repository](https://www.mono-project.com/download/stable/#download-lin) for your distro to obtain the latest version if your system packages are not sufficient. -Use `make dependencies` to map the native libraries to your system and fetch the remaining CLI dependencies to place them at the appropriate places. +To compile OpenRA, run `make` from the command line. After this one can run the game with `./launch-game.sh`. It is also possible to specify the mod you wish to run from the command line, e.g. with `./launch-game.sh Game.Mod=ts` if you wish to try the experimental Tiberian Sun mod. -To compile OpenRA, run `make all` from the command line. After this one can run the game with `./launch-game.sh`. It is also possible to specify the mod you wish to run from the command line, e.g. with `./launch-game.sh Game.Mod=ts` if you wish to try the experimental Tiberian Sun mod. +The default behaviour on the x86_64 architecture is to download several pre-compiled native libraries using the Nuget packaging manager. If you prefer to use system libraries, compile instead using `make TARGETPLATFORM=unix-generic`. + +If you choose to use system libraries, or your system is not x86_64, you will need to install the following using your system package manager: +* [SDL 2](http://www.libsdl.org/download-2.0.php) +* [FreeType](http://gnuwin32.sourceforge.net/packages/freetype.htm) +* [OpenAL](http://kcat.strangesoft.net/openal.html) +* [liblua 5.1](http://luabinaries.sourceforge.net/download.html) Type `sudo make install` for system-wide installation. Run `sudo make install-linux-shortcuts` to get startup scripts, icons and desktop files. You can then run the Red Alert by executing the `openra-ra` command, the Dune 2000 mod by running the `openra-d2k` command and Tiberian Dawn by the `openra-cnc` command. Alternatively, you can also run these mods by clicking on their desktop shortcuts if you ran `sudo make install-linux-shortcuts`. @@ -95,18 +95,17 @@ The EPEL repository is required in order for the following command to run proper sudo yum install "pkgconfig(mono)" SDL2 freetype "lua = 5.1" openal-soft xdg-utils zenity ``` -OSX +macOS ===== Before compiling OpenRA you must install the following dependencies: -* [Mono >= 5.4](https://www.mono-project.com/download/stable/#download-mac) +* [Mono >= 5.18](https://www.mono-project.com/download/stable/#download-mac) -Use `make dependencies` to download pre-compiled native libraries for: -* [SDL 2](http://www.libsdl.org/download-2.0.php) -* [FreeType](http://gnuwin32.sourceforge.net/packages/freetype.htm) -* [OpenAL](http://kcat.strangesoft.net/openal.html) -* [liblua 5.1](http://luabinaries.sourceforge.net/download.html) +To compile OpenRA, run `make` from the command line. Run with `./launch-game.sh`. -To compile OpenRA, run `make` from the command line. +The default behaviour is to download several pre-compiled native libraries using the Nuget packaging manager. If you prefer to use system libraries, compile instead using `make TARGETPLATFORM=unix-generic`. If you choose to use system libraries you will need to install: +* [SDL 2](http://www.libsdl.org/download-2.0.php) (`brew install sdl2`) +* [FreeType](http://gnuwin32.sourceforge.net/packages/freetype.htm) (`brew install freetype`) +* [OpenAL](http://kcat.strangesoft.net/openal.html) (`brew install openal-soft`) +* [liblua 5.1](http://luabinaries.sourceforge.net/download.html) (`brew install lua@5.1`) -Run with `./launch-game.sh`. diff --git a/Makefile b/Makefile index df2bfd43bf..2933f3edfc 100644 --- a/Makefile +++ b/Makefile @@ -3,15 +3,13 @@ # to compile, run: # make [DEBUG=true] # -# to check unit tests (requires NUnit version >= 2.6), run: -# make nunit [NUNIT_CONSOLE=] [NUNIT_LIBS_PATH=] [NUNIT_LIBS=] -# Use NUNIT_CONSOLE if nunit[3|2]-console was not downloaded by `make dependencies` nor is it in bin search paths -# Use NUNIT_LIBS_PATH if NUnit libs are not in search paths. Include trailing / -# Use NUNIT_LIBS if NUnit libs have different names (such as including a prefix or suffix) +# to compile using system libraries for native dependencies, run: +# make [DEBUG=true] TARGETPLATFORM=unix-generic +# # to check the official mods for erroneous yaml files, run: # make test # -# to check the official mod dlls for StyleCop violations, run: +# to check the engine and official mod dlls for code style violations, run: # make check # # to install, run: @@ -22,6 +20,7 @@ # # to install the engine and common mod files (omitting the default mods): # make install-engine +# make install-dependencies # make install-common-mod-files # # to uninstall, run: @@ -40,11 +39,11 @@ WHITELISTED_OPENRA_ASSEMBLIES = OpenRA.Game.exe OpenRA.Utility.exe OpenRA.Platforms.Default.dll OpenRA.Mods.Common.dll OpenRA.Mods.Cnc.dll OpenRA.Mods.D2k.dll OpenRA.Game.dll # These are explicitly shipped alongside our core files by the packaging script -WHITELISTED_THIRDPARTY_ASSEMBLIES = ICSharpCode.SharpZipLib.dll FuzzyLogicLibrary.dll Eluant.dll rix0rrr.BeaconLib.dll Open.Nat.dll SDL2-CS.dll OpenAL-CS.dll +WHITELISTED_THIRDPARTY_ASSEMBLIES = ICSharpCode.SharpZipLib.dll FuzzyLogicLibrary.dll Eluant.dll BeaconLib.dll Open.Nat.dll SDL2-CS.dll OpenAL-CS.Core.dll # These are shipped in our custom minimal mono runtime and also available in the full system-installed .NET/mono stack # This list *must* be kept in sync with the files packaged by the AppImageSupport and OpenRALauncherOSX repositories -WHITELISTED_CORE_ASSEMBLIES = mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll +WHITELISTED_CORE_ASSEMBLIES = mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll netstandard.dll NUNIT_LIBS_PATH := NUNIT_LIBS := $(NUNIT_LIBS_PATH)nunit.framework.dll @@ -81,24 +80,31 @@ MSBUILD = msbuild -verbosity:m -nologo # Enable 32 bit builds while generating the windows installer WIN32 = false +# dependencies +ifndef TARGETPLATFORM +UNAME_S := $(shell uname -s) +UNAME_M := $(shell uname -m) +ifeq ($(UNAME_S),Darwin) +TARGETPLATFORM = osx-x64 +else +ifeq ($(UNAME_M),x86_64) +TARGETPLATFORM = linux-x64 +else +TARGETPLATFORM = unix-generic +endif +endif +endif + # program targets VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`) -# dependencies -UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Darwin) -os-dependencies = osx-dependencies -else -os-dependencies = linux-dependencies -endif - check-scripts: @echo @echo "Checking for Lua syntax errors..." @luac -p $(shell find mods/*/maps/* -iname '*.lua') @luac -p $(shell find lua/* -iname '*.lua') -check: dependencies +check: @echo @echo "Compiling in debug mode..." @$(MSBUILD) -t:build -p:Configuration=Debug @@ -112,26 +118,6 @@ check: dependencies @echo "Checking for incorrect conditional trait interface overrides..." @mono --debug OpenRA.Utility.exe all --check-conditional-trait-interface-overrides - -NUNIT_CONSOLE := $(shell test -f thirdparty/download/nunit3-console.exe && echo mono thirdparty/download/nunit3-console.exe || \ - which nunit3-console 2>/dev/null || which nunit2-console 2>/dev/null || which nunit-console 2>/dev/null) -nunit: core - @echo - @echo "Checking unit tests..." - @if [ "$(NUNIT_CONSOLE)" = "" ] ; then \ - echo 'nunit[3|2]-console not found!'; \ - echo 'Was "make dependencies" called or is NUnit installed?'>&2; \ - echo 'See "make help".'; \ - exit 1; \ - fi - @if $(NUNIT_CONSOLE) --help | head -n 1 | grep -E "NUnit version (1|2\.[0-5])";then \ - echo 'NUnit version >= 2.6 required'>&2; \ - echo 'Try "make dependencies" first to use NUnit from NuGet.'>&2; \ - echo 'See "make help".'; \ - exit 1; \ - fi - @$(NUNIT_CONSOLE) --noresult OpenRA.Test.nunit - test: core @echo @echo "Testing Tiberian Sun mod MiniYAML..." @@ -148,52 +134,21 @@ test: core ########################## MAKE/INSTALL RULES ########################## # -all: dependencies core +all: core core: - @command -v $(firstword $(MSBUILD)) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1) -ifeq ($(WIN32), $(filter $(WIN32),true yes y on 1)) - @$(MSBUILD) -t:build -p:Configuration="Release-x86" -else - @$(MSBUILD) -t:build -p:Configuration=Release + @command -v $(firstword $(MSBUILD)) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.18."; exit 1) + @$(MSBUILD) -t:Build -restore -p:Configuration=Release -p:TargetPlatform=$(TARGETPLATFORM) +ifeq ($(TARGETPLATFORM), unix-generic) + @./configure-system-libraries.sh endif @./fetch-geoip.sh clean: - @ $(MSBUILD) -t:clean @-$(RM_F) *.config IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP - @-$(RM_F) *.exe *.dll *.dylib ./OpenRA*/*.dll *.pdb mods/**/*.dll mods/**/*.pdb *.resources + @-$(RM_F) *.exe *.dll *.dll.config *.so *.dylib ./OpenRA*/*.dll *.pdb mods/**/*.dll mods/**/*.pdb *.resources @-$(RM_RF) ./*/bin ./*/obj - @-$(RM_RF) ./thirdparty/download - -distclean: clean - -cli-dependencies: - @./thirdparty/fetch-thirdparty-deps.sh - @ $(CP_R) thirdparty/download/*.dll . - @ $(CP_R) thirdparty/download/*.dll.config . - @ test -f OpenRA.Game/obj/project.assets.json || $(MSBUILD) -t:restore - -linux-dependencies: cli-dependencies linux-native-dependencies - -linux-native-dependencies: - @./thirdparty/configure-native-deps.sh - -windows-dependencies: cli-dependencies -ifeq ($(WIN32), $(filter $(WIN32),true yes y on 1)) - @./thirdparty/fetch-thirdparty-deps-windows.sh x86 -else - @./thirdparty/fetch-thirdparty-deps-windows.sh x64 -endif - -osx-dependencies: cli-dependencies - @./thirdparty/fetch-thirdparty-deps-osx.sh - @ $(CP_R) thirdparty/download/osx/*.dylib . - @ $(CP_R) thirdparty/download/osx/*.dll.config . - -dependencies: $(os-dependencies) - -all-dependencies: cli-dependencies windows-dependencies osx-dependencies + @ $(MSBUILD) -t:clean version: VERSION mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml @echo "$(VERSION)" > VERSION @@ -203,10 +158,33 @@ version: VERSION mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mo rm $${i}.tmp; \ done -install: dependencies core install-core +install: core install-core install-linux-shortcuts: install-linux-scripts install-linux-icons install-linux-desktop +install-dependencies: +ifeq ($(TARGETPLATFORM), $(filter $(TARGETPLATFORM),win-x86 win-x64)) + @-echo "Installing OpenRA dependencies to $(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) soft_oal.dll "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) SDL2.dll "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) freetype6.dll "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) lua51.dll "$(DATA_INSTALL_DIR)" +endif +ifeq ($(TARGETPLATFORM), linux-x64) + @-echo "Installing OpenRA dependencies to $(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) soft_oal.so "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) SDL2.so "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) freetype6.so "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) lua51.so "$(DATA_INSTALL_DIR)" +endif +ifeq ($(TARGETPLATFORM), osx-x64) + @-echo "Installing OpenRA dependencies to $(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) soft_oal.dylib "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) SDL2.dylib "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) freetype6.dylib "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) lua51.dylib "$(DATA_INSTALL_DIR)" +endif + install-engine: @-echo "Installing OpenRA engine to $(DATA_INSTALL_DIR)" @$(INSTALL_DIR) "$(DATA_INSTALL_DIR)" @@ -215,7 +193,9 @@ install-engine: @$(INSTALL_PROGRAM) OpenRA.Utility.exe "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) OpenRA.Platforms.Default.dll "$(DATA_INSTALL_DIR)" +ifneq ($(TARGETPLATFORM), $(filter $(TARGETPLATFORM),win-x86 win-x64)) @$(INSTALL_DATA) OpenRA.Platforms.Default.dll.config "$(DATA_INSTALL_DIR)" +endif @$(INSTALL_DATA) VERSION "$(DATA_INSTALL_DIR)/VERSION" @$(INSTALL_DATA) AUTHORS "$(DATA_INSTALL_DIR)/AUTHORS" @$(INSTALL_DATA) COPYING "$(DATA_INSTALL_DIR)/COPYING" @@ -229,7 +209,7 @@ install-engine: @$(INSTALL_PROGRAM) ICSharpCode.SharpZipLib.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) FuzzyLogicLibrary.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) Open.Nat.dll "$(DATA_INSTALL_DIR)" - @$(INSTALL_PROGRAM) rix0rrr.BeaconLib.dll "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) BeaconLib.dll "$(DATA_INSTALL_DIR)" install-common-mod-files: @-echo "Installing OpenRA common mod files to $(DATA_INSTALL_DIR)" @@ -354,23 +334,28 @@ uninstall: help: @echo 'to compile, run:' - @echo ' make [DEBUG=false]' + @echo ' make [DEBUG=true]' @echo - @echo 'to check unit tests (requires NUnit version >= 2.6), run:' - @echo ' make nunit [NUNIT_CONSOLE=] [NUNIT_LIBS_PATH=] [NUNIT_LIBS=]' - @echo ' Use NUNIT_CONSOLE if nunit[3|2]-console was not downloaded by `make dependencies` nor is it in bin search paths' - @echo ' Use NUNIT_LIBS_PATH if NUnit libs are not in search paths. Include trailing /' - @echo ' Use NUNIT_LIBS if NUnit libs have different names (such as including a prefix or suffix)' + @echo 'to compile using system libraries for native dependencies, run:' + @echo ' make [DEBUG=true] TARGETPLATFORM=unix-generic' @echo @echo 'to check the official mods for erroneous yaml files, run:' @echo ' make test' @echo + @echo 'to check the engine and official mod dlls for code style violations, run:' + @echo ' make test' + @echo @echo 'to install, run:' @echo ' make [prefix=/foo] [bindir=/bar/bin] install' @echo @echo 'to install Linux startup scripts, desktop files and icons' @echo ' make install-linux-shortcuts [DEBUG=false]' @echo + @echo ' to install the engine and common mod files (omitting the default mods):' + @echo ' make install-engine' + @echo ' make install-dependencies' + @echo ' make install-common-mod-files' + @echo @echo 'to uninstall, run:' @echo ' make uninstall' @echo @@ -383,4 +368,4 @@ help: .SUFFIXES: -.PHONY: check-scripts check nunit test all core clean distclean cli-dependencies linux-dependencies linux-native-dependencies windows-dependencies osx-dependencies dependencies all-dependencies version install install-linux-shortcuts install-engine install-common-mod-files install-default-mods install-core install-linux-icons install-linux-desktop install-linux-mime install-linux-appdata install-man-page install-linux-scripts uninstall help +.PHONY: check-scripts check test all core clean version install install-linux-shortcuts install-dependencies install-engine install-common-mod-files install-default-mods install-core install-linux-icons install-linux-desktop install-linux-mime install-linux-appdata install-man-page install-linux-scripts uninstall help diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index 6e3e6c27d1..be505c8fa1 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -1,7 +1,7 @@  Exe - net461 + net472 true true false @@ -16,9 +16,14 @@ false false ..\OpenRA.ruleset - Release;Debug;Release-x86 + Release;Debug mono + + win-x64 + linux-x64 + osx-x64 + @@ -27,7 +32,7 @@ DEBUG;TRACE false - + true @@ -47,22 +52,15 @@ Game.Mod=ts - - ..\thirdparty\download\Open.Nat.dll - - - ..\thirdparty\download\Eluant.dll - False - - - ..\thirdparty\download\ICSharpCode.SharpZipLib.dll - False - false + + + + diff --git a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj index 297194f0bf..95ab290149 100644 --- a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj +++ b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj @@ -1,6 +1,6 @@  - net461 + net472 true true 5 @@ -21,10 +21,6 @@ false - - ..\thirdparty\download\Eluant.dll - False - False @@ -32,6 +28,7 @@ False + diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index d065dd6109..ced131ea4e 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -1,6 +1,6 @@  - net461 + net472 true true 5 @@ -20,29 +20,14 @@ DEBUG;TRACE false - - - ..\thirdparty\download\FuzzyLogicLibrary.dll - False - - - ..\thirdparty\download\rix0rrr.BeaconLib.dll - False - - - ..\thirdparty\download\Eluant.dll - False - - - ..\thirdparty\download\ICSharpCode.SharpZipLib.dll - False - - False + + + diff --git a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj index f65a3ed7d6..d8578219ce 100644 --- a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj +++ b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj @@ -1,6 +1,6 @@  - net461 + net472 true true 5 @@ -20,12 +20,6 @@ DEBUG;TRACE false - - - ..\thirdparty\download\Eluant.dll - False - - False @@ -34,6 +28,7 @@ False + diff --git a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj index fb7da2aed7..21860b456a 100644 --- a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj +++ b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj @@ -1,6 +1,6 @@  - net461 + net472 true true 5 @@ -12,6 +12,11 @@ false ..\OpenRA.ruleset + + win-x64 + linux-x64 + osx-x64 + @@ -20,20 +25,13 @@ DEBUG;TRACE false - - - ..\thirdparty\download\Eluant.dll - - - ..\thirdparty\download\SDL2-CS.dll - - - ..\thirdparty\download\OpenAL-CS.dll - - + + + + @@ -43,8 +41,8 @@ - + PreserveNewest - \ No newline at end of file + diff --git a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.dll.config b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.dll.config index 7f03455a06..b4c8ab1fd8 100644 --- a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.dll.config +++ b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.dll.config @@ -1,6 +1,5 @@ - - - + + diff --git a/OpenRA.PostProcess/OpenRA.PostProcess.csproj b/OpenRA.PostProcess/OpenRA.PostProcess.csproj index 188b2a8ac3..13d35a51f1 100644 --- a/OpenRA.PostProcess/OpenRA.PostProcess.csproj +++ b/OpenRA.PostProcess/OpenRA.PostProcess.csproj @@ -1,7 +1,7 @@  Exe - net461 + net472 true true false @@ -14,7 +14,7 @@ false false ..\OpenRA.ruleset - Debug;Release;Release-x86 + Debug;Release @@ -24,11 +24,12 @@ DEBUG;TRACE false - + true + diff --git a/OpenRA.Server/OpenRA.Server.csproj b/OpenRA.Server/OpenRA.Server.csproj index e442644989..91e9aa6aa6 100644 --- a/OpenRA.Server/OpenRA.Server.csproj +++ b/OpenRA.Server/OpenRA.Server.csproj @@ -1,7 +1,7 @@  Exe - net461 + net472 true true false @@ -14,7 +14,7 @@ false false ..\OpenRA.ruleset - Release;Debug;Release-x86 + Release;Debug mono @@ -25,7 +25,7 @@ DEBUG;TRACE false - + true @@ -34,6 +34,7 @@ false + @@ -46,4 +47,4 @@ - \ No newline at end of file + diff --git a/OpenRA.Test.nunit b/OpenRA.Test.nunit deleted file mode 100644 index b5e0fa8c9d..0000000000 --- a/OpenRA.Test.nunit +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/OpenRA.Test/OpenRA.Test.csproj b/OpenRA.Test/OpenRA.Test.csproj index 5dfb2a3aae..86f9239482 100644 --- a/OpenRA.Test/OpenRA.Test.csproj +++ b/OpenRA.Test/OpenRA.Test.csproj @@ -1,6 +1,6 @@  - net461 + net472 true 5 true @@ -19,24 +19,19 @@ DEBUG;TRACE false - - - ..\thirdparty\download\Eluant.dll - False - False - - - ..\thirdparty\download\nunit.framework.dll - False - False - - False + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/OpenRA.Utility/OpenRA.Utility.csproj b/OpenRA.Utility/OpenRA.Utility.csproj index e442644989..91e9aa6aa6 100644 --- a/OpenRA.Utility/OpenRA.Utility.csproj +++ b/OpenRA.Utility/OpenRA.Utility.csproj @@ -1,7 +1,7 @@  Exe - net461 + net472 true true false @@ -14,7 +14,7 @@ false false ..\OpenRA.ruleset - Release;Debug;Release-x86 + Release;Debug mono @@ -25,7 +25,7 @@ DEBUG;TRACE false - + true @@ -34,6 +34,7 @@ false + @@ -46,4 +47,4 @@ - \ No newline at end of file + diff --git a/OpenRA.sln b/OpenRA.sln index 491cce7a95..cab82d51a6 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -25,63 +25,44 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU - Release-x86|Any CPU = Release-x86|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Any CPU.Build.0 = Debug|Any CPU {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Any CPU.Build.0 = Release|Any CPU - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release-x86|Any CPU.ActiveCfg = Release-x86|Any CPU - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release-x86|Any CPU.Build.0 = Release-x86|Any CPU {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Any CPU.Build.0 = Release|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release-x86|Any CPU.ActiveCfg = Release|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release-x86|Any CPU.Build.0 = Release|Any CPU {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Any CPU.Build.0 = Release|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release-x86|Any CPU.ActiveCfg = Release-x86|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release-x86|Any CPU.Build.0 = Release-x86|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.Build.0 = Debug|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Any CPU.ActiveCfg = Release|Any CPU {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Any CPU.Build.0 = Release|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release-x86|Any CPU.ActiveCfg = Release-x86|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release-x86|Any CPU.Build.0 = Release-x86|Any CPU {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.Build.0 = Debug|Any CPU {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.ActiveCfg = Release|Any CPU {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.Build.0 = Release|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release-x86|Any CPU.ActiveCfg = Release|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release-x86|Any CPU.Build.0 = Release|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Debug|Any CPU.Build.0 = Debug|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Release|Any CPU.ActiveCfg = Release|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Release|Any CPU.Build.0 = Release|Any CPU - {33D03738-C154-4028-8EA8-63A3C488A651}.Release-x86|Any CPU.ActiveCfg = Release|Any CPU - {33D03738-C154-4028-8EA8-63A3C488A651}.Release-x86|Any CPU.Build.0 = Release|Any CPU {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Debug|Any CPU.Build.0 = Debug|Any CPU {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Release|Any CPU.ActiveCfg = Release|Any CPU {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Release|Any CPU.Build.0 = Release|Any CPU - {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Release-x86|Any CPU.ActiveCfg = Release|Any CPU - {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Release-x86|Any CPU.Build.0 = Release|Any CPU {6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Debug|Any CPU.Build.0 = Debug|Any CPU {6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Release|Any CPU.ActiveCfg = Release|Any CPU {6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Release|Any CPU.Build.0 = Release|Any CPU - {6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Release-x86|Any CPU.ActiveCfg = Release|Any CPU - {6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Release-x86|Any CPU.Build.0 = Release|Any CPU {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Release|Any CPU.Build.0 = Release|Any CPU - {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Release-x86|Any CPU.ActiveCfg = Release-x86|Any CPU - {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Release-x86|Any CPU.Build.0 = Release-x86|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/appveyor.yml b/appveyor.yml index c2af614331..a458c98158 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,43 +9,8 @@ environment: install: -cache: - - thirdparty\download -> thirdparty\fetch-thirdparty-deps.ps1 - -before_build: -- make dependencies - -build: - project: OpenRA.sln - verbosity: minimal - -after_build: -- ps: | - if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True") - { - cov-build.exe --dir cov-int make all - nuget.exe install PublishCoverity -ExcludeVersion - PublishCoverity\tools\PublishCoverity.exe compress -o coverity.zip -i cov-int - $version = Get-Date -format s - PublishCoverity\tools\PublishCoverity.exe publish ` - -t "$env:CoverityProjectToken" ` - -e "$env:CoverityNotificationEmail" ` - -r "$env:APPVEYOR_REPO_NAME" ` - -z coverity.zip ` - -d "AppVeyor scheduled build ($env:APPVEYOR_BUILD_VERSION)." ` - --codeVersion "$version" - } - -before_test: -- ps: | - if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True") - { - choco install resharper-clt -y - dupFinder /output=dupReport.xml /show-text OpenRA.sln - choco install xmlstarlet -y - xml transform dupFinder.xslt dupReport.xml > dupReport.html - choco install pandoc -y - } +build_script: + - make all test_script: - nunit3-console OpenRA.Test.dll --result=myresults.xml;format=AppVeyor @@ -67,7 +32,7 @@ after_test: - ps: cp packaging\windows\Dune2000.ico . - if defined APPVEYOR_REPO_TAG_NAME set VERSION=%APPVEYOR_REPO_TAG_NAME% - if not defined APPVEYOR_REPO_TAG_NAME set VERSION=%APPVEYOR_REPO_COMMIT:~0,7% - - '"C:\Program Files (x86)\NSIS\makensis.exe" /DSRCDIR="%APPVEYOR_BUILD_FOLDER%" /DDEPSDIR="%APPVEYOR_BUILD_FOLDER%\thirdparty\download\windows" /DTAG="git-%VERSION%" /DSUFFIX=" (dev)" /V3 packaging/windows/OpenRA.nsi' + - '"C:\Program Files (x86)\NSIS\makensis.exe" /DSRCDIR="%APPVEYOR_BUILD_FOLDER%" /DTAG="git-%VERSION%" /DSUFFIX=" (dev)" /V3 packaging/windows/OpenRA.nsi' - move /Y %APPVEYOR_BUILD_FOLDER%\packaging\windows\OpenRA.Setup.exe %APPVEYOR_BUILD_FOLDER%\OpenRA-%VERSION%.exe artifacts: diff --git a/configure-system-libraries.sh b/configure-system-libraries.sh new file mode 100755 index 0000000000..b101372ea8 --- /dev/null +++ b/configure-system-libraries.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# Patch *.dll.config files to use system libraries, working around issues with directories and naming schemes + +#### +# This file must stay /bin/sh and POSIX compliant for macOS and BSD portability. +# Copy-paste the entire script into http://shellcheck.net to check. +#### + +patch_config() +{ + LABEL=$1 + SEARCHDIRS=$2 + CONFIG=$3 + REPLACE=$4 + SEARCH=$5 + + # Exit early if the file has already been patched + grep -q "target=\"${REPLACE}\"" "${CONFIG}" || return 0 + + printf "Searching for %s... " "${LABEL}" + for DIR in ${SEARCHDIRS} ; do + for LIB in ${SEARCH}; do + if [ -f "${DIR}/${LIB}" ]; then + echo "${LIB}" + sed "s|target=\"${REPLACE}\"|target=\"${DIR}/${LIB}\"|" "${CONFIG}" > "${CONFIG}.temp" + mv "${CONFIG}.temp" "${CONFIG}" + return 0 + fi + done + done + + echo "FAILED" + + echo "OpenRA expects to find a file matching \"${SEARCH}\" in one of the following locations:" + echo "${SEARCHDIRS}" + exit 1 +} + +if [ "$(uname -s)" = "Darwin" ]; then + SEARCHDIRS="/usr/local/lib /usr/local/opt/openal-soft/lib" + patch_config "Lua 5.1" "${SEARCHDIRS}" Eluant.dll.config lua51.dylib liblua5.1.dylib + patch_config SDL2 "${SEARCHDIRS}" SDL2-CS.dll.config SDL2.dylib libSDL2-2.0.0.dylib + patch_config OpenAL "${SEARCHDIRS}" OpenAL-CS.Core.dll.config soft_oal.dylib libopenal.1.dylib + patch_config FreeType "${SEARCHDIRS}" OpenRA.Platforms.Default.dll.config freetype6.dylib libfreetype.6.dylib +else + SEARCHDIRS="/lib /lib64 /usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/arm-linux-gnueabihf /usr/lib/aarch64-linux-gnu /usr/lib/powerpc64le-linux-gnu /usr/lib/mipsel-linux-gnu /usr/local/lib /opt/lib /opt/local/lib /app/lib" + patch_config "Lua 5.1" "${SEARCHDIRS}" Eluant.dll.config lua51.so "liblua.so.5.1.5 liblua5.1.so.5.1 liblua5.1.so.0 liblua.so.5.1 liblua-5.1.so liblua5.1.so" + patch_config SDL2 "${SEARCHDIRS}" SDL2-CS.dll.config SDL2.so "libSDL2-2.0.so.0 libSDL2-2.0.so libSDL2.so" + patch_config OpenAL "${SEARCHDIRS}" OpenAL-CS.Core.dll.config soft_oal.so "libopenal.so.1 libopenal.so" + patch_config FreeType "${SEARCHDIRS}" OpenRA.Platforms.Default.dll.config freetype6.so "libfreetype.so.6 libfreetype.so" +fi diff --git a/make.ps1 b/make.ps1 index b99b46f5c7..94615cb3e3 100644 --- a/make.ps1 +++ b/make.ps1 @@ -10,8 +10,6 @@ function All-Command return } - Dependencies-Command - dotnet build /p:Configuration=Release /nologo if ($lastexitcode -ne 0) { @@ -101,27 +99,6 @@ function Version-Command } } -function Dependencies-Command -{ - cd thirdparty - ./fetch-thirdparty-deps.ps1 - cp download/*.dll .. - cp download/windows/*.dll .. - cd .. - Write-Host "Dependencies copied." -ForegroundColor Cyan - - if ((CheckForDotnet) -eq 1) - { - return - } - - dotnet restore /nologo - if ($lastexitcode -ne 0) - { - Write-Host "Project restoration failed." -ForegroundColor Red - } -} - function Test-Command { if ((CheckForUtility) -eq 1) @@ -244,7 +221,6 @@ if ($args.Length -eq 0) Write-Host "Command list:" Write-Host "" Write-Host " all, a Builds the game and its development tools." - Write-Host " dependencies, d Copies the game's dependencies into the main game folder." Write-Host " version, v Sets the version strings for the default mods to the" Write-Host " latest version for the current Git branch." Write-Host " clean, c Removes all built and copied files. Use the 'all' and" @@ -270,7 +246,6 @@ if ($command.Length -gt 1) switch ($execute) { {"all", "a" -contains $_} { All-Command } - {"dependencies", "d" -contains $_} { Dependencies-Command } {"version", "v" -contains $_} { Version-Command } {"clean", "c" -contains $_} { Clean-Command } {"test", "t" -contains $_} { Test-Command } diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 05e7656149..71d1ef37b7 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -7,7 +7,7 @@ command -v python >/dev/null 2>&1 || { echo >&2 "Linux packaging requires python command -v tar >/dev/null 2>&1 || { echo >&2 "Linux packaging requires tar."; exit 1; } command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "Linux packaging requires curl or wget."; exit 1; } -DEPENDENCIES_TAG="20200222" +DEPENDENCIES_TAG="20200328" if [ $# -eq "0" ]; then echo "Usage: $(basename "$0") version [outputdir]" @@ -48,24 +48,21 @@ pushd "${SRCDIR}" > /dev/null || exit 1 make clean -# linux-dependencies target will trigger the lua detection script, which we don't want during packaging -make cli-dependencies -sed "s/@LIBLUA51@/liblua5.1.so.0/" thirdparty/Eluant.dll.config.in > Eluant.dll.config - -make core +make core TARGETPLATFORM=linux-x64 make version VERSION="${TAG}" make install-engine prefix="usr" DESTDIR="${BUILTDIR}/" make install-common-mod-files prefix="usr" DESTDIR="${BUILTDIR}/" +make install-dependencies TARGETPLATFORM=linux-x64 prefix="usr" DESTDIR="${BUILTDIR}/" popd > /dev/null || exit 1 # Add native libraries echo "Downloading dependencies" if command -v curl >/dev/null 2>&1; then - curl -s -L -O https://github.com/OpenRA/AppImageSupport/releases/download/${DEPENDENCIES_TAG}/libs.tar.bz2 || exit 3 + curl -s -L -O https://github.com/OpenRA/AppImageSupport/releases/download/${DEPENDENCIES_TAG}/mono.tar.bz2 || exit 3 curl -s -L -O https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 else - wget -cq https://github.com/OpenRA/AppImageSupport/releases/download/${DEPENDENCIES_TAG}/libs.tar.bz2 || exit 3 + wget -cq https://github.com/OpenRA/AppImageSupport/releases/download/${DEPENDENCIES_TAG}/mono.tar.bz2 || exit 3 wget -cq https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 fi @@ -74,23 +71,24 @@ chmod a+x appimagetool-x86_64.AppImage echo "Building AppImage" mkdir libs pushd libs -tar xf ../libs.tar.bz2 +tar xf ../mono.tar.bz2 install -d "${BUILTDIR}/usr/bin" install -d "${BUILTDIR}/etc/mono/4.5" -install -d "${BUILTDIR}/usr/lib/mono/4.5" +install -d "${BUILTDIR}/usr/lib/mono/4.5/Facades" install -Dm 0755 usr/bin/mono "${BUILTDIR}/usr/bin/" install -Dm 0644 /etc/mono/config "${BUILTDIR}/etc/mono/" install -Dm 0644 /etc/mono/4.5/machine.config "${BUILTDIR}/etc/mono/4.5" +for f in $(ls usr/lib/mono/4.5/Facades/*.dll); do install -Dm 0644 "$f" "${BUILTDIR}/usr/lib/mono/4.5/Facades/"; done for f in $(ls usr/lib/mono/4.5/*.dll usr/lib/mono/4.5/*.exe); do install -Dm 0644 "$f" "${BUILTDIR}/usr/lib/mono/4.5/"; done -for f in $(ls usr/lib/*.so usr/lib/*.so.*); do install -Dm 0755 "$f" "${BUILTDIR}/usr/lib/"; done +for f in $(ls usr/lib/*.so); do install -Dm 0755 "$f" "${BUILTDIR}/usr/lib/"; done popd -rm -rf libs libs.tar.bz2 +rm -rf libs mono.tar.bz2 build_appimage() { MOD_ID=${1} diff --git a/packaging/macos/buildpackage.sh b/packaging/macos/buildpackage.sh index f4d7c4e1da..91568fe81e 100755 --- a/packaging/macos/buildpackage.sh +++ b/packaging/macos/buildpackage.sh @@ -13,7 +13,7 @@ # MACOS_DEVELOPER_PASSWORD: App-specific password for the developer account # -LAUNCHER_TAG="osx-launcher-20200316" +LAUNCHER_TAG="osx-launcher-20200328" if [ $# -ne "2" ]; then echo "Usage: $(basename "$0") tag outputdir" @@ -92,10 +92,10 @@ echo "Building core files" pushd "${SRCDIR}" > /dev/null || exit 1 make clean -make osx-dependencies -make core +make core TARGETPLATFORM=osx-x64 make version VERSION="${TAG}" make install-core gameinstalldir="/Contents/Resources/" DESTDIR="${BUILTDIR}/OpenRA.app" +make install-dependencies TARGETPLATFORM=osx-x64 gameinstalldir="/Contents/Resources/" DESTDIR="${BUILTDIR}/OpenRA.app" popd > /dev/null || exit 1 populate_bundle "OpenRA - Red Alert.app" "ra" "Red Alert" diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 2dc3d21297..44a1159765 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -129,15 +129,15 @@ Section "Game" GAME File "${SRCDIR}\TiberianDawn.ico" File "${SRCDIR}\Dune2000.ico" File "${SRCDIR}\SDL2-CS.dll" - File "${SRCDIR}\OpenAL-CS.dll" + File "${SRCDIR}\OpenAL-CS.Core.dll" File "${SRCDIR}\global mix database.dat" File "${SRCDIR}\IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP" File "${SRCDIR}\eluant.dll" - File "${SRCDIR}\rix0rrr.BeaconLib.dll" - File "${DEPSDIR}\soft_oal.dll" - File "${DEPSDIR}\SDL2.dll" - File "${DEPSDIR}\freetype6.dll" - File "${DEPSDIR}\lua51.dll" + File "${SRCDIR}\BeaconLib.dll" + File "${SRCDIR}\soft_oal.dll" + File "${SRCDIR}\SDL2.dll" + File "${SRCDIR}\freetype6.dll" + File "${SRCDIR}\lua51.dll" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$StartMenuFolder" @@ -191,9 +191,9 @@ Section "-DotNet" DotNet ; https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release" IfErrors error 0 - IntCmp $0 394254 done error done + IntCmp $0 461808 done error done error: - MessageBox MB_OK ".NET Framework v4.6.1 or later is required to run OpenRA." + MessageBox MB_OK ".NET Framework v4.7.2 or later is required to run OpenRA." Abort done: SectionEnd @@ -255,8 +255,8 @@ Function ${UN}Clean Delete $INSTDIR\eluant.dll Delete $INSTDIR\freetype6.dll Delete $INSTDIR\SDL2-CS.dll - Delete $INSTDIR\OpenAL-CS.dll - Delete $INSTDIR\rix0rrr.BeaconLib.dll + Delete $INSTDIR\OpenAL-CS.Core.dll + Delete $INSTDIR\BeaconLib.dll RMDir /r $INSTDIR\Support DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" diff --git a/packaging/windows/buildpackage.sh b/packaging/windows/buildpackage.sh index 83cdbef09c..b9b51bc947 100755 --- a/packaging/windows/buildpackage.sh +++ b/packaging/windows/buildpackage.sh @@ -39,19 +39,21 @@ function build_platform() { echo "Building core files ($1)" if [ "$1" = "x86" ]; then + TARGETPLATFORM="TARGETPLATFORM=win-x86" IS_WIN32="WIN32=true" USE_PROGRAMFILES32="-DUSE_PROGRAMFILES32=true" else IS_WIN32="WIN32=false" + TARGETPLATFORM="TARGETPLATFORM=win-x64" USE_PROGRAMFILES32="" fi pushd "${SRCDIR}" > /dev/null || exit 1 make clean - make windows-dependencies "${IS_WIN32}" - make core "${IS_WIN32}" + make core "${TARGETPLATFORM}" "${IS_WIN32}" make version VERSION="${TAG}" - make install-core gameinstalldir="" DESTDIR="${BUILTDIR}" + make install-core "${TARGETPLATFORM}" gameinstalldir="" DESTDIR="${BUILTDIR}" + make install-dependencies "${TARGETPLATFORM}" gameinstalldir="" DESTDIR="${BUILTDIR}" popd > /dev/null || exit 1 echo "Compiling Windows launchers ($1)" diff --git a/thirdparty/Eluant.dll.config.in b/thirdparty/Eluant.dll.config.in deleted file mode 100644 index e51cdb1fca..0000000000 --- a/thirdparty/Eluant.dll.config.in +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/thirdparty/configure-native-deps.sh b/thirdparty/configure-native-deps.sh deleted file mode 100755 index 997900198b..0000000000 --- a/thirdparty/configure-native-deps.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Use BSD/Linux system dependencies where possible, but take into account different .so names. - -#### -# This file must stay /bin/sh and POSIX compliant for BSD portability. -# Copy-paste the entire script into http://shellcheck.net to check. -#### - -locations="/lib /lib64 /usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/arm-linux-gnueabihf /usr/lib/aarch64-linux-gnu /usr/lib/powerpc64le-linux-gnu /usr/lib/mipsel-linux-gnu /usr/local/lib /opt/lib /opt/local/lib /app/lib" -sonames="liblua.so.5.1.5 liblua5.1.so.5.1 liblua5.1.so.0 liblua.so.5.1 liblua-5.1.so liblua5.1.so" - -if [ -f Eluant.dll.config ]; then - exit 0 -fi - -for location in $locations ; do - for soname in $sonames ; do - if [ -f "$location/$soname" ]; then - liblua51=$soname - echo "Detected Lua 5.1 library at $location/$soname" - break 2 - fi - done -done - -if [ -z "$liblua51" ]; then - echo "Lua 5.1 library detection failed." - exit 1 -else - sed "s/@LIBLUA51@/${liblua51}/" thirdparty/Eluant.dll.config.in > Eluant.dll.config - echo "Eluant.dll.config has been created successfully." -fi diff --git a/thirdparty/fetch-thirdparty-deps-osx.sh b/thirdparty/fetch-thirdparty-deps-osx.sh deleted file mode 100755 index 52e5db1776..0000000000 --- a/thirdparty/fetch-thirdparty-deps-osx.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -LAUNCHER_TAG="osx-launcher-20200316" - -download_dir="${0%/*}/download/osx" -mkdir -p "$download_dir" -cd "$download_dir" || exit 1 - -if [ ! -f libSDL2.dylib ]; then - echo "Fetching OS X SDL2 library from GitHub." - curl -LOs https://github.com/OpenRA/OpenRALauncherOSX/releases/download/${LAUNCHER_TAG}/libSDL2.dylib -fi - -if [ ! -f liblua.5.1.dylib ]; then - echo "Fetching OS X Lua 5.1 library from GitHub." - curl -LOs https://github.com/OpenRA/OpenRALauncherOSX/releases/download/${LAUNCHER_TAG}/liblua.5.1.dylib -fi - -if [ ! -f Eluant.dll.config ]; then - echo "Fetching OS X Lua configuration file from GitHub." - curl -LOs https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/${LAUNCHER_TAG}/Eluant.dll.config -fi - -if [ ! -f libfreetype.6.dylib ]; then - echo "Fetching OS X FreeType library from GitHub." - curl -LOs https://github.com/OpenRA/OpenRALauncherOSX/releases/download/${LAUNCHER_TAG}/libfreetype.6.dylib -fi - -if [ ! -f libopenal.1.dylib ]; then - echo "Fetching OS X OpenAL Soft library from GitHub." - curl -LOs https://github.com/OpenRA/OpenRALauncherOSX/releases/download/${LAUNCHER_TAG}/libopenal.1.dylib -fi diff --git a/thirdparty/fetch-thirdparty-deps-windows.sh b/thirdparty/fetch-thirdparty-deps-windows.sh deleted file mode 100755 index 0db6e09777..0000000000 --- a/thirdparty/fetch-thirdparty-deps-windows.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -# Die on any error for Travis CI to automatically retry: -set -e - -if [ $# -ne "1" ]; then - echo "Usage: $(basename "$0") (32|64)" - exit 1 -fi - -if [ "$1" != "x86" ] && [ "$1" != "x64" ]; then - echo "Usage: $(basename "$0") (32|64)" - exit 1 -fi - -download_dir="${0%/*}/download/windows" - -mkdir -p "${download_dir}" -cd "${download_dir}" || exit 1 - -if [ ! -f SDL2.dll ]; then - echo "Fetching SDL2 from libsdl.org" - if [ "$1" = "x86" ]; then - curl -LOs https://www.libsdl.org/release/SDL2-2.0.10-win32-x86.zip - unzip SDL2-2.0.10-win32-x86.zip SDL2.dll - rm SDL2-2.0.10-win32-x86.zip - else - curl -LOs https://www.libsdl.org/release/SDL2-2.0.10-win32-x64.zip - unzip SDL2-2.0.10-win32-x64.zip SDL2.dll - rm SDL2-2.0.10-win32-x64.zip - fi -fi - -if [ ! -f freetype6.dll ]; then - echo "Fetching FreeType2 from NuGet" - ../../noget.sh SharpFont.Dependencies 2.6.0 - if [ "$1" = "x86" ]; then - cp ./SharpFont.Dependencies/bin/msvc9/x86/freetype6.dll . - else - cp ./SharpFont.Dependencies/bin/msvc9/x64/freetype6.dll . - fi - rm -rf SharpFont.Dependencies -fi - -if [ ! -f lua51.dll ]; then - echo "Fetching Lua 5.1 from NuGet" - ../../noget.sh lua.binaries 5.1.5 - if [ "$1" = "x86" ]; then - cp ./lua.binaries/bin/win32/dll8/lua5.1.dll ./lua51.dll - else - cp ./lua.binaries/bin/win64/dll8/lua5.1.dll ./lua51.dll - fi - rm -rf lua.binaries -fi - -if [ ! -f soft_oal.dll ]; then - echo "Fetching OpenAL Soft from NuGet" - ../../noget.sh OpenAL-Soft 1.16.0 - if [ "$1" = "x86" ]; then - cp ./OpenAL-Soft/bin/Win32/soft_oal.dll ./soft_oal.dll - else - cp ./OpenAL-Soft/bin/Win64/soft_oal.dll ./soft_oal.dll - fi - rm -rf OpenAL-Soft -fi diff --git a/thirdparty/fetch-thirdparty-deps.ps1 b/thirdparty/fetch-thirdparty-deps.ps1 deleted file mode 100644 index 6c2bd28462..0000000000 --- a/thirdparty/fetch-thirdparty-deps.ps1 +++ /dev/null @@ -1,122 +0,0 @@ -mkdir download/windows -Force >$null - -cd download - -if (!(Test-Path "nuget.exe")) -{ - echo "Fetching NuGet." - # Work around PowerShell's Invoke-WebRequest not being available on some versions of PowerShell by using the BCL. - # To do that we need to work around further and use absolute paths because DownloadFile is not aware of PowerShell's current directory. - $target = Join-Path $pwd.ToString() "nuget.exe" - (New-Object System.Net.WebClient).DownloadFile("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", $target) -} - -if (!(Test-Path "ICSharpCode.SharpZipLib.dll")) -{ - echo "Fetching ICSharpCode.SharpZipLib from NuGet." - ./nuget.exe install SharpZipLib -Version 1.1.0 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp SharpZipLib/lib/net45/ICSharpCode.SharpZipLib.dll . - rmdir SharpZipLib -Recurse -} - -if (!(Test-Path "nunit.framework.dll")) -{ - echo "Fetching NUnit from NuGet." - ./nuget.exe install NUnit -Version 3.0.1 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp NUnit/lib/net40/nunit.framework* . - rmdir NUnit -Recurse -} - -if (!(Test-Path "windows/SDL2.dll")) -{ - echo "Fetching SDL2 from libsdl.org" - - # Download zip: - $zipFileName = "SDL2-2.0.10-win32-x64.zip" - $target = Join-Path $pwd.ToString() $zipFileName - (New-Object System.Net.WebClient).DownloadFile("https://www.libsdl.org/release/" + $zipFileName, $target) - - # Extract zip: - $shell_app=new-object -com shell.application - $currentPath = (Get-Location).Path - $zipFile = $shell_app.namespace($currentPath + "\$zipFileName") - $destination = $shell_app.namespace($currentPath + "\windows") - $destination.Copyhere($zipFile.items()) - - # Remove junk files: - rm "$zipFileName" - rm -path "$currentPath\windows\README-SDL.txt" -} - -if (!(Test-Path "Open.Nat.dll")) -{ - echo "Fetching Open.Nat from NuGet." - ./nuget.exe install Open.Nat -Version 2.1.0 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp Open.Nat/lib/net45/Open.Nat.dll . - rmdir Open.Nat -Recurse -} - -if (!(Test-Path "windows/lua51.dll")) -{ - echo "Fetching Lua 5.1 from NuGet." - ./nuget.exe install lua.binaries -Version 5.1.5 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp lua.binaries/bin/win64/dll8/lua5.1.dll ./windows/lua51.dll - rmdir lua.binaries -Recurse -} - -if (!(Test-Path "windows/freetype6.dll")) -{ - echo "Fetching FreeType2 from NuGet." - ./nuget.exe install SharpFont.Dependencies -Version 2.6.0 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp SharpFont.Dependencies/bin/msvc9/x64/freetype6.dll ./windows/freetype6.dll - rmdir SharpFont.Dependencies -Recurse -} - -if (!(Test-Path "windows/soft_oal.dll")) -{ - echo "Fetching OpenAL Soft from NuGet." - ./nuget.exe install OpenAL-Soft -Version 1.16.0 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp OpenAL-Soft/bin/Win64/soft_oal.dll windows/soft_oal.dll - rmdir OpenAL-Soft -Recurse -} - -if (!(Test-Path "FuzzyLogicLibrary.dll")) -{ - echo "Fetching FuzzyLogicLibrary from NuGet." - ./nuget.exe install FuzzyLogicLibrary -Version 1.2.0 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp FuzzyLogicLibrary/bin/Release/FuzzyLogicLibrary.dll . - rmdir FuzzyLogicLibrary -Recurse -} - -if (!(Test-Path "rix0rrr.BeaconLib.dll")) -{ - echo "Fetching rix0rrr.BeaconLib from NuGet." - ./nuget.exe install rix0rrr.BeaconLib -Version 1.0.1 -ExcludeVersion -Verbosity quiet -Source nuget.org - cp rix0rrr.BeaconLib/lib/net40/rix0rrr.BeaconLib.dll . - rmdir rix0rrr.BeaconLib -Recurse -} - -[Net.ServicePointManager]::SecurityProtocol = 'Tls12' - -if (!(Test-Path "SDL2-CS.dll")) -{ - echo "Fetching SDL2-CS from GitHub." - $target = Join-Path $pwd.ToString() "SDL2-CS.dll" - (New-Object System.Net.WebClient).DownloadFile("https://github.com/OpenRA/SDL2-CS/releases/download/20190907/SDL2-CS.dll", $target) -} - -if (!(Test-Path "OpenAL-CS.dll")) -{ - echo "Fetching OpenAL-CS from GitHub." - $target = Join-Path $pwd.ToString() "OpenAL-CS.dll" - (New-Object System.Net.WebClient).DownloadFile("https://github.com/OpenRA/OpenAL-CS/releases/download/20190907/OpenAL-CS.dll", $target) -} - -if (!(Test-Path "Eluant.dll")) -{ - echo "Fetching Eluant from GitHub." - $target = Join-Path $pwd.ToString() "Eluant.dll" - (New-Object System.Net.WebClient).DownloadFile("https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll", $target) -} - -cd .. diff --git a/thirdparty/fetch-thirdparty-deps.sh b/thirdparty/fetch-thirdparty-deps.sh deleted file mode 100755 index 1252f557d2..0000000000 --- a/thirdparty/fetch-thirdparty-deps.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh - -#### -# This file must stay /bin/sh and POSIX compliant for BSD portability. -# Copy-paste the entire script into http://shellcheck.net to check. -#### - -# Die on any error for Travis CI to automatically retry: -set -e - -download_dir="${0%/*}/download" - -mkdir -p "${download_dir}" -cd "${download_dir}" || exit 1 - -if [ ! -f ICSharpCode.SharpZipLib.dll ]; then - echo "Fetching ICSharpCode.SharpZipLib from NuGet" - ../noget.sh SharpZipLib 1.1.0 - cp ./SharpZipLib/lib/net45/ICSharpCode.SharpZipLib.dll . - rm -rf SharpZipLib -fi - -if [ ! -f nunit.framework.dll ]; then - echo "Fetching NUnit from NuGet" - ../noget.sh NUnit 3.0.1 - cp ./NUnit/lib/net40/nunit.framework* . - rm -rf NUnit -fi - -if [ ! -f nunit3-console.exe ]; then - echo "Fetching NUnit.Console from NuGet" - ../noget.sh NUnit.Console 3.0.1 - cp -R ./NUnit.Console/tools/* . - chmod +x nunit3-console.exe - rm -rf NUnit.Console -fi - -if [ ! -f Open.Nat.dll ]; then - echo "Fetching Open.Nat from NuGet" - ../noget.sh Open.Nat 2.1.0 - if [ -d ./Open.NAT ]; then mv Open.NAT Open.Nat; fi - cp ./Open.Nat/lib/net45/Open.Nat.dll . - rm -rf Open.Nat -fi - -if [ ! -f FuzzyLogicLibrary.dll ]; then - echo "Fetching FuzzyLogicLibrary from NuGet." - ../noget.sh FuzzyLogicLibrary 1.2.0 - cp ./FuzzyLogicLibrary/bin/Release/FuzzyLogicLibrary.dll . - rm -rf FuzzyLogicLibrary -fi - -if [ ! -f SDL2-CS.dll ] || [ ! -f SDL2-CS.dll.config ]; then - echo "Fetching SDL2-CS from GitHub." - if command -v curl >/dev/null 2>&1; then - curl -s -L -O https://github.com/OpenRA/SDL2-CS/releases/download/20190907/SDL2-CS.dll - curl -s -L -O https://github.com/OpenRA/SDL2-CS/releases/download/20190907/SDL2-CS.dll.config - else - wget -cq https://github.com/OpenRA/SDL2-CS/releases/download/20190907/SDL2-CS.dll - wget -cq https://github.com/OpenRA/SDL2-CS/releases/download/20190907/SDL2-CS.dll.config - fi -fi - -if [ ! -f OpenAL-CS.dll ] || [ ! -f OpenAL-CS.dll.config ]; then - echo "Fetching OpenAL-CS from GitHub." - if command -v curl >/dev/null 2>&1; then - curl -s -L -O https://github.com/OpenRA/OpenAL-CS/releases/download/20200316/OpenAL-CS.dll - curl -s -L -O https://github.com/OpenRA/OpenAL-CS/releases/download/20200316/OpenAL-CS.dll.config - else - wget -cq https://github.com/OpenRA/OpenAL-CS/releases/download/20200316/OpenAL-CS.dll - wget -cq https://github.com/OpenRA/OpenAL-CS/releases/download/20200316/OpenAL-CS.dll.config - fi -fi - -if [ ! -f Eluant.dll ]; then - echo "Fetching Eluant from GitHub." - if command -v curl >/dev/null 2>&1; then - curl -s -L -O https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll - else - wget -cq https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll - fi -fi - -if [ ! -f rix0rrr.BeaconLib.dll ]; then - echo "Fetching rix0rrr.BeaconLib from NuGet." - ../noget.sh rix0rrr.BeaconLib 1.0.1 - cp ./rix0rrr.BeaconLib/lib/net40/rix0rrr.BeaconLib.dll . - rm -rf rix0rrr.BeaconLib -fi diff --git a/thirdparty/noget.sh b/thirdparty/noget.sh deleted file mode 100755 index 6e9208a829..0000000000 --- a/thirdparty/noget.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# fallback without dependency resolution if nuget is not present on the system - -#### -# This file must stay /bin/sh and POSIX compliant for BSD portability. -# Copy-paste the entire script into http://shellcheck.net to check. -#### - -command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "Obtaining thirdparty dependencies requires curl or wget."; exit 1; } - -archive="$1" -version="$2" -if command -v curl >/dev/null 2>&1; then - curl -o "$archive.zip" -Ls https://nuget.org/api/v2/package/"$archive"/"$version" -else - wget -cq https://nuget.org/api/v2/package/"$archive"/"$version" -O "$archive.zip" -fi -mkdir -p "$archive" -unzip -o -qq "$archive.zip" -d "$archive" && rm "$archive.zip"