It is currently 28 Mar 2024, 16:08

WELCOME TO SIMUSCAPE!


Please Sign in or Register to enable all features, remove restrictions and gain additional access!
For information on how to bypass the CAPTCHA or to contact Team Simuscape, Continue Here!


Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
PostPosted: 18 Jun 2012, 18:31 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 480
Location: The Netherlands
Thnx for moving it to the right place and thnx for the links. I have fiddled a bit with it and got it to work! It is not difficult to do, but it is tricky. Make one tiny mistake and it won't work.

I will try to explain what I have done to get it to work in a windows environment. But first 2 important things:

1. Choose your directorynames very carefully!! Make sure there are no spaces in the names. In the wiki's that can be found it is only said that the name of the directory where you are going to place MinGW (the program you need to compile with) in should have no spaces, but all other subdirectories that will come later should have no spaces too. And here comes the important part: If your windows username has spaces in it, you should make another account with a name that has no spaces and work from there!!!!! This is very important as MinGW will make a folder where it will put important secondary programmes with your username and if that folder has spaces in it the compiling will not work. And trying to rename that folder won't work either. So I recommend logging in to an accountname without spaces and it will work fine.

2. When trying to apply patches, look carefully for which version of OTTD they apply. Often the clue is already in the name (for example map-1M-20820.patch might only work with OTTD releasenumber 20820). Most of the times trying to apply a patch to another version will not work.


Right, lets get going.

There are 2 programs you will need to download:

- MinGW (this will apply the patch and compile OTTD) : http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/
-TortoiseSVN (this will enable you to download the specific version of OTTD you need for the patch) : http://tortoisesvn.tigris.org/

We'll start with MinGW first:
Follow the exact instructions as described in this Wiki: http://wiki.openttd.org/Compiling_on_MinGW

Follow all the steps in these instructions closely, pay extra attention to the setting up MSYS part, do that wrong and it wont work.

When you get to the "getting the sourcecode" part, don't follow the instructions of that Wiki, but do this:
- Download and install TortoiseSVN
- Make a new folder
- Right click on it
- Choose "SVN Checkout..." from the menu
- In the URL of Repository part, enter this: svn://svn.openttd.org/trunk
- In the Checkout Directory part, enter the location of where the repository should be downloaded to
- At the Revision part, check the Revision box and enter the revisionnumber (that is the OTTD release number to which the patch is applied)
- Hit OK, wait a few minutes for all files to download

Example (enter the versionnumber in place of the xxxxxx):
Attachment:
01.png
01.png [ 74.22 KiB | Viewed 4037 times ]

NOTE: checking the HEAD revision box will get you the latest nightly.

Before applying a patch it is recommended to compile this clean version (the source) first to check if you have followed all the steps described in the wiki correctly. If you can't compile this clean version, you should restart from scratch.

To compile follow the instructions as described in the last section of the wiki, but don't forget to copy/paste the source into your home folder (by default it is C:\MinGW\msys\1.0\home\<user_name>\<source_name>).

This is an example of the foldersetup I have:
Attachment:
02.png
02.png [ 31.74 KiB | Viewed 4037 times ]


If this all worked you should get an openttd.exe in C:\MinGW\msys\1.0\home\<user_name>\<source_name>\bin and all your settings are correct, so you are ready to apply a patch. This is fairly simple:

- Again, place an uncompiled source in your home folder
- copy/paste the patch-file in the <source_name> folder
- Start MSYS.bat
- Run: cd C:\MinGW\msys\1.0\home\<user_name>\<source_name>
Attachment:
03.png
03.png [ 19.92 KiB | Viewed 4036 times ]

- Run: patch -p0 -i <filename>
Attachment:
04.png
04.png [ 24.24 KiB | Viewed 4036 times ]

Unless it's a mercurial/git patch, in which case substitute -p0 for -p1
You can usually tell by opening the patch in a text editor, and if it has lots of a/src... and b/src then try it with -p1 instead.
Also patch will stop and complain if you've used the wrong p option.
If you get any errormessages, don't bother trying to compile and try again with another sourceversion or patchversion.
- if you didn't get errors, run: ./configure
- and finally run: make

And after a few minutes your freshly patched OTTD is ready ;-)


Last edited by Quast65 on 19 Jun 2012, 15:04, edited 6 times in total.

Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Status SimuscapeTerms of UseAbout Simuscape

Design by SAC © 2012-2015, Sweden • Powered by phpBB • Based on twilightBB by Daniel St. Jules