alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
278 stars 49 forks source link

Parameters for installing external crates #1582

Open Blady-Com opened 6 months ago

Blady-Com commented 6 months ago

For instance, on macOS, GTKAda crate depends on libgtk3 external crate:

[[depends-on]]
libgtk3 = ">=3.24.24"

With my environment, Alire installs GTK3 with MacPorts:

[[external]]
kind = "system"
[external.origin."case(distribution)"]
"debian|ubuntu" = ["libgtk-3-dev"]
"fedora" = ["gtk3-devel"]
arch = ["gtk3"]
msys2 = ["mingw-w64-x86_64-gtk3"]
homebrew = ["gtk+3"]
macports = ["gtk3"]

However, by default, MacPorts installs GTK3 only for X11 environment and not the Quartz native environment. I would like to specify something like that: macports = ["gtk3 +quartz"] I would be useful also on other systems by specifying a version: "debian|ubuntu" = ["libgtk-3-dev=3.24.32"]

mosteo commented 6 months ago

Specific versions is problematic as the version is autodetected at runtime, and the expectation is that only one version is associated to a system package name. Note that if you already have installed in your system the version you need, it should be found and no reinstallation attempted.

As for passing extra arguments, I will need to familiarize myself with macports to understand what makes sense in this scenario. Again, if you install the package in advance manually with the options you need, Alire should see it as installed and do nothing.

Blady-Com commented 6 months ago

Again, if you install the package in advance manually with the options you need, Alire should see it as installed and do nothing.

Yes, ok as a workaround. I would prefer rather something helping to have arguments for external crates on Alire side (especially for beginners). NB: for Macports install with variants see this section.

mosteo commented 6 months ago

NB: for Macports install with variants see this section.

Thanks for the pointer. I'm unclear on how variants cohabit. I'd say you cannot have conflicting variants installed at the same time, just one installation with elective features enabled, so to say?