Re: dwm pkgsrc vs custom compile

Leonardo Taccari <[email protected]> Thu, 05 May 2016 22:26:40 +0200
Newsgroups gmane.os.netbsd.devel.general
Message-ID <20160505202648.C9B6E85DFF__29832.6526921757$1462480030$gmane$org@mail.netbsd.org>
Hello Firecrow,
(moving the thread to pkgsrc-users@ which is more appropriate)

Firecrow Silvernight writes:
> Hi,
> Trying to build dwm from source so I can put in some modifications,
> it's odd when I install dwm from pkgsrc it works. but if I take
> the contents of the distutils tar and compile it, it does not work.
> Any idea how I can find what variables pkgsrc is passing to make to
> compile this code.
Sure! In order to (more or less) mimic the wm/dwm pkgsrc behaviour you
can adjust dwm's config.mk as follow:

 X11INC = /usr/X11R7/include
 X11LIB = /usr/X11R7/lib
 FREETYPEINC != freetype-config --cflags
 INCS = -I${X11INC} ${FREETYPEINC}
 LIBS = -L${X11LIB} -lX11 -Wl,-R${X11LIB} ${XINERAMALIBS} ${FREETYPELIBS}

However, as coypu suggested you can use the pkgsrc package (and that's
usually much more maintainable!).
You can also use the LOCALPATCHES pkgsrc feature, e.g. add in
/etc/mk.conf:

 LOCALPATCHES=           /usr/pkgsrc/localpatches

...then all patches present in ${LOCALPATCHES}/category/<package/ will
be honored and applied for category/package.
Due the handling of config.h by dwm you can just generate a patch
against /dev/null, e.g.:

 $ mkdir -p /usr/pkgsrc/localpatches/wm/dwm
 [ ...write/adjust a config.h suitable for dwm... ]
 $ diff -u /dev/null config.h > /usr/pkgsrc/localpatches/wm/dwm/patch-config.h

...and - if the "format" of config.h doesn't change between versions - it
will be automatically applied also when dwm is updated to a newer
version.


Ciao,
L.