As far as I know, dub does not handle the installation of non-dub dependencies. You can describe system library requirements with the systemDependencies
entry, which will be "visible on the registry and will be displayed in case of linker errors", but they will not be installed automatically.
You could use preGenerateCommands
or preBuildCommands
to execute shell commands like you described above. I would put the install scripts in .sh/.bat scripts like you described above (so they are useable for non-dub users), and then place something like this in dub.json
:
"preGenerateCommands-posix": [ "./setup.sh" ],
"preGenerateCommands-windows": [ "./setup.bat" ]
On linux, I would typically assume the necessary .so
files are available on the standard search path (or available for install through a package manager), especially for something common like sdl.
As far as specifying search path, I just use lflags
:
"lflags": [ "-L./ext/sdl/lib" ] (or wherever the local libs are)
Sources: DUB Package Format
Full Disclosure: I haven't actually tried using preGenerateCommands
, but it sounds like what you need.