-
-
Notifications
You must be signed in to change notification settings - Fork 263
Description
I was wondering if we could write some installation targets on the Makefile that would install the source files so that we can make packages that distributions can use and users can configure more easily.
What I mean is that regular (binary) packages of dwm are a bit pointless because they are not configurable since you'd have to actually have the source code, edit it, rebuild and repackage. So instead we could install the main source files in /usr/src/dwm, and provide a target that recompiles dwm reading only from the configuration files patches.h, config.h and config.mk that could go in ~/.config/dwm.
For users, the goal is that they can install/uninstall dwm-flexipatch with their package manager; manage their config files like other programs in ~/.config; rebuild with make -C /usr/src/dwm rebuild and still have the benefits of running a small efficient executable
For package maintainers this would mean they can just use the new targets like make all-src && make install-src for these "source-packages" and not implement this logic in a packaging script
The main issue with this approach is what to do with the actual dwm executable (and possibly dwm-msg). If the rebuild target installs in /usr/bin/dwm, users would have to run make with elevated privileges and maybe package managers complain that a file was modified.
A solution can be that when /usr/bin/dwm executes, it execs another program in a user-owned directory if available, like ~/.local/lib/dwm/dwm, so users can rebuild there without sudo and each user have their own build. This could be achieved with a wrapper script or with a patch.
I have a rough prototype of this but I was wondering if it would belong here.