Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 296 forks source link

Linuxbrew should check whether dependencies are already installed #1076

Closed omern1 closed 8 years ago

omern1 commented 8 years ago

Some dependencies may already be installed on the system by the platform's native package manager, Linux brew should check whether any of these are installed before installing them.

tseemann commented 8 years ago

I always wondered if Linuxbrew could make "virtual" installations into the Cellar by symlinking to an installed system package by querying the rpm/deb. ie. "mirror an RPM into the Cellar"

omern1 commented 8 years ago

@tseemann That is actually a very good idea.

sjackman commented 8 years ago

Yep, that would work. I've done something like that on an ad hoc basis occasionally. I wouldn't want it to be the default behaviour, because the version provided by the system, may not be compatible with the version expected to be installed by Linuxbrew.

omern1 commented 8 years ago

Could you share how you did it?

Theoretically, Linuxbrew could check if the version installed by the system is the compatible with what the formula requires.

sjackman commented 8 years ago

Could you share how you did it?

Manually, but it could be automated. For example:

mkdir -p `brew --cellar`/xz/5.2.2/bin  `brew --cellar`/xz/5.2.2/lib
ln -s /usr/bin/xz `brew --cellar`/xz/5.2.2/bin/
ln -s /usr/lib/libxz* `brew --cellar`/xz/5.2.2/lib
brew link xz
sjackman commented 8 years ago

Theoretically, Linuxbrew could check if the version installed by the system is the compatible with what the formula requires.

In fact, if you ran brew upgrade it would upgrade any host kegs that were older than the version provided by Linuxbrew unless you pinned the host keg.

omern1 commented 8 years ago

Would you be fine with this behavior if Linuxbrew checked whether the version provided by APT or whatever is the same that the formula requires?

sjackman commented 8 years ago

There's so many places that this feature could break things. For it to work we'd need to create a mapping from Linuxbrew package names to host package names. I'm not sure it's worth the trouble. Once Linuxbrew formula are all bottled (binary packages are provide), which I'm working on, I'm not sure using host packages is necessary.

DoomHammer commented 8 years ago

One problem I see with this approach is that formula names may differ from system packages (be it APT, yum, or whatever). Another: all those native package managers... their name is Legion. https://www.youtube.com/watch?v=jGALJwdBOX4

sjackman commented 8 years ago

Useful on occasion for packages without Linuxbrew formula. Closing as wontfix due to the grief that mixing package managers can create.