Remove empty and duplicate entries from a colon-separated path.
For example: ":a:b:b:::c:a::" → "a:b:c"
This package demonstrates that GNU Autoconf has nothing to do with ‘make’ programs. Autoconf is a tool for generating shell scripts, usually called ‘configure’. You can use the configure script here to customize a flake. You can also use our pre-configured flakes. For example:
cleanpath = {
url = "github:chemoelectric-nixos/cleanpath-flake/v1.0.3?dir=build%2Fx86_64-linux%2Frelease-25.11";
};The program is taken from the ‘cleanpath project’ at https://sourceforge.net/p/chemoelectric/odds_and_ends/ci/default/tree/cleanpath/ The dlang version is what we are using, to avoid the severely broken gcc compilers of NixOS. We compile the program statically with Digital Mars D.
There is a ‘canonical’ solution to the path-cleaning problem. It is a one-liner in Awk. You can look it up with an Internet search engine. The author of the cleanpath project prefers to use his own programs, on grounds that ‘cleanpath’ is an interesting programming challenge. The results ought to be used.