Howto apply a patch/diff file

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
LKRaider
Transport Coordinator
Transport Coordinator
Posts: 360
Joined: 23 Mar 2005 04:05
Location: Brasil
Contact:

Post by LKRaider »

What version of GCC you have installed (gcc -v)?

Did you install the gcc-mingw package?

Check if "cc1.exe" exists in your cygwin installation: check the directory /usr/lib/gcc-lib/i686-pc-cygwin/(your gcc version).

Try running: export PATH=$PATH:/usr/lib/gcc-lib/i686-pc-cygwin/(your gcc version)
User avatar
bruce89
Engineer
Engineer
Posts: 76
Joined: 06 Dec 2005 17:28
Location: Glasgow, Scotland
Contact:

Yikes

Post by bruce89 »

Just install Linux already, it'd make all this a lot easier. I mean, your avatar is a penguin anyway.
User avatar
RSpeed tycoonfreak
Transport Coordinator
Transport Coordinator
Posts: 349
Joined: 02 Feb 2006 13:17
Location: Azewijn The netherlands
Contact:

Post by RSpeed tycoonfreak »

I read about TotoiseSVN downloaded TortoiseSVN, Installed it, and now i dont know what to do.
At http://wiki.openttd.org/index.php/FAQ_d ... ource_code i read this:
Right-click on the folder with the OpenTTD source code, open the TortoiseSVN submenu and select 'Apply Patch...'. Browse to the patch file and select it. Then, right click on the 'File Patches' window and click on 'Patch All'. After you're done, close the TortoiseMerge window.
Retrieved from "http://wiki.openttd.org/index.php/FAQ_development"

but as you can see at the attachement i have not the abbillity to choose an "Apply Patch" button.
Does someone know what to do?
Attachments
What do I have to do.PNG
What do I have to do.PNG (122.75 KiB) Viewed 1637 times
Visit The Fake Airport Website
Image
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
darkpella
Engineer
Engineer
Posts: 9
Joined: 20 Apr 2006 08:59
Location: Correggio, Italy

Post by darkpella »

1. Make a new folder
2. right-click on it and choose "SVN Checkout..." from the context menu (Maybe you need to reboot after installing Tortoise to get this)
3. Set "svn://svn.openttd.org/trunk" as URL of repository
4. Uncheck all flags but "HEAD revision" (radio button, it lets yoy dowload the latest code revision)
5. Click Ok and let it download the source code to the chosen folder (whci then become your repository)
6. Right click the patch of diff file, chose "apply patch" and then, on the dialog box that opens, browse to the folder you downloaded the source to thorugh steps 1-5, cick OK and let it analyze the differences.
7. Fix all of the conflicts Tortoise finds between the source you downloaded and the patch you ar trying to apply.

Conflicts happen since the patch you are applying is based on a certain revision of the code, that was modified in subsequent revisions, hence Tortoise doesn't know whether the changes to be used ar the ones form the patch or those form the subsequent revisions, or both, and, in this latter case, in which order. Sometimes it is easy to guess it, sometimes it isn't :lol:
fozer
Engineer
Engineer
Posts: 1
Joined: 03 May 2006 16:49

?

Post by fozer »

i did all that... but when i start openttd it's exactly the same....

what do i have to do to to link the "new folder" files.. (they appear with a check or uncheck symbol) with the "openttd" folder
that's my problem if anyone could help .... tkx
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

We're assuming you are also doing step 8 - actually compiling the patched code to generate a new openttd.exe file. Is this the case?
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

you have compiled a exe file with a compiler?
darkpella
Engineer
Engineer
Posts: 9
Joined: 20 Apr 2006 08:59
Location: Correggio, Italy

Post by darkpella »

Well, I guess you have to compile the source, though I must honestly say it looks strange to me that you had the ability to understand the code to such a point that you were able to fix the code conflicts when trying to apply the patch, and didn't realize that you hade a plain source code and not yet an executable.
Sorry for brutally asking :oops:, but are you sure you understood what you're dealing with?
Anyway, if you didn't, I would suggest not trying any longer, since you're way too far from being able to make it right now :cry: (gotta learn some c-coding before).
If you did :), just read again the web-page you mentioned; you can find directions on how to compile the source code at this point.

Hope it helped, and sorry for being assertive.

Bye

darkpella
klogg
Traffic Manager
Traffic Manager
Posts: 248
Joined: 10 May 2006 13:55

Post by klogg »

It seems this is the correct thread to complain about
problems when trying to get OpenTTD the hard way...

I did everything like discribed here:
http://wiki.openttd.org/index.php/Compiling_on_MinGW

But when I try to run the script (.sh thingi)
in the libpng-1.2.8/mingwPORT folder
after donwloading (I thing) this happens:
gcc -c -O3 -s -mms-bitfields -march=i686 -o png.o png.c
In file included from png.c:13:
png.h:359:18: zlib.h: No such file or directory
In file included from png.h:363,
from png.c:13:
pngconf.h:1175: error: syntax error before '*' token
pngconf.h:1175: warning: data definition has no type or storage class
The list goes on and later, when I try to run make
he comes up with
$ make
make: libpng-config: Command not found
make: libpng-config: Command not found
make: libpng-config: Command not found
Can you guys tell me why I can't compile this png stuff?

Because I NEED the great stuff not included in the stable, precompiled release.
darkpella
Engineer
Engineer
Posts: 9
Joined: 20 Apr 2006 08:59
Location: Correggio, Italy

Post by darkpella »

Well, why not giving cygwin a chance?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

You don't have zlib properly installed.
libpng uses zlib for compression, so the appropriate headers, modules, &c. must exist in order to compile zlib. If they do exist, they aren't in a standard place; try /usr/lib/ and /usr/include/ or /usr/local/lib/ and /usr/local/include/.

Last I heard (admittedly, this was a long time ago), Cygwin didn't have a working libpng.

You may also want to try VC++ Express; this is a problem report, but it has a bunch of links that look interesting.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
klogg
Traffic Manager
Traffic Manager
Posts: 248
Joined: 10 May 2006 13:55

Post by klogg »

Thank you very much!

Please let me tell you the problem.
(Maybe someone could clarify the description on http://wiki.openttd.org/index.php/Compiling_on_MinGW)

First I installed the MinGW Compiler to C:\MinGW
And I updated the WindowsXP-wide-global-master PATH Variable.

Then I did exactly what I was told in the guide and ended up
with all the needed zlib-stuff in the directory C:\msys\mingw
I don't think I've had a fair chance because the zlib-script says:
$ ./mingwPORT.sh
Download file? (Yes)
Download file URI? (http://www.zlib.net)
Archive file type?
0) unknown
1) tar.gz
2) tgz
3) tar.bz2
4) tbz2
5) zip
Select a numeric value: (3)
Archive file? (zlib-1.2.3.tar.bz2)
Download to path? (/tmp)
Source path? (/usr/src/zlib-1.2.3)
Installation directory? (/mingw)
CFLAGS (-O3 -s -mms-bitfields -march=i686)
But by "/mingw" it means NOT C:\MinGW. That was my problem.
I solved it by copying the folders in C:\msys\mingw to C:\MinGW

Now I have one last question:
What source code should I compile when I want a version
that has most of the latest features (PBS?) but is also playable?
See, I don't want to edit the code our something...
I'm a little confused by all those nighty builds and mini integrated ones and patches.
Please give me a chance to catch on to the big picture.

klogg
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

Is there any way to combine several patches in one .diff (or .patch) file?
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
Sacro
Tycoon
Tycoon
Posts: 1145
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

Merge them all in, and then generate another diff from that
We Am De Best

Host of ThroughTheTube site
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

That's what i want to avoid. Merging each patch separately.
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

Post by iNVERTED »

um I tried applying the gradual loading patch (never tried applying a patch before) but it said a load of stuff failed, and saved stuff to some .c.rej files. Any idea what happened?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Something broke.
Determining what broke requires the output from patch.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

Post by iNVERTED »

Hmm. The topic says:
Patch against SVN trunk r5911.
So I guess I need this exact version? Where can I get that?
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Post by Maedhros »

iNVERTED wrote:Hmm. The topic says:
Patch against SVN trunk r5911.
So I guess I need this exact version? Where can I get that?
I've just tried it, and that patch applies against the latest trunk version - r5934. You're not trying to apply it to the MiniIN source are you?
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

Post by iNVERTED »

No, the source I have is called 0.4.8-RC2.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests