Shipping a wrapper along with downloaded libraries

Hey everybody,

I wrote a wrapper for the ZWO ASI cameras [1]. 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:

  1. Installing the wrapper itself
  2. Downloading the SDK from the manufacturer homepage, selecting for the right OS.
  3. Extracting the SDK, copying the right .so file (OS/architecture) to some convenient place
  4. Install the udev rules for the camera <- probably requires elevated rights
  5. 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…