|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
|
Thread Tools | Display Modes |
|
|||
dwm patching
Hi.
Can someone tell me, how exactly should i patch the dwm? Is it means that i need to download source and compile/patch it manually (not from the ports), or i can do this from port? I see patches directory in /usr/ports/x11/dwm/ but is it correct to add something in a port tree? |
|
|||
I got it, thank you a lot.
|
|
||||
In FreeBSD, I create the patch and then put it in /usr/ports/x11-dwm/files. I don't know how it works in OpenBSD. To get your custom config do you do something like make DWM_CONF=$HOME/dwm/config.h install clean or something like that?
In FreeBSD, the manual way to do it would be (I'm going into this detail making an assumption which is quite possibly wrong, that it's more or less similar) Code:
make DWM_CONF=/home/scottro/config.h extract As I tend to tweak my config.h a lot while first installing on a particular machine, what I do in practice is patch dwm.c the first time--as the patch that I like is the moveresize patch with the option to make a window being moved automatically a floating window. I now have a patch, patch-dwm.c which I put, as mentioned, under files (which is the canonical place in FreeBSD if you have a patch to a port. Canonical place? Is that a thing? I digress...) Anyway, now I can keep tweaking my config.h, doing make deinstall make DWM_CONF=/home/scottro/dwm/config.h install clean without worrying anymore about having to manually install the patch. Again, I don't know how it's done with OpenBSD ports but maybe this has helped. Meh, might as well spam my own dwm page while at it, http://srobb.net/dwm.html (And I have one for spectrwm now too, http://srobb.net/spectrwm.html |
|
|||
Hm, maybe i misunderstood u, if i just put my patches in patches directory, will they apply automatically when i run "make install" ?
Cuz seems its not works that way If not, maybe i should try Scottro's method.. |
|
|||
Quote:
Code:
$ cd /usr/ports/x11/dwm $ make patch $ cd `make show=WRKDIST` <edit whatever you want to your heart's content> $ cd - $ make install |
|
|||
Quote:
Code:
diff -r 406003e3a01f dwm.c --- a/dwm.c Mon Sep 27 07:53:44 2010 +0000 +++ b/dwm.c Wed Oct 13 21:16:04 2010 +0300 @@ -36,6 +36,7 @@ #include <X11/Xlib.h> #include <X11/Xproto.h> #include <X11/Xutil.h> +#include <X11/XKBlib.h> #ifdef XINERAMA #include <X11/extensions/Xinerama.h> #endif /* XINERAMA */ @@ -93,6 +94,7 @@ Client *snext; Monitor *mon; Window win; + unsigned char kbdgrp; }; I know that is possible to go in source dir and patch manually, but .. why make patch asking me something |
|
|||
Quote:
Your dwm port is NOT in the state you got it from CVS. That part is obvious. Don't even bother trying to walk me through undoing your steps. Just blow it away and start fresh. Code:
$ cd /usr/ports/x11/dwm $ make clean $ cd .. $ rm -r dwm $ cvs up -Pd dwm |
|
|||
Yes, i did it..
Hm, its because i've added my patch files in /usr/ports/x11/dwm/patches/ directory. IS it incorrect? |
|
|||
Quote:
If you're dead set on adding patches, you need to do it with make update-patches. But if you don't understand what you're doing, don't do it. Just edit the files between your make patch and make install stages like I already outlined. |
|
|||
Oh, it works now!
Ty a lot for your help |
|
||||
Playing around with a netbook, and not feeling like playing with ports or reading, I made the nice discovery that dwm will just build on OpenBSD. In other words, downloaded the source code, made my changes to config.h and patched with a patch I like (to resize floating windows) ran make and it built.
So, for the lazy person, that's probably the easiest way. I only dabble with OpenBSD, and custom configuring dwm would be the only reason I'd be using ports--otherwise, just about all of their defaults are fine for my needs. |
|
||||
But a year later, that no longer seems to work. :-( . Getting errors on the build (from dwm's source). Just posting this as it's one of the first hits that came up when I googled dwm and OpenBSD.
However, using Brian's method works perfectly. I can customize my config.h there, and I could patch dwm.c if I wanted. (I didn't bother because on a laptop, I don't need the dwm move resize patch very often.) Last edited by scottro; 7th July 2016 at 01:35 PM. |
|
||||
Several years later, I'm updating this because it is one of the first hits for dwm openbsd.
There is now a port for dwm-6.2, which is behind FreeBSD and most versions of Linux. I use the moveresize patch and just download a diff, called something like dwm-moveresize<date>.diff. I rename it to patch-moveresize and put in the patches directory. I then run make patch. Because (I think) the diff has things like a/config.def.h b/config.def it will ask file to patch, but it gives me the lines running up to that, so it's simple to type config.def.h and dwm.c when asked for the file name. I then do as Brian says and Code:
cd `make show=WRKDIST` Then (again) as Brian instructs) cd -;make install Most people know all this stuff, but for newcomers who hit it on a web search I'll mention that if you already have a config.h you use and just want the moveresize patch for dwm.c, you can edit the diff file, remove the config.def.h stuff and also remove the a/ and b/ with the lines that have the a/dwm.c and b/dwm.c, and it then should not need to ask file to patch. Again, this is *years* after this was last posted to, but again, I came upon it in a web search, so figured I might as well update it. I have a fairly simple page about it at https://srobb.net/dwm.html Just search for OpenBSD on the page and it briefly goes over Brian's instructions. |
|
|||
I don't think there's any technical reason why we're behind, so if you'd like to send an update patch, that would be welcome.
|
|
|||
While I'm glad this is one of the first hits for 'dwm OpenBSD' I'm less glad about my unnecessary harshness in some of those replies. I may edit them to remove that edge, but not the content, since I want the content to continue to be useful for at least another 8 years!
|
|
||||
Sad to say, I'm not knowledgeable enough to update the version. There is really no big difference in 6.2 and 6.3. I'm not sure what harsh replies you're referring to, they all seem fairly decent to me. Unless you feel your own words were too harsh? (It happens as we age, trust me, I know . )
Anyway, it's all good and all still working well. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Security Staunch your Heartbleed patching: FreeBSD has a nasty credentials leak | J65nko | News | 2 | 12th May 2014 06:40 PM |
Kernel size: Why no change after patching? | Greg_Morgan | OpenBSD Installation and Upgrading | 6 | 25th July 2010 08:38 PM |
patching or updating ? | dennky | OpenBSD Installation and Upgrading | 12 | 14th January 2010 07:17 PM |