Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
patch [options] [originalfile [patchfile]]
but usually just
patch -pnum <patchfile
I'm such a n00b, that I don't know which file I'm supposed to patch, am I supposed to patch it before or after compilation and that whole -pnum (-p0, -p1) thing was plain gibberish*. Couldn't really comprehend it. Man page didn't really have any step-by-step examples.. Could someone help me out with this one?
Thanks!
*
Code:
If the header is that of a context diff, patch takes the old and new
file names in the header. A name is ignored if it does not have
enough slashes to satisfy the -pnum or --strip=num option. The name
/dev/null is also ignored.
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
Rep:
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.
Last edited by titopoquito; 05-06-2007 at 06:35 AM.
So I should move single_click.diff to directory WindowMaker-0.92.0, and from there run command
Code:
patch -p0 <single_click.diff
Right? Then it checks that absolute path from there to WPrefs.app/Expert.c matches? And as it should match then, it will patch rest of the patchable files as well? Ok, I think I understood. Back to runlevel 3 and try it then. Thanks!
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
Rep:
Leave the patch where it is and do
Code:
patch -p0 < contrib/single_click.diff
from within the Windows Maker source folder. Then patch looks if it finds the file ./WPrefs.app/Expert.c (relative path) and will apply the patch file.
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?
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
Rep:
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
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi
# If the user lacks $HOME/GNUstep, install it:
if [ ! -f $HOME/GNUstep/Defaults/WindowMaker ]; then
wmaker.inst
fi
# Test for cpp, which wmaker uses to process config files:
if [ ! -x /usr/bin/cpp ]; then
NOCPP="--no-cpp"
fi
# Start the window manager:
exec /usr/bin/wmaker $NOCPP
Does Zenwalk have "xwmconfig" to choose the window manager? Else copy the file to your user's home directory as ".xinitrc". This way "startx" should fire up Window Maker as your gui IMHO
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! Window Maker preferences doesn't have pictures and text is missing from minimized apps. I'll check those xinitrc's again for some fails and such.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.