I wrote a wrapper for the ZWO ASI cameras . I now want to package the wrapper in a way that downloads the library (MIT-License), so that the end-user can install the wrapper just by calling
add LibASICamera. More specific, the installation process should comprise:
- Installing the wrapper itself
- Downloading the SDK from the manufacturer homepage, selecting for the right OS.
- Extracting the SDK, copying the right .so file (OS/architecture) to some convenient place
- Install the udev rules for the camera <- probably requires elevated rights
- Delete all temporary, unnecessary files
What is the best way to achieve this?
When you install a package, the package manager runs the
deps/build.jl file if it exists. In this file, you can do pretty much anything to set up your package. As an example of a package that downloads things in a custom way, see here: https://github.com/aviks/Taro.jl/blob/master/deps/build.jl
However if the native libraries are open source, you may want to use BinaryBuilder. This will make things much smoother. See here for docs: https://juliapackaging.github.io/BinaryBuilder.jl/latest/
Thanks for the example, that should help! Unfortunately, the library is not open source (but freely redistributable). Regarding installing the udev rules, I will probably outsource this to the end-user by presenting some command to run, as it requires root rights…