Browse Source

Add Dune 2 support

master
Fincer 7 years ago
parent
commit
0fb0469742
15 changed files with 639 additions and 54 deletions
  1. +61
    -15
      Readme.md
  2. +20
    -0
      data/linux/linux-d2-archlinux-pkgbuild.patch
  3. +88
    -15
      data/linux/openra-installscript.sh
  4. +33
    -0
      data/patches/linux/linux-d2-common.patch
  5. +10
    -0
      data/patches/linux/linux-d2-make-modstrings.patch
  6. +47
    -0
      data/patches/linux/linux-d2-make.patch
  7. +10
    -0
      data/patches/linux/linux-ra2-make-modstrings.patch
  8. +33
    -0
      data/patches/windows/windows-d2-common.patch
  9. +70
    -0
      data/patches/windows/windows-d2-csproj.patch
  10. +11
    -0
      data/patches/windows/windows-d2-make-modstrings.patch
  11. +20
    -0
      data/patches/windows/windows-d2-make.patch
  12. +22
    -0
      data/patches/windows/windows-d2-openra-solution.patch
  13. +11
    -0
      data/patches/windows/windows-ra2-make-modstrings.patch
  14. +145
    -15
      data/windows/install.ps1
  15. +58
    -9
      linux-install.sh

+ 61
- 15
Readme.md View File

@ -9,7 +9,7 @@ Introduction
**What is this all about?**
This Github repository provides a bunch of scripts for installing Tiberian Sun & RA2 on [OpenRA](http://www.openra.net/ "OpenRA homepage"), an open source implementation of classic Westwood RTS games.
This Github repository provides a bunch of scripts for installing Tiberian Sun & RA2 on [OpenRA](http://www.openra.net/ "OpenRA homepage"), an open source implementation of classic Westwood RTS games. Additionally, you can install Dune 2, too.
Tiberian Sun & Red Alert 2 are still officially "unfinished titles" in OpenRA, and thus not yet provided by official OpenRA sites as an easy download option. Their current gameplay status is considered as "pre-alpha", "not ready" or "only accessible to OpenRA developers".
@ -44,22 +44,23 @@ OS specific script working status listed below.
- Windows 10
- Windows 7
- Ubuntu (16.10, 16.04 LTS, 15.04 LTS)
- Linux Mint (18, 17.3, 17.2 & 17.1)
- Linux Mint (18, 17.3, 17.2)
- Debian (8.3.0)
- OpenSUSE (Tumbleweed, 42.1, 13.2)
- Fedora (24, 23, 22)
- Arch Linux
**May work.** Expect missing dependencies (see NOTE 2 below):
**May work.** Expect missing dependencies (see NOTE below):
- Ubuntu (15.10, 14.10, 14.04 LTS)
- Linux Mint (17.1)
**Doesn't work.** Missing dependencies (see NOTE 2 below):
**Doesn't work.** Missing dependencies (see NOTE below):
- Linux Mint (16)
- OpenSUSE (13.1)
**NOTE 2:** As package manager updates have been dropped from some old Linux operating systems, not all required packages to compile OpenRA may be available via internet anymore. However, if you have dependencies already installed on your system, the game may compile as expected (unless these packages are too old?). Optionally, you may be able to get missing dependencies from internet sources but get ready to spend hours for solving dependency hell issues & possible corrupted database headache.
**NOTE:** As package manager updates have been dropped from some old Linux operating systems, not all required packages to compile OpenRA may be available via internet anymore. However, if you have dependencies already installed on your system, the game may compile as expected (unless these packages are too old?). Optionally, you may be able to get missing dependencies from internet sources but get ready to spend hours for solving dependency hell issues & possible corrupted database headache.
**Installation instructions**
--------------
@ -111,9 +112,54 @@ You find these files from original RA2 installation media (CD's):
- theme.mix, multi.mix = RA2 CD Root folder
- ra2.mix, language.mix = RA2 CD Root/INSTALL/Game1.CAB (inside that archive file)
**OPTIONAL: Dune 2 - Post-installation instructions**
--------------
**NOTE:** Dune 2 must have been selected during the installation process in order to play it!
![alt text](https://img.youtube.com/vi/tppjzT-su0Q/default.jpg "Dune 2")
1) Launch the game
2) Select D2k
3) Click "Manage Content"
4) Click "Download" (in the "Base Game Files" row)
5) Click Back
6) Close the game
7) Get the following files from D2k
- DUNE.PAK
- VOC.PAK
- ATRE.PAK
- HARK.PAK
- ORDOS.PAK
- INTRO.PAK
- FINALE.PAK
OS specific folder paths:
```
\My Documents\OpenRA\Content\d2k\ (Windows)
```
```
.openra/Content/d2k/ (linux)
```
8) Put the files into
```
\My Documents\OpenRA\Content\d2\ (Windows)
```
```
.openra/Content/d2/ (linux)
```
9) Re-launch the game, select Dune 2 and click "Play"
**Multiplayer**
It's recommended to build OpenRA using exactly same GIT source files for multiplayer usage to minimize possible version differences/conflicts between players. Please make sure all players have exactly same git versions of their in-game mods (RA, CNC, D2K, TS, RA2). Version numbers are formatted like 'git-e0d7445' etc. and can be found in each mod description in the mod selection menu.
It's recommended to build OpenRA using exactly same GIT source files for multiplayer usage to minimize possible version differences/conflicts between players. Please make sure all players have exactly same git versions of their in-game mods (RA, CNC, D2, D2K, TS, RA2). Version numbers are formatted like 'git-e0d7445' etc. and can be found in each mod description in the mod selection menu.
**Uninstallation**
--------------
@ -169,9 +215,9 @@ in your terminal window.
**Patches**
Patches are files that are being used for patching the main game (OpenRA) so that it compiles successfully with Tiberian Sun & Red Alert 2 added.
Patches are files that are being used for patching the main game (OpenRA) so that it compiles successfully with Tiberian Sun & Red Alert 2 (& Dune 2) added.
Basically, Red Alert 2 locates in a different Github repository so patches are needed in order to merge it successfully with the OpenRA codebase. Additionally, some minor patch codes have been added for compilation of Tiberian Sun.
Basically, Red Alert 2 & Dune 2 locate in a different Github repositories so patches are needed in order to merge them successfully with the OpenRA codebase. Additionally, some minor patch codes have been added for compilation of Tiberian Sun.
Patches do not affect any bugs or features existing in the game.
@ -183,9 +229,9 @@ Usage: add new patch file into the /data/patches/linux/ directory (Linux) or \da
**Hotfixes**
Hotfixes are considered as patches as well (yes, they are patch files, too). The main difference between patches and hotfixes is that hotfixes are meant to be used to fix bugs or add features in the game codebase whereas patches just make OpenRA compilation process with Tiberian Sun & Red Alert 2 possible.
Hotfixes are considered as patches as well (yes, they are patch files, too). The main difference between patches and hotfixes is that hotfixes are meant to be used to fix bugs or add features in the game codebase whereas patches just make OpenRA compilation process with Tiberian Sun & Red Alert 2 (& Dune 2) possible.
Hotfixes are unofficial in nature. They've not officially been applied by OpenRA developers or any other party and thus playing the game with them may make your version of openra-tibsunra2 incompatible with the official 'openra-bleed' and RA2 mod, even if git version numbers match with other players you see in the lobby.
Hotfixes are unofficial in nature. They've not officially been applied by OpenRA developers or any other party and thus playing the game with them may make your version of openra-tibsunra2 incompatible with the official 'openra-bleed' and RA2/D2 mods, even if git version numbers match with other players you see in the lobby.
Hotfixes can be used with other players. However, the hotfixes must have been applied into openra-tibsunra2 versions of any players you want to play with (not forgetting compatibility of git version numbers).
@ -209,7 +255,6 @@ You need a Unix tool 'diff' to create new hotfixes (patch files). For additional
Remember to check "end of line" (Windows or Unix) for every hotfix patch file you create.
**FAQ**
--------------
![alt text](https://i.ytimg.com/vi/fnd0qg4I_MM/mqdefault.jpg "Mr. President, I'm afraid we have a heck of a situation down here...")
@ -245,7 +290,7 @@ On script related errors, please open a new issue on Github repository page:
[Issues - Fincer/openra-tibsunra2 script](https://github.com/Fincer/openra-tibsunra2/issues "Script issues")
If you are 100% sure the failure you've encountered is not caused by the script but happens even if OpenRA is manually compiled, please open a new issue or look for an existing issue here:
If you are 100% sure the failure you've encountered is not caused by the script but happens even if OpenRA is manually compiled, please open a new issue or look for an existing one here:
[Issues - OpenRA: main game](https://github.com/OpenRA/OpenRA/issues "OpenRA main game issues")
@ -253,7 +298,7 @@ or
[Issues - Red Alert 2: OpenRA mod](https://github.com/OpenRA/ra2/issues "OpenRA RA2 mod issues")
**NOTE 3:** If you don't open a new issue or decide to be silent, the error may never be fixed. Errors rarely get fixed by being passive or just hoping them to be suddenly fixed by a miracle. I may not even know the issue you have. You've been informed and warned.
**NOTE:** If you don't open a new issue or decide to be silent, the error may never be fixed. Errors rarely get fixed by being passive or just hoping them to be suddenly fixed by a miracle. I may not even know the issue you have. You've been informed and warned.
**I demand you to add or fix feature X! I surely won't do it but you will because I say so!**
@ -273,7 +318,7 @@ All official OpenRA Github pages are located at https://github.com/OpenRA/ + the
This is not anyone's fault. OpenRA, as the name suggests, is an open source project done by volunteers at their will. Especially, Tiberian Sun & Red Alert 2 titles in OpenRA are known to still miss critical features existing in the original Westwood games. For example, you shouldn't expect for playable TS/RA2 missions until these features have been implemented. And yes, it can take time - a lot of it.
OpenRA is an ambitious project trying to bring all Westwood classic RTS's as modernized versions to PC platforms as free. The project demands time, improvising, tweaking the code and very well organized project management which has its priorities. Many issues are found in [OpenRA/OpenRA](https://github.com/OpenRA/OpenRA/issues) and [OpenRA/ra2](https://github.com/OpenRA/ra2/issues) Github repositories, but the question is, how many developers are there around to address these issues, especially when we're talking about an open source project? To ask why TS or RA2 are still in development, let me put it simple: less developers -> less workforce -> more prioritizing -> delays in schedule. This may not be the case in OpenRA but, generally speaking, it likely can be.
OpenRA is an ambitious project trying to bring all Westwood classic RTS's as modernized versions to PC platforms as free. The project demands time, improvising, tweaking the code and very well organized project management which has its priorities. Many issues are found in [OpenRA/OpenRA](https://github.com/OpenRA/OpenRA/issues) and [OpenRA/ra2](https://github.com/OpenRA/ra2/issues) Github repositories, but the question is, how many active developers are there around to address these issues, especially when we're talking about an open source project? To ask why TS or RA2 are still in development, let me put it simple: less developers -> less workforce -> more prioritizing -> delays in schedule. This may not be the case in OpenRA but, generally speaking, it likely can be.
If you feel you want and are able to speed up the development process of OpenRA or TS/RA2, please consider contacting OpenRA development team (read: I'm not the one you should contact) or contributing the OpenRA project otherwise. You can help the team with coding or adding gameplay features or anything that is important and is considered as important to the project by the OpenRA developers.
@ -305,7 +350,7 @@ According to [GraionDilach](https://github.com/GraionDilach) (OpenRA developer),
Full comment [here](https://github.com/OpenRA/ra2/issues/309#issuecomment-257545830)
If you feel you'd like to start the Yuri's Revenge project today, please feel free to do so. At least, the support for it will likely be added to this installation script.
If you feel you'd like to start the Yuri's Revenge project today, please feel free to do so. At least, the support for it will likely be added to this installation script and be praised by members of CnC community.
**Good OpenRA websites to check at**
@ -313,6 +358,7 @@ Project sites:
- [OpenRA homepage](www.openra.net)
- [OpenRA Github project page](https://github.com/OpenRA/OpenRA)
- [OpenRA Red Alert 2 Github project page](https://github.com/OpenRA/ra2)
- [OpenRA Dune 2 Github project page](https://github.com/OpenRA/d2)
Social media/Community sites:
- [OpenRA Youtube channel](https://www.youtube.com/channel/UCRoiPL1J4K1-EhQeNazrYig)


+ 20
- 0
data/linux/linux-d2-archlinux-pkgbuild.patch View File

@ -0,0 +1,20 @@
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -28,6 +28,17 @@
build() {
+# Move Dune 2 Github files to the right place:
+ cd "$srcdir/d2"
+ mv ./OpenRA.Mods.D2 "$srcdir/$pkgname-src/"
+ mkdir -p "$srcdir/$pkgname-src/mods/d2/"
+ mv ./* "$srcdir/$pkgname-src/mods/d2/"
+
+# Get Dune 2 GIT version number for files
+ d2_version=git-$(git ls-remote https://github.com/OpenRA/d2.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
+ sed -i "s/Version: {DEV_VERSION}/Version: $d2_version/g" $srcdir/$pkgname-src/mods/d2/mod.yaml
+ sed -i "s/maps\/d2\/{DEV_VERSION}/maps\/d2\/$d2_version/g" $srcdir/$pkgname-src/mods/d2/mod.yaml
+
# Move Red Alert 2 Github files to the right place:
cd "$srcdir/ra2"
mv ./OpenRA.Mods.RA2 "$srcdir/$pkgname-src/"

+ 88
- 15
data/linux/openra-installscript.sh View File

@ -132,12 +132,12 @@ set -e
## Installation of OpenRA compilation dependencies and user notification message
echo -e "\n$bold_in***Welcome Comrade*** $out\n"
echo -e "This script compiles and installs OpenRA from source with Tiberian Sun & Red Alert 2.\n
echo -e "This script compiles and installs OpenRA from source with Tiberian Sun & Red Alert 2. Optionally Dune 2 can be installed, too.\n
- The script is NOT made by the developers of OpenRA and may contain bugs.
- The script creates an installation package using OpenRA source code and additional Red Alert 2 mod files from Github.\n\nNOTE: As the development of OpenRA & Red Alert 2 continues, this script will likely become unusable some day. Please, feel free to modify it if necessary."
- The script creates an installation package using OpenRA source code and additional Red Alert 2 (and optionally Dune 2) mod files from Github.\n\nNOTE: As the development of OpenRA & Red Alert 2 (& Dune 2) continues, this script will likely become unusable some day. Please, feel free to modify it if necessary."
if [[ $DISTRO =~ $UBUNTU ]]; then
echo -e "$line_in\nThe script has been tested on:\n\nDistribution\t\tStatus$out\nUbuntu 16.10$green_in\tOK$out\nUbuntu 16.04 LTS$green_in\tOK$out\nUbuntu 15.10$yellow_in\t\tOK (missing dependencies?)$out\nUbuntu 15.04 LTS$green_in\tOK$out\nUbuntu 14.10$yellow_in\t\tOK (missing dependencies?)$out\nUbuntu 14.04 LTS$yellow_in\tOK (missing dependencies?)$out\nLinux Mint 18$green_in\t\tOK$out\nLinux Mint 17.3$green_in\t\tOK$out\nLinux Mint 17.2$green_in\t\tOK$out\nLinux Mint 17.1$yellow_in\t\tOK (missing dependencies?)$out\nLinux Mint 16$red_in\t\tFailure$out$dim_in (missing dependencies)$out\n"
echo -e "$line_in\nThe script has been tested on:\n\nDistribution\t\tStatus$out\nUbuntu 16.10$green_in\t\tOK$out\nUbuntu 16.04 LTS$green_in\tOK$out\nUbuntu 15.10$yellow_in\t\tOK (missing dependencies?)$out\nUbuntu 15.04 LTS$green_in\tOK$out\nUbuntu 14.10$yellow_in\t\tOK (missing dependencies?)$out\nUbuntu 14.04 LTS$yellow_in\tOK (missing dependencies?)$out\nLinux Mint 18$green_in\t\tOK$out\nLinux Mint 17.3$green_in\t\tOK$out\nLinux Mint 17.2$green_in\t\tOK$out\nLinux Mint 17.1$yellow_in\t\tOK (missing dependencies?)$out\nLinux Mint 16$red_in\t\tFailure$out$dim_in (missing dependencies)$out\n"
elif [[ $DISTRO =~ $DEBIAN ]]; then
echo -e "$line_in\nThe script has been tested on:\n\nDistribution\t\tStatus$out\nDebian 8.3 $green_in\t\tOK$out\n"
elif [[ $DISTRO =~ $OPENSUSE ]]; then
@ -160,6 +160,9 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
read -r -p "Please type 1 or 2 (Default: 2): " number
sleep 1
echo -e "\nDune 2 -- Question\n"
read -r -p "Additionally, Dune 2 can be installed, too. Do you want to install it? [y/N] (Default: y) " dune2_install
if [[ ! $(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | wc -l) -eq 0 ]]; then
echo -e "\nHotfixes -- Question\n"
echo -e "Use custom hotfixes if added by the user (Default: No)?\nNOTE: If you choose YES (y), be aware that your OpenRA/RA2 version will likely not be compatible with the other players unless they've applied exactly same hotfixes in their game versions, too!"
@ -200,6 +203,13 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
fi
fi
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
echo -e "Install Dune 2:$bold_in Yes$out"
else
echo -e "Install Dune 2:$bold_in No$out"
fi
sleep 3
################################################
##Sudo/Root check function for dependency packages installation process
@ -285,13 +295,17 @@ function sudocheck() {
sleep 2
#*********************************************************************************************************
## PART 2/7
## PART 2/7 - 1
#
## Download the latest OpenRA & Red Alert 2 source files from Github, create build directories to the user's home directory.
## Once Red Alert 2 source files have been downloaded, move them to the OpenRA parent source directory.
## Add several missing directories for Red Alert 2.
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
echo -e "$bold_in\n2/7 ***Downloading OpenRA source code & Red Alert 2 + Dune 2 mod files from Github***\n$out"
else
echo -e "$bold_in\n2/7 ***Downloading OpenRA source code & Red Alert 2 mod files from Github***\n$out"
fi
sleep 2
echo -e "Part 1 (OpenRA source code):\n"
@ -312,7 +326,32 @@ function sudocheck() {
mkdir "$RA2_MISSINGDIR2"
fi
cp ./data/patches/linux/*.patch $HOME/openra-master/
#*********************************************************************************************************
## OPTIONAL: PART 2/7 - 2
#
## Download the latest Dune 2 mod files from Github
## Once Dune 2 source files have been downloaded, move them to the OpenRA parent source directory.
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
echo -e "\nPart 3 (Dune 2 mod files):\n"
git clone -b master https://github.com/OpenRA/d2.git $HOME/openra-master/d2 && \
mv $HOME/openra-master/d2/OpenRA.Mods.D2 $HOME/openra-master/$PACKAGE && \
mv $HOME/openra-master/d2 $HOME/openra-master/$PACKAGE/mods/
fi
#*********************************************************************************************************
## Apply patches & hotfixes
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
#Copy all patch files excluding the one which modifies 'mods' string in the Linux Makefile (double patching it will cause conflicts between D2 and RA2)
cp ./data/patches/linux/*.patch $HOME/openra-master/
rm $HOME/openra-master/linux-ra2-make-modstrings.patch
else
#Copy all patch files excluding the ones for Dune 2.
cp ./data/patches/linux/*.patch $HOME/openra-master/
rm $HOME/openra-master/linux-d2*.patch
fi
if [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then
cp ./data/hotfixes/linux/*.patch $HOME/openra-master/
@ -323,7 +362,11 @@ function sudocheck() {
#
## Patch several OpenRA source files (Makefile and such) for Tiberian Sun & Red Alert 2
echo -e "$bold_in\n3/7 ***Preparing OpenRA source files for Tiberian Sun & Red Alert 2***\n$out"
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
echo -e "$bold_in\n3/7 ***Preparing OpenRA source files for Dune 2, Tiberian Sun & Red Alert 2***\n$out"
else
echo -e "$bold_in\n3/7 ***Preparing OpenRA source files for Tiberian Sun & Red Alert 2***\n$out"
fi
sleep 2
for i in $HOME/openra-master/*.patch; do patch -d $HOME/openra-master/$PACKAGE -Np1 < $i; done
@ -337,18 +380,40 @@ RA2_VERSION=git-$(git ls-remote https://github.com/OpenRA/ra2.git | head -1 | se
OPENRA_PKGVERSION=$(git ls-remote https://github.com/OpenRA/OpenRA.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
RA2_PKGVERSION=$(git ls-remote https://github.com/OpenRA/ra2.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
# Get version number for Dune 2 mod files if the mod is about to be installed (Github)
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
D2_VERSION=git-$(git ls-remote https://github.com/OpenRA/d2.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
sed -i "s/Version: {DEV_VERSION}/Version: $D2_VERSION/g" $HOME/openra-master/$PACKAGE/mods/d2/mod.yaml
sed -i "s/maps\/ra2\/{DEV_VERSION}/maps\/ra2\/$D2_VERSION/g" $HOME/openra-master/$PACKAGE/mods/d2/mod.yaml
D2_PKGVERSION=$(git ls-remote https://github.com/OpenRA/d2.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
fi
#*********************************************************************************************************
## PART 4/7
#
## Compile the game
##Change OpenRA version as it is in Github
mv $HOME/openra-master/$PACKAGE $HOME/openra-master/$PACKAGE-$OPENRA_PKGVERSION$RA2_PKGVERSION
##Change OpenRA version as it is in Github & change PACKAGE variable after that
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
mv $HOME/openra-master/$PACKAGE $HOME/openra-master/$PACKAGE-$OPENRA_PKGVERSION$RA2_PKGVERSION$D2_PKGVERSION
PACKAGE=$PACKAGE-$OPENRA_PKGVERSION$RA2_PKGVERSION$D2_PKGVERSION
else
mv $HOME/openra-master/$PACKAGE $HOME/openra-master/$PACKAGE-$OPENRA_PKGVERSION$RA2_PKGVERSION
##Change PACKAGE variabl
PACKAGE=$PACKAGE_NAME-$OPENRA_PKGVERSION$RA2_PKGVERSION
PACKAGE=$PACKAGE_NAME-$OPENRA_PKGVERSION$RA2_PKGVERSION
fi
echo -e "$bold_in\n4/7 ***Starting OpenRA compilation with Tiberian Sun & Red Alert 2***$out"
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
echo -e "$bold_in\n4/7 ***Starting OpenRA compilation with Dune 2, Tiberian Sun & Red Alert 2***
$out"
else
echo -e "$bold_in\n4/7 ***Starting OpenRA compilation with Tiberian Sun & Red Alert 2***$out"
fi
sleep 2
if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
cd $HOME/openra-master/$PACKAGE && \
@ -363,9 +428,13 @@ RA2_PKGVERSION=$(git ls-remote https://github.com/OpenRA/ra2.git | head -1 | sed
rm $HOME/openra-master/$PACKAGE/mods/ra/OpenRA.Mods.RA.dll.mdb
rm $HOME/openra-master/$PACKAGE/mods/ra2/{.gitattributes,.gitignore,.travis.yml,build.cake,OpenRA.Mods.RA2.dll.mdb,make.cmd,make.ps1,makefile}
rm $HOME/openra-master/$PACKAGE/mods/ts/OpenRA.Mods.TS.dll.mdb
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
rm $HOME/openra-master/$PACKAGE/mods/d2/OpenRA.Mods.D2.dll.mdb
fi
# rm $HOME/openra-master/$PACKAGE/{SharpFont.dll.config,SDL2-CS.dll.config,OpenAL-CS.dll.config,Eluant.dll.config}
##Can't remove .config files at this moment due to deb packaging mechanism
##Can't remove .config files at this moment due to deb packaging mechanism!
echo -e "$bold_in\n5/7 ***Preparing OpenRA deb package. This takes a while. Please wait.***\n$out"
dh_make --createorig -s -y && \
@ -389,8 +458,12 @@ RA2_PKGVERSION=$(git ls-remote https://github.com/OpenRA/ra2.git | head -1 | sed
cp ./data/linux/opensuse/openra.spec $HOME/openra-master/rpmbuild/SPECS/
cp ./data/linux/opensuse/{GeoLite2-Country.mmdb.gz,thirdparty.tar.gz} $HOME/openra-master/rpmbuild/SOURCES/
##Change OpenRA + RA2 version as it is in Github
sed -i "s/Version: 1/Version: $OPENRA_PKGVERSION$RA2_PKGVERSION/g" $HOME/openra-master/rpmbuild/SPECS/openra.spec
##Change OpenRA + RA2 (& Dune 2) version as it is in Github
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
sed -i "s/Version: 1/Version: $OPENRA_PKGVERSION$RA2_PKGVERSION$D2_PKGVERSION/g" $HOME/openra-master/rpmbuild/SPECS/openra.spec
else
sed -i "s/Version: 1/Version: $OPENRA_PKGVERSION$RA2_PKGVERSION/g" $HOME/openra-master/rpmbuild/SPECS/openra.spec
fi
cd $HOME/openra-master
tar -czf $HOME/openra-master/rpmbuild/SOURCES/$PACKAGE.tar.gz ./$PACKAGE


+ 33
- 0
data/patches/linux/linux-d2-common.patch View File

@ -0,0 +1,33 @@
--- a/mods/all/mod.yaml
+++ b/mods/all/mod.yaml
@@ -17,6 +17,7 @@
Assemblies:
./mods/common/OpenRA.Mods.Common.dll
./mods/ra/OpenRA.Mods.RA.dll
+ ./mods/d2/OpenRA.Mods.D2.dll
./mods/d2k/OpenRA.Mods.D2k.dll
./mods/cnc/OpenRA.Mods.Cnc.dll
./mods/ts/OpenRA.Mods.TS.dll
--- a/mods/d2/mod.yaml
+++ b/mods/d2/mod.yaml
@@ -5,7 +5,7 @@
Author: the OpenRA Developers
RequiresMods:
- modchooser: {DEV_VERSION}
+
Packages:
~^Content/d2
--- a/utility.cmd
+++ b/utility.cmd
@@ -17,6 +17,7 @@
if /I "%mod%" EQU "cnc" (goto help)
if /I "%mod%" EQU "ts" (goto help)
if /I "%mod%" EQU "d2k" (goto help)
+if /I "%mod%" EQU "d2" (goto help)
echo.
echo Unknown mod: %mod%
echo.

+ 10
- 0
data/patches/linux/linux-d2-make-modstrings.patch View File

@ -0,0 +1,10 @@
--- a/Makefile
+++ b/Makefile
@@ -324,7 +339,7 @@
package: all-dependencies core tools docs version
-mods: mod_common mod_ra mod_cnc mod_d2k mod_ts
+mods: mod_common mod_ra mod_cnc mod_d2k mod_d2 mod_ts mod_ra2
all: dependencies core tools

+ 47
- 0
data/patches/linux/linux-d2-make.patch View File

@ -0,0 +1,47 @@
--- a/Makefile
+++ b/Makefile
@@ -173,6 +173,15 @@
PROGRAMS += mod_d2k
mod_d2k: $(mod_d2k_TARGET)
+# Dune 2
+mod_d2_SRCS := $(shell find OpenRA.Mods.D2/ -iname '*.cs')
+mod_d2_TARGET = mods/d2/OpenRA.Mods.D2.dll
+mod_d2_KIND = library
+mod_d2_DEPS = $(STD_MOD_DEPS) $(mod_common_TARGET)
+mod_d2_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET)
+PROGRAMS += mod_d2
+mod_d2: $(mod_d2_TARGET)
+
# Tiberian Sun
mod_ts_SRCS := $(shell find OpenRA.Mods.TS/ -iname '*.cs')
mod_ts_TARGET = mods/ts/OpenRA.Mods.TS.dll
@@ -214,6 +223,9 @@
@echo "Checking for code style violations in OpenRA.Mods.D2k..."
@mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.D2k
@echo
+ @echo "Checking for code style violations in OpenRA.Mods.D2..."
+ @mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.D2
+ @echo
@echo "Checking for code style violations in OpenRA.Mods.TS..."
@mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.TS
@echo
@@ -247,6 +259,9 @@
test: utility mods
@echo
+ @echo "Testing Dune 2 mod MiniYAML..."
+ @mono --debug OpenRA.Utility.exe d2 --check-yaml
+ @echo
@echo "Testing Tiberian Sun mod MiniYAML..."
@mono --debug OpenRA.Utility.exe ts --check-yaml
@echo
@@ -391,6 +406,8 @@
@$(INSTALL_PROGRAM) $(mod_cnc_TARGET) "$(DATA_INSTALL_DIR)/mods/cnc"
@$(CP_R) mods/ra "$(DATA_INSTALL_DIR)/mods/"
@$(INSTALL_PROGRAM) $(mod_ra_TARGET) "$(DATA_INSTALL_DIR)/mods/ra"
+ @$(CP_R) mods/d2 "$(DATA_INSTALL_DIR)/mods/"
+ @$(INSTALL_PROGRAM) $(mod_d2_TARGET) "$(DATA_INSTALL_DIR)/mods/d2"
@$(CP_R) mods/d2k "$(DATA_INSTALL_DIR)/mods/"
@$(INSTALL_PROGRAM) $(mod_d2k_TARGET) "$(DATA_INSTALL_DIR)/mods/d2k"
@$(CP_R) mods/modchooser "$(DATA_INSTALL_DIR)/mods/"

+ 10
- 0
data/patches/linux/linux-ra2-make-modstrings.patch View File

@ -0,0 +1,10 @@
--- a/Makefile
+++ b/Makefile
@@ -324,7 +339,7 @@
package: all-dependencies core tools docs version
-mods: mod_common mod_ra mod_cnc mod_d2k mod_ts
+mods: mod_common mod_ra mod_cnc mod_d2k mod_ts mod_ra2
all: dependencies core tools

+ 33
- 0
data/patches/windows/windows-d2-common.patch View File

@ -0,0 +1,33 @@
--- a/mods/all/mod.yaml
+++ b/mods/all/mod.yaml
@@ -17,6 +17,7 @@
Assemblies:
./mods/common/OpenRA.Mods.Common.dll
./mods/ra/OpenRA.Mods.RA.dll
+ ./mods/d2/OpenRA.Mods.D2.dll
./mods/d2k/OpenRA.Mods.D2k.dll
./mods/cnc/OpenRA.Mods.Cnc.dll
./mods/ts/OpenRA.Mods.TS.dll
--- a/mods/d2/mod.yaml
+++ b/mods/d2/mod.yaml
@@ -5,7 +5,7 @@
Author: the OpenRA Developers
RequiresMods:
- modchooser: {DEV_VERSION}
+
Packages:
~^Content/d2
--- a/utility.cmd
+++ b/utility.cmd
@@ -17,6 +17,7 @@
if /I "%mod%" EQU "cnc" (goto help)
if /I "%mod%" EQU "ts" (goto help)
if /I "%mod%" EQU "d2k" (goto help)
+if /I "%mod%" EQU "d2" (goto help)
echo.
echo Unknown mod: %mod%
echo.

+ 70
- 0
data/patches/windows/windows-d2-csproj.patch View File

@ -0,0 +1,70 @@
--- a/OpenRA.Mods.D2/OpenRA.Mods.D2.csproj
+++ b/OpenRA.Mods.D2/OpenRA.Mods.D2.csproj
@@ -17,8 +17,8 @@
<ErrorReport>prompt</ErrorReport>
<OutputPath>bin\Debug\</OutputPath>
<CustomCommands>
- <Command type="AfterBuild" command="cp ${TargetFile} .." workingdir="${ProjectDir}" />
- <Command type="AfterBuild" command="cp ${TargetFile}.mdb .." workingdir="${ProjectDir}" />
+ <Command type="AfterBuild" command="cp ${TargetFile} ../mods/d2" workingdir="${ProjectDir}" />
+ <Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/d2" workingdir="${ProjectDir}" />
</CustomCommands>
<DefineConstants>TRACE;DEBUG;</DefineConstants>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
@@ -36,20 +36,20 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Optimize>true</Optimize>
<CustomCommands>
- <Command type="AfterBuild" command="cp ${TargetFile} .." workingdir="${ProjectDir}" />
- <Command type="AfterBuild" command="cp ${TargetFile}.mdb .." workingdir="${ProjectDir}" />
+ <Command type="AfterBuild" command="cp ${TargetFile} ../mods/d2" workingdir="${ProjectDir}" />
+ <Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/d2" workingdir="${ProjectDir}" />
</CustomCommands>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenRA.Game">
- <HintPath>dependencies\OpenRA.Game.exe</HintPath>
+ <HintPath>..\OpenRA.Mods.RA\OpenRA.Game.exe</HintPath>
</Reference>
<Reference Include="OpenRA.Mods.Common">
- <HintPath>dependencies\OpenRA.Mods.Common.dll</HintPath>
+ <HintPath>..\OpenRA.Mods.RA\OpenRA.Mods.Common.dll</HintPath>
</Reference>
<Reference Include="Eluant">
- <HintPath>dependencies\Eluant.dll</HintPath>
+ <HintPath>..\thirdparty\download\Eluant.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
@@ -59,6 +59,18 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
+ <Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
+ <Name>OpenRA.Game</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\OpenRA.Mods.Common\OpenRA.Mods.Common.csproj">
+ <Project>{fe6c8cc0-2f07-442a-b29f-17617b3b7fc6}</Project>
+ <Name>OpenRA.Mods.Common</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ </ItemGroup>
<ItemGroup>
<Compile Include="SpriteLoaders\IcnD2Loader.cs" />
<Compile Include="SpriteLoaders\CpsD2Loader.cs" />
@@ -72,7 +84,8 @@
<Compile Include="D2LoadScreen.cs" />
</ItemGroup>
<PropertyGroup>
- <PostBuildEvent>copy $(TargetPath) $(ProjectDir)..
-</PostBuildEvent>
+ <PostBuildEvent>mkdir "$(SolutionDir)mods/d2/"
+copy "$(TargetPath)" "$(SolutionDir)mods/d2/"
+cd "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file

+ 11
- 0
data/patches/windows/windows-d2-make-modstrings.patch View File

@ -0,0 +1,11 @@
--- a/make.ps1
+++ b/make.ps1
@@ -108,7 +108,7 @@
if ($version -ne $null)
{
- $mods = @("mods/ra/mod.yaml", "mods/cnc/mod.yaml", "mods/d2k/mod.yaml", "mods/ts/mod.yaml", "mods/modchooser/mod.yaml", "mods/all/mod.yaml")
+ $mods = @("mods/ra/mod.yaml", "mods/cnc/mod.yaml", "mods/d2k/mod.yaml", "mods/d2/mod.yaml", "mods/ts/mod.yaml", "mods/ra2/mod.yaml", "mods/modchooser/mod.yaml", "mods/all/mod.yaml")
foreach ($mod in $mods)
{
$replacement = (gc $mod) -Replace "Version:.*", ("Version: {0}" -f $version)

+ 20
- 0
data/patches/windows/windows-d2-make.patch View File

@ -0,0 +1,20 @@
--- a/make.ps1
+++ b/make.ps1
@@ -154,6 +154,8 @@
./OpenRA.Utility.exe cnc --check-yaml
echo "Testing Red Alert mod MiniYAML..."
./OpenRA.Utility.exe ra --check-yaml
+ echo "Testing Dune 2 mod MiniYAML..."
+ ./OpenRA.Utility.exe d2 --check-yaml
}
else
{
@@ -178,6 +180,8 @@
./OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.RA
echo "Checking for code style violations in OpenRA.Mods.Cnc..."
./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.Cnc
+ echo "Checking for code style violations in OpenRA.Mods.D2..."
+ ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.D2
echo "Checking for code style violations in OpenRA.Mods.D2k..."
./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.D2k
echo "Checking for code style violations in OpenRA.Mods.TS..."

+ 22
- 0
data/patches/windows/windows-d2-openra-solution.patch View File

@ -0,0 +1,22 @@
--- a/OpenRA.sln
+++ b/OpenRA.sln
@@ -13,6 +13,8 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Server", "OpenRA.Server\OpenRA.Server.csproj", "{76F621A1-3D8E-4A99-9F7E-B071EB657817}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.D2", "OpenRA.Mods.D2\OpenRA.Mods.D2.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4341}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.D2k", "OpenRA.Mods.D2k\OpenRA.Mods.D2k.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4344}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.TS", "OpenRA.Mods.TS\OpenRA.Mods.TS.csproj", "{5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}"
@@ -158,6 +160,10 @@
{C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|x86.Build.0 = Debug|x86
{C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|x86.ActiveCfg = Release|x86
{C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|x86.Build.0 = Release|x86
+ {C0B0465C-6BE2-409C-8770-3A9BF64C4341}.Debug|x86.ActiveCfg = Debug|x86
+ {C0B0465C-6BE2-409C-8770-3A9BF64C4341}.Debug|x86.Build.0 = Debug|x86
+ {C0B0465C-6BE2-409C-8770-3A9BF64C4341}.Release|x86.ActiveCfg = Release|x86
+ {C0B0465C-6BE2-409C-8770-3A9BF64C4341}.Release|x86.Build.0 = Release|x86
{5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|x86.ActiveCfg = Debug|x86
{5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|x86.Build.0 = Debug|x86
{5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|x86.ActiveCfg = Release|x86

+ 11
- 0
data/patches/windows/windows-ra2-make-modstrings.patch View File

@ -0,0 +1,11 @@
--- a/make.ps1
+++ b/make.ps1
@@ -108,7 +108,7 @@
if ($version -ne $null)
{
- $mods = @("mods/ra/mod.yaml", "mods/cnc/mod.yaml", "mods/d2k/mod.yaml", "mods/ts/mod.yaml", "mods/modchooser/mod.yaml", "mods/all/mod.yaml")
+ $mods = @("mods/ra/mod.yaml", "mods/cnc/mod.yaml", "mods/d2k/mod.yaml", "mods/ts/mod.yaml", "mods/ra2/mod.yaml", "mods/modchooser/mod.yaml", "mods/all/mod.yaml")
foreach ($mod in $mods)
{
$replacement = (gc $mod) -Replace "Version:.*", ("Version: {0}" -f $version)

+ 145
- 15
data/windows/install.ps1 View File

@ -50,14 +50,24 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
$hotfixes = Read-Host "Use these hotfixes? (y/N)"
if ($hotfixes -eq "y") {
"`nHotfixes applied. Continuing."
"`nHotfixes applied. Continuing."
} else {
"`nHotfixes ignored and skipped. Continuing."
"`nHotfixes ignored and skipped. Continuing."
}
}Else{
"`nAvailable hotfixes: None"
}
"`n- Dune 2 -- Question`n"
$dune2_install = Read-Host "Additionally, Dune 2 can be installed, too. Do you want to install it? [y/N] (Default: y)"
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nInstall Dune 2: Yes"
} else {
"`nInstall Dune 2: No"
}
Start-Sleep -s 2
#------------------------------------------------------
@ -67,9 +77,11 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
Remove-Item .\data\windows\OpenRA-bleed -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item .\data\windows\ra2-master -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item .\data\windows\d2-master -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item .\data\windows\OpenRA-bleed.zip -Force -ErrorAction SilentlyContinue
Remove-Item .\data\windows\ra2-master.zip -Force -ErrorAction SilentlyContinue
Remove-Item .\data\windows\d2-master.zip -Force -ErrorAction SilentlyContinue
Remove-Item .\data\windows\*.html -Force -ErrorAction SilentlyContinue
Remove-Item .\data\windows\*.txt -Force -ErrorAction SilentlyContinue
@ -97,6 +109,14 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
"`nDownloading Red Alert 2 mod files from Github. Please Stand By."
$client.DownloadFile("https://github.com/OpenRA/ra2/archive/master.zip?ref=master",".\data\windows\ra2-master.zip")
#------------------------------------------------------
## Download Dune 2 mod files
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nDownloading Dune 2 mod files from Github. Please Stand By."
$client.DownloadFile("https://github.com/OpenRA/d2/archive/master.zip?ref=master",".\data\windows\d2-master.zip")
}
#------------------------------------------------------
## Unzip OpenRA-bleed source files
@ -118,17 +138,43 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
$destination.Copyhere($zip_file2.items())
#------------------------------------------------------
## Merge OpenRA source files and Red Alert 2 mod files together
## Unzip Dune 2 mod files
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nUnzipping Dune 2 mod files into \data\windows folder."
$shell_app=new-object -com shell.application
$filename3 = "d2-master.zip"
$zip_file3 = $shell_app.namespace((Get-Location).Path + "\data\windows" + "\$filename3")
$destination = $shell_app.namespace((Get-Location).Path + "\data\windows")
$destination.Copyhere($zip_file3.items())
}
#------------------------------------------------------
## Merge OpenRA source files and Red Alert 2 (& Dune 2) mod files together
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nMerging OpenRA source & Red Alert 2 + Dune 2 mod files."
Copy-Item -Recurse ".\data\windows\d2-master\OpenRA.Mods.D2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.D2"
Copy-Item -Recurse ".\data\windows\d2-master" ".\data\windows\OpenRA-bleed\mods\d2"
Copy-Item -Recurse ".\data\windows\ra2-master\OpenRA.Mods.RA2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.RA2"
Copy-Item -Recurse ".\data\windows\ra2-master" ".\data\windows\OpenRA-bleed\mods\ra2"
} else {
"`nMerging OpenRA source & Red Alert 2 mod files."
Copy-Item -Recurse ".\data\windows\ra2-master\OpenRA.Mods.RA2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.RA2"
Copy-Item -Recurse ".\data\windows\ra2-master" ".\data\windows\OpenRA-bleed\mods\ra2"
}
"`nMerging OpenRA source & Red Alert 2 mod files."
Copy-Item -Recurse ".\data\windows\ra2-master\OpenRA.Mods.RA2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.RA2"
Copy-Item -Recurse ".\data\windows\ra2-master" ".\data\windows\OpenRA-bleed\mods\ra2"
Remove-Item -Recurse .\data\windows\ra2-master\*
#------------------------------------------------------
## Get OpenRA Git version number
"`nRetrieving OpenRA & Red Alert 2 Git version numbers."
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nRetrieving OpenRA & Red Alert 2 + Dune 2 Git version numbers."
} else {
"`nRetrieving OpenRA & Red Alert 2 Git version numbers."
}
$web = New-Object System.Net.WebClient
$web.DownloadFile("https://github.com/OpenRA/OpenRA",".\data\windows\openra-github.html")
@ -180,16 +226,69 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
$ra2_folderversion = [IO.File]::ReadAllText(".\data\windows\ra2-latestcommit.txt").trim("`r`ngit")
#------------------------------------------------------
## Prepare OpenRA source code for Tiberian Sun & Red Alert 2
## Get Dune 2 Git version number
Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
if ($hotfixes -eq "y") {
Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
$web = New-Object System.Net.WebClient
$web.DownloadFile("https://github.com/OpenRA/d2",".\data\windows\d2-github.html")
$flag=0
Get-Content .\data\windows\d2-github.html |
foreach {
Switch -Wildcard ($_){
"*Latest commit*" {$flag=1}
"*time datetime*" {$flag=0}
}
if ($flag -eq 1){
Out-File .\data\windows\d2-html-stripped.txt -InputObject $_ -Append
}
}
(Get-Content .\data\windows\d2-html-stripped.txt)[2] -replace '\s','' | Foreach-Object{ 'git-' + $_ } > .\data\windows\d2-latestcommit.txt
$d2_gitversion = [IO.File]::ReadAllText(".\data\windows\d2-latestcommit.txt").trim("`r`n")
Write-Output "Dune 2 version: $d2_gitversion"
#This is used in folder name
$d2_folderversion = [IO.File]::ReadAllText(".\data\windows\d2-latestcommit.txt").trim("`r`ngit")
}
#------------------------------------------------------
## Prepare OpenRA source code for Tiberian Sun & Red Alert 2 (& Dune 2)
#Add patches & hotfixes
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
if ($hotfixes -eq "y") {
Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
}
#This file will conflict with windows-d2-make-modstrings.patch
Remove-Item .\data\windows\windows-ra2-make-modstrings.patch -Force -ErrorAction SilentlyContinue
} else {
Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
if ($hotfixes -eq "y") {
Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
}
#Remove Dune 2 patches
Remove-Item .\data\windows\windows-d2*.patch -Force -ErrorAction SilentlyContinue
}
Start-Sleep -s 3
"`nPatching OpenRA source code for Tiberian Sun & Red Alert 2."
#Start patching operation
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nPatching OpenRA source code for Tiberian Sun & Red Alert 2 + Dune 2."
} else {
"`nPatching OpenRA source code for Tiberian Sun & Red Alert 2."
}
cd .\data\windows
@ -203,6 +302,7 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
cd ..
cd ..
#------------------------------------------------------
## Push version numbers to mod files
@ -228,6 +328,11 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
# All
(Get-Content .\data\windows\Openra-bleed\mods\all\mod.yaml) -replace '{DEV_VERSION}',$openra_gitversion | Set-Content .\data\windows\Openra-bleed\mods\all\mod.yaml
#Dune 2
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
(Get-Content .\data\windows\Openra-bleed\mods\d2\mod.yaml) -replace '{DEV_VERSION}',$d2_gitversion | Set-Content .\data\windows\Openra-bleed\mods\d2\mod.yaml
}
#------------------------------------------------------
## Remove temporary files
@ -239,7 +344,12 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
#------------------------------------------------------
## Compile OpenRA with Tiberian Sun & Red Alert 2
"`nCompiling OpenRA with Tiberian Sun & Red Alert 2.`n"
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nCompiling OpenRA with Tiberian Sun & Red Alert 2 + Dune 2.`n"
} else {
"`nCompiling OpenRA with Tiberian Sun & Red Alert 2.`n"
}
cd .\data\windows\OpenRA-bleed\
.\make.cmd dependencies
.\make.cmd all
@ -263,6 +373,10 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
Remove-Item -Recurse .\data\windows\OpenRA-bleed\packaging
Remove-Item -Recurse .\data\windows\OpenRA-bleed\thirdparty
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.D2
}
Remove-Item .\data\windows\OpenRA-bleed\.editorconfig
Remove-Item .\data\windows\OpenRA-bleed\.gitattributes
Remove-Item .\data\windows\OpenRA-bleed\.gitignore
@ -313,7 +427,12 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\fetch-content.sh
Remove-Item -Recurse .\data\windows\OpenRA-bleed\mods\ra2\OpenRA.Mods.RA2
Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion"
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion"
} else {
Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion"
}
Remove-Item .\data\windows\OpenRA-bleed\* -Recurse
Remove-Item .\data\windows\OpenRA-bleed
Remove-Item .\data\windows\ra2-master
@ -321,15 +440,26 @@ If (Test-Path ".\data\hotfixes\windows\*.patch"){
#------------------------------------------------------
## Post-installation messages
"`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion' folder"
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion' folder"
} else {
"`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion' folder"
}
Start-Sleep -s 4
"`nTO PLAY OPENRA: Click OpenRA.exe (maybe you should create a desktop shortcut for it?)"
"`nTO PLAY TIBERIAN SUN: Launch the game and download the required asset files from the web when the game asks you to do so."
"`nTO PLAY RED ALERT 2: you must install language.mix, multi.mix, ra2.mix and theme.mix into \My Documents\OpenRA\Content\ra2\ folder.`nYou find these files from original RA2 installation media (CD's):`n`ntheme.mix, multi.mix = RA2 CD Root folder`nra2.mix, language.mix = RA2 CD Root\INSTALL\Game1.CAB (inside that archive file)"
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
"`nTO PLAY DUNE 2: Please see https://github.com/Fincer/openra-tibsunra2/ front page for further instructions."
}
"`nMULTIPLAYER: It's recommended to build OpenRA using exactly same GIT source files for multiplayer usage to minimize possible version differences/conflicts between players. Please make sure all players have exactly same git versions of their in-game mods (RA, CNC, D2K, TS, RA2). Version numbers are formatted like 'git-e0d7445' etc. and can be found in each mod description in the mod selection menu."
"`nFor this compilation, the version numbers are as follows:"
Write-Output "OpenRA version: $openra_gitversion"
Write-Output "RA2 version: $ra2_gitversion"
if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
Write-Output "Dune 2 version: $d2_gitversion"
}
"`nUNINSTALLATION: Since the game has been compiled from source and no additional setup programs are provided, all you need to do is to delete the contents of 'OpenRA-bleed-tibsunra2' folder and \My Documents\OpenRA\"
"`nHave fun!"
exit


+ 58
- 9
linux-install.sh View File

@ -66,12 +66,13 @@ echo -e "\nWhoops! Something went wrong. Please check possible error messages ab
function endtext_ok() {
OPENRA_GITVERSION=git-$(git ls-remote https://github.com/OpenRA/OpenRA.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
RA2_GITVERSION=git-$(git ls-remote https://github.com/OpenRA/ra2.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
D2_GITVERSION=git-$(git ls-remote https://github.com/OpenRA/d2.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
echo -e "$bold_in\n***OpenRA compilation script completed.\nPlease see further instructions below.***$out"
sleep 2
echo -e "$bold_in\n***MANUAL INSTALLATION***$out\n\nInstall OpenRA by typing '$PACKAGEMANAGER_INSTALL $WORKING_DIR/$PACKAGE_NAME' (without quotations) in a terminal window."
sleep 4
echo -e "$bold_in\n***TIBERIAN SUN & RED ALERT 2 - HOWTO***$out\n\nTO PLAY TIBERIAN SUN: Launch the game and download the required asset files from the web when the game asks you to do so.\n\nTO PLAY RED ALERT 2: You must install language.mix, multi.mix, ra2.mix and theme.mix into '$HOME/.openra/Content/ra2/' folder. You find these files from original RA2 installation media (CD's):\n\n-theme.mix, multi.mix = RA2 CD Root folder\n-ra2.mix, language.mix = RA2 CD Root/INSTALL/Game1.CAB (inside that archive file)$bold_in\n\n***LAUNCHING OPENRA***$out\n\nTo launch OpenRA, simply type 'openra' (without quotations) in your terminal or use a desktop shortcut file.$bold_in\n\n***UNINSTALLATION***$out\n\nIf you want to remove OpenRA, just type '$PACKAGEMANAGER_REMOVE $INSTALL_NAME' (without quotations)\n\nYou can find package of $INSTALL_NAME in '$HOME' for further usage.$bold_in\n\n***MULTIPLAYER***$out\n\nIt's recommended to build OpenRA using exactly same GIT source files for multiplayer usage to minimize possible version differences/conflicts between players. Please make sure all players have exactly same git versions of their in-game mods (RA, CNC, D2K, TS, RA2). Version numbers are formatted like 'git-e0d7445' etc. and can be found in each mod description in the mod selection menu.\n\nFor this compilation, the version numbers are as follows:\nOpenRA version: $OPENRA_GITVERSION\nRA2 version: $RA2_GITVERSION\n\nHave fun!\n"
echo -e "$bold_in\n***TIBERIAN SUN & RED ALERT 2 - HOWTO***$out\n\nTO PLAY TIBERIAN SUN: Launch the game and download the required asset files from the web when the game asks you to do so.\n\nTO PLAY RED ALERT 2: You must install language.mix, multi.mix, ra2.mix and theme.mix into '$HOME/.openra/Content/ra2/' folder. You find these files from original RA2 installation media (CD's):\n\n-theme.mix, multi.mix = RA2 CD Root folder\n-ra2.mix, language.mix = RA2 CD Root/INSTALL/Game1.CAB (inside that archive file)\n\nTO PLAY DUNE 2 (if installed): Please see https://github.com/Fincer/openra-tibsunra2/ front page for further instructions.$bold_in\n\n***LAUNCHING OPENRA***$out\n\nTo launch OpenRA, simply type 'openra' (without quotations) in your terminal or use a desktop shortcut file.$bold_in\n\n***UNINSTALLATION***$out\n\nIf you want to remove OpenRA, just type '$PACKAGEMANAGER_REMOVE $INSTALL_NAME' (without quotations)\n\nYou can find package of $INSTALL_NAME in '$HOME' for further usage.$bold_in\n\n***MULTIPLAYER***$out\n\nIt's recommended to build OpenRA using exactly same GIT source files for multiplayer usage to minimize possible version differences/conflicts between players. Please make sure all players have exactly same git versions of their in-game mods (RA, CNC, D2, D2K, TS, RA2). Version numbers are formatted like 'git-e0d7445' etc. and can be found in each mod description in the mod selection menu.\n\nFor this compilation, the version numbers are as follows:\nOpenRA version: $OPENRA_GITVERSION\nRA2 version: $RA2_GITVERSION\nDune 2 version (if installed): $D2_GITVERSION\n\nHave fun!\n"
}
##-------------------------------------------------------------
@ -89,7 +90,19 @@ if [[ $DISTRO =~ "$ARCH" ]]; then
sleep 1
rm $WORKING_DIR/data/linux/arch_linux/*.patch
cp ./data/patches/linux/*.patch ./data/linux/arch_linux/
echo -e "\nDune 2 -- Question\n"
read -r -p "Additionally, Dune 2 can be installed, too. Do you want to install it? [y/N] (Default: y) " dune2_install
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
#Copy all patch files excluding the one which modifies 'mods' string in the Linux Makefile (double patching it will cause conflicts between D2 and RA2)
cp ./data/patches/linux/*.patch ./data/linux/arch_linux/
rm ./data/linux/arch_linux/linux-ra2-make-modstrings.patch
else
#Copy all patch files excluding the ones for Dune 2.
cp ./data/patches/linux/*.patch ./data/linux/arch_linux/
rm ./data/linux/arch_linux/linux-d2*.patch
fi
if [[ ! $(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | wc -l) -eq 0 ]]; then
echo -e "\nHotfixes -- Question\n"
@ -123,19 +136,46 @@ if [[ $DISTRO =~ "$ARCH" ]]; then
echo -e "Use hotfixes:$bold_in No$out"
fi
fi
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
echo -e "Install Dune 2:$bold_in Yes$out"
else
echo -e "Install Dune 2:$bold_in No$out"
fi
sleep 3
echo -e "$bold_in\n***Starting OpenRA compilation process.***$out\n"
sleep 2
#Find all old patch occurences in PKGBUILD file and delete them.
sed -i '/"git:\/\/github.com\/OpenRA\/ra2.git"/,/sha1sums/{//!d}' $WORKING_DIR/data/linux/arch_linux/PKGBUILD
if [[ ! $(grep -rnw $WORKING_DIR/data/linux/arch_linux/PKGBUILD -e d2.git | wc -l) -eq 0 ]]; then
sed -i '/"git:\/\/github.com\/OpenRA\/d2.git"/d' $WORKING_DIR/data/linux/arch_linux/PKGBUILD
cd $WORKING_DIR/data/linux/arch_linux/
patch -Np1 -R < $WORKING_DIR/data/linux/linux-d2-archlinux-pkgbuild.patch 2>/dev/null #Revert Dune 2 special PKGBUILD patch. Silent errors.
cd $WORKING_DIR
fi
sed -i '//i '${PATCHES}')' $WORKING_DIR/data/linux/arch_linux/PKGBUILD
#Add Dune 2 to PKGBUILD if it is going to be installed
if [[ ! $dune2_install =~ ^([nN][oO]|[nN])$ ]]; then
#Add Dune 2 sources (PKGBUILD -- source variable) -- Add Dune 2 git source
sed -i '/source=(/a "git:\/\/github.com\/OpenRA\/d2.git"' $WORKING_DIR/data/linux/arch_linux/PKGBUILD
#Add Dune 2 specific strings (PKGBUILD) -- Move Dune 2 source files + get version from Github + remove buildtime files
#This is a special patch file used ONLY to patch PKGBUILD file.
cd $WORKING_DIR/data/linux/arch_linux/
patch -Np1 -i $WORKING_DIR/data/linux/linux-d2-archlinux-pkgbuild.patch
cd $WORKING_DIR
fi
#Find all patch files and list them in PKGBUILD
PATCHES=$(find ./data/linux/arch_linux/ -maxdepth 1 -type f -iname "*.patch" | sed -e 's/.*\///' | sed -e ':a;N;$!ba;s/\n/ /g' -e 's/ \+/\\n/g')
sed -i '/"git:\/\/github.com\/OpenRA\/ra2.git"/a '${PATCHES}')' $WORKING_DIR/data/linux/arch_linux/PKGBUILD
cd ./data/linux/arch_linux
rm -rf */
if [[ -f $(find $WORKING_DIR/data/linux/arch_linux/ -type f -iname "*.tar.xz") ]]; then
@ -149,6 +189,7 @@ if [[ $DISTRO =~ "$ARCH" ]]; then
else
rm -rf */
rm ./*.patch
rm ./*.orig
find . -name 'sed*' -delete
endtext_fail
exit 1
@ -166,13 +207,21 @@ if [[ $DISTRO =~ "$ARCH" ]]; then
$PACKAGEMANAGER_INSTALL --noconfirm $WORKING_DIR/$PACKAGE_NAME
echo -e "$bold_in\n***OpenRA installation completed.***$out"
fi
#Find all patch occurences in PKGBUILD file and delete them.
sed -i '/"git:\/\/github.com\/OpenRA\/ra2.git"/,/sha1sums/{//!d}' $WORKING_DIR/data/linux/arch_linux/PKGBUILD
sed -i '/"git:\/\/github.com\/OpenRA\/d2.git"/d' $WORKING_DIR/data/linux/arch_linux/PKGBUILD
if [[ ! $(grep -rnw $WORKING_DIR/data/linux/arch_linux/PKGBUILD -e d2.git | wc -l) -eq 0 ]]; then
cd $WORKING_DIR/data/linux/arch_linux/
patch -Np1 -R -s < $WORKING_DIR/data/linux/linux-d2-archlinux-pkgbuild.patch 2>/dev/null #Revert Dune 2 special PKGBUILD patch. Silent all messages.
fi
rm -rf */
rm ./*.patch
find . -name 'sed*' -delete
cd $WORKING_DIR/data/linux/arch_linux #Yes, not needed but just makes extra sure we are in the right directory!
rm -rf */ 2>/dev/null
rm ./*.patch 2>/dev/null
rm ./*.orig 2>/dev/null
find . -name 'sed*' -delete 2>/dev/null
cd $WORKING_DIR
if [[ -z $PACKAGE_NAME ]]; then


Loading…
Cancel
Save