# Pkg3: Multiple packages per .git repository

**URL:** <https://discourse.julialang.org/t/pkg3-multiple-packages-per-git-repository/15492>\
**Category:** General Usage\
**Created:** [September 25, 2018, 10:23pm UTC](https://discourse.julialang.org/t/pkg3-multiple-packages-per-git-repository/15492 "2018-09-25T22:23:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MA\_Laforge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ma_laforge/32/385_2.png) [@MA\_Laforge](https://discourse.julialang.org/u/MA_Laforge)\
**Post date:** [September 25, 2018, 10:23pm UTC](https://discourse.julialang.org/t/pkg3-multiple-packages-per-git-repository/15492/1 "2018-09-25T22:23:22Z")

</div>

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

### Problem

- 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.

### Example

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

```julia-auto
InspectDR.jl -> Cairo.jl + Gtk.jl

```

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

```julia-auto
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.

---

<div class="post-metadata">

**Author:** ![cce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cce/32/460_2.png) [@cce](https://discourse.julialang.org/u/cce)\
**Post date:** [September 23, 2019, 3:20am UTC](https://discourse.julialang.org/t/pkg3-multiple-packages-per-git-repository/15492/2 "2019-09-23T03:20:04Z")

</div>

@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?

[https://github.com/JuliaLang/Pkg.jl/issues/1251](https://github.com/JuliaLang/Pkg.jl/issues/1251)

---

<div class="post-metadata">

**Author:** ![MA\_Laforge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ma_laforge/32/385_2.png) [@MA\_Laforge](https://discourse.julialang.org/u/MA_Laforge)\
**Post date:** [September 28, 2019, 1:21am UTC](https://discourse.julialang.org/t/pkg3-multiple-packages-per-git-repository/15492/3 "2019-09-28T01:21:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [September 28, 2019, 5:32am UTC](https://discourse.julialang.org/t/pkg3-multiple-packages-per-git-repository/15492/4 "2019-09-28T05:32:26Z")

</div>

WIP PR for it is here [add subdir functionality by KristofferC · Pull Request #1422 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/1422). I’ll try finish it next week. Registrator.jl also needs to add support for this.
