Pkg3: Multiple packages per .git repository

I have a graphical package that I would like to distribute as a single .git repository, that actually contains two separate modules.


  • On some systems, Cairo.jl will work fine, whereas Gtk.jl might not (ex: JuliaBox).
  • Want to distribute a plotting package with a Cairo layer for generating the plots themselves, and a Gtk layer to get an interactive GUI.


Currently, InspectDR is organized as follows (-> means “depends on”):

InspectDR.jl -> Cairo.jl + Gtk.jl

But I would like to restructure the InspectDR.jl package such that:

InpsectDR.jl (package)
|--InspectDRImage (module) -> Cairo.jl
|--InspectDRGtk (module) -> InspectDRImage + Gtk.jl

If I use the old system, I have to add both Cairo & Gtk to the REQUIRE file. But that causes installation issues on systems where Gtk does not work.

The Solution??

If I understand correctly, I would like a user to be able to ] add InspectDR, but only build InspectDRImage & using InspectDRImage - without ever referencing the InspectDRGtk module (which would try to install Gtk on the user’s machine).

…Although maybe the way to do this is to have the user ] add InspectDRImage directly - and have Julia’s package manager know to grab it from the InpsectDR.jl .git repository.

Need Help

Can someone point me to a similar package somewhere - or possibly a set of instructions that closely relates to what I am looking for?

I cannot figure out how to do this with the new Project.toml & Manifest.toml files.

1 Like

@dilumaluthge has logged this question as an issue that you might wish to follow. I’m also very interested in seeing this particular functionality. For projects that have multiple “adapter” sub-packages, having a way to keep them all in the same git repository would be very helpful. I know this was discussed in the birds of a feather at JuliaCon, but I’m curious if there’s been progress?

1 Like

Thanks for the heads up.

I did not make any progress with this myself. I sort of gave up and decided to stick with a sub-optimal solution.

It looks like opening an issue with Pkg.jl was the way to go.

WIP PR for it is here I’ll try finish it next week. Registrator.jl also needs to add support for this.