Applying patches to programs
Okay, I'm done reading documentation so I know how to compile a program (Window Maker) from sources (yes, I'm n00b but thought learning something else than apt-get, yum or netpkg might come handy). Source package had folder with several patches, one which I want to apply (single_click.diff which enables using dock with single clicks). After brief googling on how to apply that patch I found out about patch command and read the man pages of it, but I just don't get it!
Code:
SYNOPSIS Thanks! * Code:
If the header is that of a context diff, patch takes the old and new |
The patchfile knows which file to patch. Go to the source folder (WindowMaker-0.92.0 probably) and take a look at the patch file (less contrib/single_click.diff). At the top you see which file will get patched (maybe there are more if you scroll down, didn't look that far myself).
You will notice for example the line starting "+++ WPrefs.app/Expert.c". If you look in the source folder you will find a directory called "WPrefs.app" so that the path is correct if you are in the "root" of the source folder -- -p0 is right here. If the line mentioned started for example "+++ WindowMaker-0.92.0/WPrefs.app/Expert.c" from that point you needed to strip the first part to apply the patch right (so that the relative path from where you are points to the right file, Expert.c in this case), so -p1 would be the right option. EDIT: Fixed some maybe unclear explanation. |
So I should move single_click.diff to directory WindowMaker-0.92.0, and from there run command
Code:
patch -p0 <single_click.diff |
Leave the patch where it is and do
Code:
patch -p0 < contrib/single_click.diff |
Possibly that would have worked too, but I managed to patch it that way too (at least it told it's success). However, wmaker doesn't start. It tells "wmaker fatal error: could not open display "" ". Tried as root as well. Then wmaker --help, then checked manpage and tried to specify to use wmaker -display 0:0 (and 0:1, 0:2) but same thing. Uhh... How could I get more info than just that error or do you have any idea why it's doing that?
|
About the patch: The way you did it was totally ok, I just wanted to tell you that you can spare one step (copying the patch file).
I'm not sure on which system you want to start it. If you are doing this in Zenwalk it should be similar to the way it works in Slackware: Create a /etc/X11/xinit/xinitrc.wmaker file like this: Code:
#!/bin/sh |
Hey it worked! After some head scratching I just changed path in your file to /usr/bin/local/wmaker
But this install of window maker is by far glitchiest I've ever seen! :D Window Maker preferences doesn't have pictures and text is missing from minimized apps. :D I'll check those xinitrc's again for some fails and such. |
All times are GMT -5. The time now is 03:25 AM. |