Dynamic Window Manager install with patch(es)

Matthew Seaman m.seaman at infracaninophile.co.uk
Thu Sep 22 07:06:00 UTC 2011

On 22/09/2011 00:51, Andy Zammy wrote:
> According to the instructions listed here: http://dwm.suckless.org/patches/ I
> figured I'm to use the "tarball method" as that's how ports fetches dwm. I
> tried applying the method to /usr/ports/x11-wm/dwm/work/dwm-5.9 but it
> didn't work (malformed patch).

This is pretty much the correct approach.  Although to do it in the best
ports fashion, you'ld save the patch file to
${PORTSDIR}/x11-wm/dwm/files/patch-something-or-other and then the ports
would patch the sources for you automatically any time you rebuilt the
port.  Don't worry about that for the time being though.  Just getting
the patch to apply by hand is a good first step.

It's quite normal for ports to apply patches this way -- the dwm port
already has patches for Makefile and config.mk.  If your patch attempts
to patch those same files it could fail.  However the error message
would be 'patch failed to apply' which is obviously not what you're getting.

The big question is why the patch you already have appears to be
malformed.  How did you obtain it?  Can you repeat the process paying
attention to any error messages and so forth and see if that works better?

> I've used ubuntu for about a year but for all intents and purposes I'm still
> a beginner with UNIX-like, and I've never used patch or diff before. But, I
> remembered that these are ports and wonder if these patches would work on
> FreeBSD source? Would I have to apply the patch to the tarball while it's in
> distfiles before it gets 'ported' to freebsd? Or am I talking crazy?

No -- modifying the tarball is possible, but as the effect is exactly
the same as what you tried above and as it will then fail the checksum
tests, well, it's not worth the bother.

patch and diff at this level work in exactly the same way on just about
any unix (eg FreeBSD) or unix-alike (Linux including Ubuntu) and
probably a few weird OSes you've never heard of.  Like I said, applying
patches is a common action the ports will do for you.



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20110922/c93723fa/signature.pgp

More information about the freebsd-questions mailing list