That covers a variety of cases that distros have wanted. If $XDG_DATA_HOME/share/surge exists use thatĮlse if ~/.local/share/surge exists use thatĮlse if ~/.local/share/Surge exists use thatĮlse if $CMAKE_BUILD_PREFIX/share/surge exists You can see what we ended up with here (and this, remember, is to find 2 directories - a factory and user data path). On the variety of configuration choices that constitute the experiences generally know as "the" linux desktop it is a bit more complicated. vst3 next to each other and move them wherever. This defacto lets folks put their directories and.
the portable flavor will fall back to that, but before it does so, it looks up the DLL location and checks if there is a directory called "SurgeData" and "SurgeUserData" next to the VST3 If there is it uses those directories. The non-portable flavor puts factory assets in %PROGRAMDATA%\Surge and user data in %MY_DOCUMENTS%\Surge (basically). On windows we have two flavors, a portable and a non-portable flavor.
We use either the system or user Library directory for factory assets and the user documents directory for user presets and the like (~/Documents/Surge but with the proper API). We ended up with a variety of waterfalls and have a lot of assets required to run so it matters. I think one of the single most opined on features in surge has been 'where does stuff go'.