I try compile dwm (not in pkgsrc) in NetBSD and run it. I have my config.mk file look like this
PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man X11INC = /usr/pkg/include X11LIB = /usr/pkg/lib XINERAMALIBS = -lXinerama XINERAMAFLAGS = -DXINERAMA FREETYPELIBS = -lfontconfig -lXft FREETYPEINC = /usr/pkg/include/freetype2 INCS = -I${X11INC} -I${FREETYPEINC} LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\"${XINERAMAFLAGS} CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} LDFLAGS = ${LIBS} CC = cc
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/pkg/include
X11LIB = /usr/pkg/lib
XINERAMALIBS = -lXinerama
XINERAMAFLAGS = -DXINERAMA
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/pkg/include/freetype2
INCS = -I${X11INC} -I${FREETYPEINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\"${XINERAMAFLAGS}
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
LDFLAGS = ${LIBS}
CC = cc
and my .xinitrc
.xinitrc
exec dwm
But the output when I startx is:
dwm: Shared object "libX11.so.6 not found" /usr/pkg/bin/xinit: connection to X server lost
dwm: Shared object "libX11.so.6 not found"
/usr/pkg/bin/xinit: connection to X server lost
What did I do wrong?
strawman2511 This should also work (as root):
echo /usr/X11R7/lib >> /etc/ld.so.conf
Need to set the runtime library path in LDFLAGS. -Wl,-R/usr/X11R7/lib when using base Xorg, -Wl,-R/usr/pkg/lib when using pkgsrc Xorg.
-Wl,-R/usr/X11R7/lib
-Wl,-R/usr/pkg/lib
This is handled automatically in pkgsrc and when using pkg-config, by the way...
nia I'm sorry. I don't think I can't understand all of your comment, if you can, please explain clearly for me?
Why not one from pkgsrc?
https://pkgsrc.se/wm/dwm
Jay I think I like to do it manually 😀 . Also to dmenu and st too.
Thanks everyone, now it really works well. But @Jay I wonder if I install dwm from pkgsrc assume that I don't 'make clean' dwm, how can I recompiling it again?
strawman2511 There's a work around, PM me if you want it. It could break things and I don't want to post breakage instructions ;)
things like dwm's weird configuration system is what LOCALPATCHES in pkgsrc is for.
LOCALPATCHES